junk food for the brain …
How to print usernames with a userid greater than 500
Occasionally, you need to print out a list of usernames, greater than a certain user id. This is usually useful an a slightly larger setup, or when you want to chain more commands to certain users.
Use the awk command.
awk -F":" ' $3 > 200 {print $1} ' /etc/passwd
No comments yet.
No trackbacks yet.
Generate Files with Random Content and Size in Bash
July 29, 2009 - 12:37 am
Tags: bash, dd, files, generate, How To, Linux, random, script
Posted in How To, Linux | No comments
Occasionally you need to generate a bunch of random files with random content, usually for testing compression, user quotas or miscellaneous stuff.
Here’s one way, using the bash shell and a few handy linux utilities.
The bash $RANDOM function. It generates a random number between 0 – 32767.
Linux DD utility, to output files.
/dev/(h|s)da, your hard drive in [...]
How to Enable Flash in Google Chrome for Fedora 11 i686
July 27, 2009 - 11:45 pm
Tags: chrome, fedora, fedora 11, flash, flash-plugin, How To, install
Posted in How To, Linux | 4 comments
So you’ve installed the latest development builds of Chromium for Fedora Linux. The only thing lacking is that youtube is not loading. If not, what are you waiting for? Refer to one of my previous posts.
First make sure you install the Adobe yum repository.
As root:-
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
Then install the flash plugin.
yum install flash-plugin.i386
The flash plugin [...]
Configure a Caching-Only Name Server in a Chroot Environment for Fedora 11
July 18, 2009 - 8:39 pm
Tags: bind, caching-nameserver, caching-only, chroot, fedora, fedora 11, How To, Linux, named, nameserver
Posted in How To, Linux | 5 comments
Having a caching only name-server on your local Machine speeds up your browsing. Here’s how to set up a slightly more secure caching server using ISC Bind in Fedora 11.
Install bind and bind-chroot packages
# yum install bind bind-chroot
Edit your /etc/sysconfig/named file.
# vim /etc/sysconfig/named
Add the following line:
ROOTDIR="/var/named/chroot"
Edit your /etc/named.conf file.
# vim /etc/named.conf
Change the following line:
listen-on port [...]
Change Your MAC Address in Linux
July 16, 2009 - 4:38 pm
Tags: address, ethernet, how, How To, hwaddr, ifconfig, Linux, mac
Posted in Misc | 1 comment
Some times it necessary to change your network MAC address on your linux box.
Unlike Windows, which requires some registry editing or even specialized tools, its just a command line away in Linux.
For example, lets change the MAC address of your first netwrok card, usually called eth0.
Let’s swith to being the root user and view the [...]
Check Your Spelling in Linux using the Command Line
July 15, 2009 - 3:51 pm
Tags: aspell, cli, How To, ispell, Linux, spell check, spellcheck
Posted in Misc | No comments
You can do a spell check on from the command line in Linux.
First, make sure you have aspell installed. In Fedora, just yum install it.
$ yum install aspell
You’ll also need a dictionary, from which aspell can search for words.
A yum search aspell will give you a list.
[raja@atreides visilon]$ yum search aspell
———————————————————–
aspell-af.i586 : Afrikaans dictionaries [...]
How to Mass Rename Files in Linux
July 12, 2009 - 10:12 pm
Tags: bash, cli, files, How To, Linux, mass rename, rename, script, scripting, sed
Posted in How To, Linux | 2 comments
When entrusted with the chore of renaming multiple file, the convenience of a script shines. After all, we ain’t robots designed to do just one thing. Today, I’ll show one method of renaming files, using a for loop in bash.
First, the task we are going to do:
We have a list of files:
[raja@atreides test]$ ls
data_file_1 [...]
How to install a Dynamic DNS client for Fedora Linux
July 10, 2009 - 10:56 pm
Tags: dns, dynamic dns, dyndns, fedora, How To, inadyn, Linux
Posted in How To, Linux | No comments
Many people use dynamic dns for different purposes. I use it to give my home machine a public presence. I choose DynDNS for my needs. Its a leader in this segment and have been around for a long time.
First, you’ll need to register for a free account at their site. Once you’ve chosen a domain [...]
2 CLI ways to determine which rpm package has a program you wish to install in Fedora Linux
July 8, 2009 - 2:11 am
Tags: fedora, How To, Linux, provides, search, yum.
Posted in How To, Linux | No comments
There are 2 ways I know of to search for a particular program to install in Linux. As usual, I’ll be focusing on the Command Line Interface (CLI).
So, you’ve heard about the versatile port scanning tool called nmap and want to install it in Fedora Linux. The only problem is, you don’t know if it [...]
How to enable USB Devices for VirtualBox Guests in Fedora 11
July 6, 2009 - 1:44 am
Tags: fedora, fedora 11, How To, Linux, linux liferea howto, usb, virtualbox
Posted in How To, Linux | 12 comments
By default, guest hosts running in VirtualBox on Fedora 11 cannot mount or see usb devices plugged into your machine. A few tweaks are necessary for USB support to work.
Edit your /etc/rc.sysinit file, change line no 26 from
mount -n -t usbfs /proc/bus/usb /proc/bus/usb
to
mount -t usbfs -o remount,devgid=$(awk -F: ‘/^vboxusers:/{print $3}’ /etc/gr oup),devmode=664 [...]
How to install Virtual Box 3.0 in Fedora 11 32 bit
July 5, 2009 - 1:00 pm
Tags: error, fedora, fedora 11, How To, kernel, PAE, virtualbox, yum.
Posted in How To, Linux | 16 comments
When trying to install VirtualBox 3.0 in Fedora 11 32bit, you may encounter this error:-
[root@atreides ~]# rpm -ivh VirtualBox-2.2.4_47978_fedora11-1.i586.rpm
Preparing… ########################################### [100%]
1:VirtualBox ########################################### [100%]
Creating group ‘vboxusers’. [...]