background preloader

Linux Tips

Facebook Twitter

Bash scripting for beginning system administrators. A UNIX shell is essentially the API between the user, the kernel, and the system hardware. The shell is very important on any UNIX or Linux system and is one of the most vital aspects to learn proper systems administration and security. Typically driven by a CLI, the shell can literally make or break your system. The open source bash shell that this article examines is one of the most powerful, practical, and extensible shells available. In this article, you will learn the basic techniques of bash scripting, its everyday uses, and methods for employing it to create near-bulletproof shell scripts. History of the bash shell The Bourne Again Shell (bash) got its start in 1987, when it was written as a GNU project that many Linux distributions quickly adopted.

One of the more positive aspects of bash is its built-in security features. Bash command syntax and keywords have taken and improved upon the architecture and technical details of the Korn shell (ksh) and the C shell (csh). Back to top. How to Get Your AMD Graphics, Sound & Other Drivers to Work in Linux on Your Laptop. How to Get Your AMD Graphics, Sound & Other Drivers to Work in Linux on Your Laptop With the purchase of my latest computer, installing Linux turned into a nightmare from Hell. The graphics drivers are probably the biggest issue that anyone with a newer computer will run into when installing Linux. AMD and NVIDIA are the dominant ones on the market, both of which have awful support. Not only do graphics give us trouble, but anyone with a switchable power laptop (when you can use just AC without battery, with the battery plugged in), HDMI, audio in and out, or anyone with any kind of wonky hardware will be likely scared off from the computer and from Linux until the end of time.

From first hand experience, and a fiery, passionate love for Linux, I almost found myself running scared until I hacked together these lovely fixes that we will be going over today. Let's look at the issues that we will encounter, depending on which graphics driver the system is using. Audio Alsa does not work Video. Speaking UNIX: The best-kept secrets of UNIX power users. If you're wondering why I'm wearing dark sunglasses, a fake moustache, and a baseball cap (featuring the logo of professional curling team, The Floating Stones), I'm on the lam.

I'm dodging black remote-controlled helicopters, pasty-white systems administrators, and the combined forces of many daemons to bring you some of the best-kept secrets of UNIX® power users. Don your aluminum foil hat and read on. Save the environment variables Most UNIX users amass settings in shell startup files, such as .bashrc (for the Bash shell) and .zshrc (for the Z shell), to recreate a preferred shell environment time and again. Startup files can create aliases, set shell options, create functions, and set environment variables. Essential environment variables include HOME (which points to your home directory), PATH (which enumerates directories in which to search for applications), and MANPATH (which lists directories in which to search for man pages). Back to top Dotting the landscape !! Expand-o-Matic. Administration de machines Unix dans plusieurs fuseaux horaires. Première rédaction de cet article le 16 décembre 2011Dernière mise à jour le 17 décembre 2011 Si vous administrez des machines Unix situées dans plusieurs fuseaux horaires, vous vous êtes peut-être déjà posé la question : quel fuseau indiquer à la machine ?

Celui de sa localisation physique ? Celui de votre localisation physique ? Un autre ? Mais n'est-ce pas pénible que la commande date donne cette heure UTC qui ne correspond pas au vécu de l'humain ? % date Fri Dec 16 20:03:03 UTC 2011 % export TZ=Europe/Paris % % date Fri Dec 16 21:03:08 CET 2011 Même chose pour ls. Évidemmment, aucune solution n'est parfaite. . % TZ=Africa/Douala date --date="2011-12-16 12:00:00Z" Fri Dec 16 13:00:00 WAT 2011 (Le format utilisé est celui du RFC 3339, Z signifiant UTC.) Si on veut faire l'inverse, trouver quelle sera l'heure UTC correspondant à une certaine heure légale (ici, on se demande quelle sera l'heure UTC lorsqu'il est cinq heures du matin en Californie) :

Plasma/HowTo/4.5 - KDE UserBase. The Plasma Workspace is one of the key technologies of KDE SC 4.x (also known as the "Pillars of KDE"), and one of the most visible to users. As Plasma Desktop treats the user interface differently than a traditional desktop, there may be confusion as to what the Plasma Desktop is, what it does, and how to perform common tasks. The purpose of this document is to show how to perform common tasks in Plasma Desktop.

