background preloader

Linux tips every geek should know

Linux tips every geek should know
What separates average Linux users from the super-geeks? Simple: years spent learning the kinds of hacks, tricks, tips and techniques that turn long jobs into a moment's work. If you want to get up to speed without having to put in all that leg-work, we've rounded up over 50 easy-to-learn Linux tips to help you work smarter and get the most from your computer. Enjoy! UPDATE: If these tips aren't enough and you want even more, make sure you check out More Linux tips every geek should know! #1: Check processes not run by you Difficulty: Expert Application: bash Imagine the scene - you get yourself ready for a quick round of Crack Attack against a colleague at the office, only to find the game drags to a halt just as you're about to beat your uppity subordinate - what could be happening to make your machine so slow? OK, let's list all the processes on the box not being run by you! ps aux | grep -v `whoami` Or, to be a little more clever, why not just list the top ten time-wasters: find . reset

Linux Compose Key I often need to type characters that aren’t on the keyboard, like ½ ÷ © ¥ or ¢. On Mac, they’re done with the [option] key, but not always intuitive. For example: © is [option]-G and £ is [option]-3. On Windows, it’s horrible. On Linux, though, they have the most brilliant intuitive way of doing this: You pick a key on your keyboard you don’t use much, like [Insert], [CapsLock], or [menu], and make it the “compose key”. Then to make any character, you just hit the compose key, then type the two obvious keys that, when combined, make up the character. For example: To get ©, just type c then o (Get it? It’s like drawing with your keyboard! Best of all: I never need to read a manual. See the Wikipedia page for more info. (Windows people, don’t despair. (Photo Ⓒ by Jim Sher.)

Mastering the Bash History – Make Tech Easier The Bourne Again Shell, better known as bash, is the default for most Linux distributions. It’s extremely powerful as far as command shells go, and holds all kinds of nifty tricks for those willing to learn. One of the best features is, in my opinion, the command history system. There are many options to use with the bash history, some of them I use nearly every time I open a command shell. Today I’ll be covering some of the most useful aspects of the history, but I certainly won’t be able to cover them all. Up/Down Arrows Many of you probably know this one, but for anyone who doesn’t, it’ll make your life a lot easier. A similar feature to the one listed above is the double bang (!!). Bash will substitute the !! This also works further backward, you can do something like to recall the command 5 entries back in the history. ! Perhaps a few days ago you typed a long, complex command into your shell, for example a series of options for “wterm”. Be careful with this one. !? Ctrl-R Manual Search !

Using SSH keys for Password-less Logins Most people start using SSH by logging in with a password, but re-entering your password for every SSH connection quickly becomes tedious. A better way is to set up a public/private key pair - you unlock your key once and then reuse it to make connections without entering your password. It may sound a bit complicated but you can set it up with two simple commands* ssh-keygen ssh-copy-id hostname You run the first command once to set up your public/private key pair and then you run the second command once for each host you want to connect to. These steps are spelled out in more detail below, but those two commands are all you need to get going. * This guide assumes you're running GNOME on a modern desktop Linux distribution such as Ubuntu, Debian, Fedora etc. Step 0: Think of a password Before we start with step 1, you'll need to think of a password. It's always difficult to think up a new password. Step 1: Generate a key pair ssh-keygen You'll be prompted for a filename - just press Enter.

Migrate to a virtual Linux environment with Clonezilla How to convert a physical server to a virtual one using the open source tool Clonezilla Live Ting LiPublished on April 21, 2009 Thanks to two concepts driving the data center today—economy and green computing—server virtualization is a hot topic in the IT world and a lot of hardware and software vendors are offering solutions. Virtualization solutions can have several benefits: they can let you easily migrate a virtual machine from one server to another, and let you provision a virtual as a reproducible clone image for, say,software development and testing. The process for achieving virtualized server consolidation depends on your starting point: If you are designing your system from scratch, you will likely implement virtualization from the ground up.If your system already exists in the physical state, you will probably want to migrate from the physical environment to the virtual one. Introducing Clonezilla Live Virtualization and system migration tools Step 1. Clonezilla tips Figure 1.

Linus Says, Linux Not Designed A thread on the lkml started innocently enough about proper spacing in source code, then grew and grew into a somewhat philosophical debate about evolution and code design. The subject of the thread was "Coding style - a non-issue" , the general consesus that ' scripts/Lindent ' solved the problem, a one line bourne shell script that executes indent with the "proper" options, as defined in the Documentation/CodingStyle document. The script: indent -kr -i8 -ts8 -sob -l80 -ss -bs -psl "$@" However, before long a debate was sparked, leading to some interesting comments by Linus and some others, perhaps best summarized by Alan's comment: "Engineering does not require science. What follows is a reprint of many of the more insteresting posts by some well known Linux kernel hackers: Peter's posting was the beginning of this thread. From: "Peter Waltenberg" To: linux-kernel-mailing-list Subject: Coding style - a non-issue Date: Thu, 29 Nov 2001 09:29:26 +1000 The problem was solved years ago. rules.

58 Cool Hacks - LXF Wiki From LXF Wiki (Originally written for Linux Format issue 58, October 2004) Increase your guru points and apply these cunning hacks to boost performance, secure your system and increase productivity - or fun! One of the great things about Linux is that there's usually more than one way to do something. DISCLAIMER: Obviously, anything you do to your computer is your responsibility, and while we have made every effort to test these hacks, your mileage may vary. Fix a wonky terminal Difficulty: Easy Application: bash We've all done it - accidentally used less or cat to list a file, and ended up viewing binary instead. reset and all will be well again. Creating Mozilla keywords Difficulty: Easy Application: Firefox/Mozilla A useful feature in Konqueror is the ability to type gg onion to do a Google search based on the word onion. Now select the entry in the bookmark editor and click the Properties button. Running multiple X sessions Difficulty: Easy Application: X #!

Linux PC+ 32 Best Linux Desktop Customization #4 Voici la quatrième édition des meilleures personnalisations de bureaux Linux. Six mois se sont écoulés depuis la dernière présentation, les tendances n'ont pas beaucoup évolué, sauf peut-être que l'on voit de plus en plus de customizations à base de KDE (cf. 6 derniers screenshots). Je vous laisse les découvrir sans plus attendre. Gaia10 Linux by Gabriela2400 GTK & Metacity: SproutPidgin iconset by Gabriela2400Covergloobus by Gabriela2400Conky: 5 individual configs made by Gabriela2400Wallpaper: See The WorldAWN: Skin by Gabriela2400Dock icons: Gaia IconsSource Ubuntu Linux by Transitmapsetc Theme: Equinox (with Faenza icons)Wallpaper: Wild Shine by Mohammad JavadFont: Domestic Manners (one of the Dustimo fonts)Ubuntu-Tweak added (for clear menus etc)Docky theme: Glass Sensualite by iHackr Re-upped 2nd by Sowizz Source Boxed by Afteroid GTK: by me, inspired by droidEmerald: by me, inspired by Gaia SproutIcons: A lot of different Themes. Loser by StingBL Arch Desktop 2010 by kjell81d Source Source

Failing Hard Drive: Linux to the Rescue - PC World Over Thanksgiving, I had to deal with a Windows XP laptop, belonging to a relative, that blue screened during startup. Normal startup failed, as did safe mode, safe mode with command prompt, and Last Known Good. The first question that always needs to be answered in these situations is whether the problem is hardware or software. To that end, I booted the computer using my favorite rescue disc, the Ultimate Boot CD for Windows (UBCD4WIN). The CD started, from the main menu, I chose to run UBCD4WIN, but it eventually hung on a totally blank screen. Among the other utilities on the Ultimate Boot CD for Windows is the Rescue Console. Clearly this was a hardware problem. I do travel with a copy of Linux on a USB flash drive, but the computer was too old to boot off a USB connected device. So I removed the hard drive from the laptop and took it home. A full diagnosis with SpinRite requires the hard drive to be internally connected to the computer. If at first you don't succeed ...

BashPitfalls - Greg's Wiki This page is a compilation of common mistakes made by bash users. Each example is flawed in some way. 1. for f in $(ls *.mp3) One of the most common mistakes BASH programmers make is to write a loop like this: for f in $(ls *.mp3); do # Wrong! Yes, it would be great if you could just treat the output of ls or find as a list of filenames and iterate over it. There are at least 6 problems with this: If a filename contains whitespace (or any character in the current value of $IFS), it undergoes WordSplitting. You can't simply double-quote the substitution either: for f in "$(ls *.mp3)"; do # Wrong! This causes the entire output of ls to be treated as a single word. Nor can you simply change IFS to a newline. Another variation on this theme is abusing word splitting and a for loop to (incorrectly) read lines of a file. IFS=$'\n' for line in $(cat file); do … # Wrong! This doesn't work! So, what's the right way to do it? If you don't need recursion, you can use a simple glob. 2. cp $file $target 3.

Related: