Author: Ryan

printf and its family of functions allow you to easily format string data. There are so many formatting options that it is easy to miss some of its more powerful functionality. Here is a rundown of the more useful features and some examples. The basic printf format. printf(format string, format parameter list); The format string is composed of a literal string that may include one or more conversion specifiers. These all begin with ‘%’ and have the format below. %[flags][minimum field width][precision/max field width][length]conversion specifier flags # The value should be converted to an ”alternate form”. For o, x or…

Read More

Among the most valuable tools at a Linux administrators disposal is sudo. It lets ordinary users temporarily submit commands as root or another user. To use use this command simply put sudo before any command you want to run with root permissions. sudo command To submit commands as another user use the ‘-u’ option and the username. This will submit a command as the user ryan. sudo -u ryan command The sudo configuration file is located at /etc/sudoers. Although /etc/sudoers file is a regular text which root can edit manually, it is recommended that you only edit it using visudo.…

Read More

By default when you emerge a long list of packages in Gentoo you have to download each package completely before the build process can begin. This can be a large bottleneck, especially if your internet connection is not very fast. Luckily Portage has a great solution. Go to the file /etc/make.conf and add “parallel-fetch” to the FEATURES variable like this. FEATURES=”parallel-fetch” If the FEATURE variable already exists add “parallel-fetch” to the end separated by whitespace. FEATURES=”sandbox parallel-fetch” From now on Portage will fetch the source files for the next package in the list even while it is compiling another package.…

Read More

For whatever reason lets assume you find yourself on a Windows machine and you need to obtain the MAC address of its network adapter. Do the following. Go to Start -> Run which will bring up a text box. In this box type cmd. A command prompt will appear. Type this is the terminal. ipconfig /all A lot of information will fly by but the MAC address is labeled Physical Address. The number is 6 pairs of hexidecimal numbers separated by dashes. It will look like this. Physical Address . . . . . . . . . : a1-b2-c3-d4-e5-f6…

Read More

There are many ways to take screenshot in Linux. If you have Gnome or KDE you can simply press your ‘print screen’ button and you are done. If you don’t run either one of these desktops you can always use the screenshot functionality built into GNU Image Manipulation Program aka GIMP. Open up GIMP and navigate to File -> Create -> Screenshot. The third method and my favorite is to do it from the command line. To do this you need to use the import command which is part of ImageMagik package. You will need to make sure that this…

Read More

scp allows you to securely copy files locally or remotely across a network. It uses SSH for data transfer and uses the same authentication. If you do not have public key authentication enabled you will be prompted for a password. This basic format for scp is this. scp [options] [[user@]src_host1:]file1 [[user@]dest_host2:]file2 Assuming the remotehost has a username which matches username on the local host, this command will copy a a local file into the /tmp directory on remotehost. Notice that the colon separates the host from the location. $ scp file.txt remotehost:/tmp/ You will be presented with the real-time statistics…

Read More

If you wish to restrict all or part of your website from being indexed by various search engine robots you can use a robots.txt file. For it to work properly it should be a simple ASCII text file named exactly “robots.txt” and it should be placed in the domain root directory. The well behaved robot will look at this location for instructions before indexing anything on the website. You will need a separate robots.txt in the root directory for every sub domain you have as well. Apart from the root directory, a robots.txt file in any other location such as…

Read More

The top command is a great way to keep track of processes executing on a system in real-time. Launch top by entering this on the command line. $ top Here is an example of what you will see. top – 09:13:11 up 1:29, 2 users, load average: 0.20, 0.16, 0.10 Tasks: 85 total, 1 running, 84 sleeping, 0 stopped, 0 zombie Cpu(s): 2.5%us, 1.0%sy, 0.0%ni, 96.0%id, 0.0%wa, 0.4%hi, 0.1%si, 0.0%st Mem: 4050364k total, 459920k used, 3590444k free, 17028k buffers Swap: 1956612k total, 0k used, 1956612k free, 174940k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND…

Read More

Welcome to WiredRevolution.com I started WiredRevolution.com to keep track of and share my experiences with Linux. Its collection of notes and articles act not only as a reference for myself but will hopefully provide a valuable resource for others. Enjoy!

Read More