Each HowTo consists of one topic and a short animation, which is reached by clicking on the link. The animations are encoded in the GIF format and can thus be viewed in most modern web browsers without any additional plugins installed. HowTo Widgets Desktop Widgets Add widget to desktop Panel Widgets Add widget to panel Icons Desktop Panel Extenders Activities Further information For reuse To link to an animation from another UserBase article, a thumbnail can be posted. The code to do that is The animations can also be used outside of UserBase. Replace GIF with the URL to the GIF file. How To Boot An ISO With GRUB2 (The Easy Way!) If you want to try out a new Linux distro, be it the latest Ubuntu 11.04 Natty Narwhal daily ISO or any other (I've only tested it with Ubuntu though!) And don't want to burn a CD each time you want to try a new daily build (and you don't have an USB memory stick around), you can use a cool GRUB 2 feature that lets you boot a live CD ISO directly from your hard disk.

You can also use this method to boot varous utilities such as Super Grub Disk, SystemRescueCD, Parted Magic and so on. Usually, setting up GRUB 2 to boot an ISO can be quite a difficult process (well, not that difficult but for some reason it always failed for me) but you can do this with just a few clicks thanks to Unetbootin. This info is actually available on the Unetbootin website but I somehow missed it - until now (thanks to Usemos Linux).

Install Unetbootin and set everything up for booting an ISO using Grub2 1. In Ubuntu, simply run the following command to install it: sudo apt-get install unetbootin 2. Solutions CLI pour connexion hostile / dégradée - ~bohwaz/blog/ Mini-tutos pour screen, irssi, bitlbee, cone et gcalcli. Ne plus avoir de connexion de qualité au net, et devoir passer par un wifi non sécurisé et qui n'est pas de confiance, comme c'est mon cas en ce moment, est un véritable calvaire. Je suis actuellement sur une connexion FreeWifi, et le bilan n'est pas bon : Il faut re-donner ses identifiants FreeWifi régulièrement sinon la connexion se coupe (aucune idée de l'intervalle, ça semble assez aléatoire) Utiliser Pidgin pour MSN est hors de question, le protocole n'étant pas chiffré utiliser Meebo.com (pour jabber/msn) est lent GMail ne fonctionne pas, le login ne se termine jamais (ça va un peu mieux avec la correction de MTU mais ça marche quand même pas bien) Google Calendar ne fonctionne pas non plus Twitter est lent et impossible de poster un twit Heureusement, ssh est là !

D'abord régler le problème de l'expiration de session FreeWifi avec le script shell suivant (qui inclut la correction de MTU mentionnée précédemment) : #! Reclaim Deleted Files and Repair Filesystems on Linux. Linux is as solid an operating system as you'll ever use — but that doesn't mean that the hardware you're running it on is equally solid. Hard drives are as prone to errors as are file systems. And no matter how stable an OS is, it can't prevent you from accidentally deleting files and/or folders. But don't despair: Linux is equipped with a number of tools that can help you repair filesystem errors and reclaim deleted files. Which tools? Checking Ext2/Ext3/Ext4 Filesystems with e2fsck The e2fsck utility takes after the original UNIX fsck utility, but is used to check the Ext2/Ext3/Ext4 family of filesystems. One problem most users face is that the e2fsck tool can only work on unmounted partitions.

Init 1 However, I recommend you take this one step further and use a Live distribution like Knoppix or Puppy Linux or your distribution's live CD if it has one. Umount /dev/sdb1 With the target partition unmounted, you are ready to begin running the check. e2fsck -y /dev/sdb1 Recover Deleted Files. VBoxHeadless - Running Virtual Machines With VirtualBox 4.0 On A Headless Fedora 14 Server. Remote Linux Desktops with NoMachine NX. The ability to remotely log on to a Linux machine is usually fairly straight-forward: You install SSH and openssh-server and then tunnel X with the ssh command.

But what if you want a full-blown desktop? You could install a VNC or RDP server, or you could go all out with a complete remote desktop management solution like NoMachine NX. With this solution you can enjoy multi-session remote desktop environments with multi-media support, printing support, and file sharing. NoMachine NX is available for Linux in both x86 and x86_64 flavors. There is a free version (which will be the version we discuss here) that has pre-compiled binaries for Red Hat flavors and Debian flavors as well as a source download. Why would you want to bother with such something like NoMachine NX? For many, the free edition should suffice.

Installation The installation process is fairly straight-forward. Openssh-server libaudiofile0 To install openssh-server, run sudo apt-get install openssh-server. Services. Using Nautilus Actions to Extend File Manager Functionality on Linux. What would a desktop be without a file manager? Even at the command line level we have file managers and they still make our lives much easier than they would be without them.

To many users the file manager is just way to preview, delete, and move files. The power user, on the other hand, looks at the tool from a very different vantage point. For this type of user the file manager must be versatile, powerful, and it must do their bidding in the way they want it done. The GNOME default file manager, Nautilus, is the perfect candidate for this. How? There is an add on for Nautilus called nautilus-actions. In this tutorial I'll start you off your long, useful, journey with Nautilus actions. What You Need to Install This is simple. Open up your Add/Remove Software utility. You should now see a new entry in your System > Preferences menu called Nautilus Actions Configuration.

Creating an Action: Queuing and Playing Music in Rhythmbox Configuring an Action That's it. Adding Fonts Final Thoughts.