Wednesday, July 7th, 2010 at
1:08 pm
Have you ever messed around with your Ubuntu Gnome settings only to find out you broke something? Here is a quick write up on how to reset your gnome settings in Ubuntu.
In short, you basically need to delete these from your home directory: ~/.gnome ~/.gnome2 ~/.gconf ~/.gconfd ~/.metacity
Popularity: 1% [?]
Wednesday, June 30th, 2010 at
5:00 am
If you don’t already know, a runlevel is what Linux uses as a mode of operation. A ‘runlevel’ defines the state of the operating system after power on.
Typically, Linux runlevels look like the following:
- 0 – Halt (shutdown)
- 1 – Single-User mode
- 2-5 – Full multi-user mode with console logins and display manager if it’s installed
- 6 – Reboot
On most Linux servers, the default runlevel will be set to runlevel 3. Multi-user mode and console logins only. Whereas, most Linux desktops, the default runlevel will be set to runlevel 5.
If you want to boot into a specific runlevel every time your computer turns on, all you need to do is edit the /etc/inittab. For this example, we will change the runlevel from 3 to 5.
# vi /etc/inittab
Modify the line that looks like this:
id:3:initdefault:
And change the number 3, to 5.
id:5:initdefault:
Save the file. Next time you reboot Linux will boot directly into your desktop window manager.
Popularity: 1% [?]
Tuesday, June 29th, 2010 at
10:25 am
Jack Wallen has a great Linux how-to on using the Linux backup software, Lucky Backup, to backup and store your data.
I’ve used Lucky Backup in the past and can attest that it is very easy to use, and has all the features you need for a good backup system.
Some of the features include:
- Snapshot backups
- Sync directories
- Exclude directories/files
- Profiles
- Scheduling
- Logging
- Command line mode
Head over and read Jack’s how to. He does a great job showing just how easy it is to use.
Popularity: 1% [?]
Wednesday, June 16th, 2010 at
6:00 am
A lot of people are probably not aware of the command script. Script is a quick and easy way to record everything you do in a terminal session. I use script to record sessions of me fixing a server, or troubleshooting Linux issues, and save it for future needs, or to pass on to others as training material. Here is what the Linux man page says:
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
Using script to record your terminal session
It’s really quite simple to record your bash session. All you need to do is type script -a filename to start recording your session:
laptop:~ foogazi# script -a session1_jun162010
Script started, output file is session1_jun162010
laptop:~ foogazi#
Now that the recording has started, everything you type, as well as everything that returns as output, will be saved into the filename you chose to output to.
Popularity: 1% [?]
Tuesday, June 15th, 2010 at
3:17 pm
I’ve gotten this question a whole bunch of times in the past. You’ve got a Linux username that you want to rename, rather than recreate, so you don’t lose any significate data or permission settings. How do you rename a Linux user?
Linux rename user command
To rename a Linux user (rename user name), you want to use the Linux command usermod. From the man page:
The usermod command modifies the system account files to reflect the changes that are specified on the command line.
In short, here is the command to rename the Linux user:
usermod -d "/home/current_user-name" -m -l current_user_name new_user-name
And now an explanation of what each option means:
- -d specifies the current users home directory.
- -m specifies that you want to move the files from the current users home directory, to the new directory. You want to make sure you specify this, otherwise the users data will not transfer over to the new user account.
- -l specifies the current user name, and the new user name you wish to change it to.
That’s it. Now you’ve renamed a Linux user.
Popularity: 1% [?]
Saturday, June 12th, 2010 at
8:57 am
Do you use Ubuntu and wish to set a static IP for your machine? It’s simple. Follow the steps below to find out how.
- Right click the network manager icon at the top right of your desktop
- Select Edit Connections
- Select Wired
- Click the EDIT button
- Click the IPv4 settings tab
- Select Manual from the method drop down list
- Click the ADD button to add your static IP address
- Add your DNS addresses in the DNS servers field. You can separate each DNS entry with a comma
- Click OK.
- Restart networking using this command:
/etc/init.d/networking restart
Popularity: 1% [?]
Saturday, June 12th, 2010 at
8:49 am
If you’ve ever forgotten your Linux password, chances are you’ve needed to either restore your Linux installation. Hopefully this solution will save you from having to reinstall Linux in the event that you forget your password.
Reset your Linux password using Grub:
When your machine boots into Grub, you’ll want to press “e” to edit the grub boot linux.
After pressing “e”, navigate to the kernel line and add the word “single” to the end of the long string.
Press “b” to boot into single user mode.
You should then be taken directly to a root user shell, where you can then type passwd, and change your root password.
After you’ve reset your root password, type reboot at the shell to leave single user mode.
Popularity: 1% [?]
Saturday, April 19th, 2008 at
7:19 am
Here is a quick tip on how to display the top largest files and directories within my home directory:
# du -hs /home/adam/* | sort -nr | head
Cheers!
Popularity: 6% [?]
Tuesday, April 1st, 2008 at
2:28 pm
Here is a quick tip on how to run crontab every 5 minutes.
*/5 * * * * /home/adam/script.sh will execute script.sh every 5 minutes.
Also, here’s a quick guide to understaning the layout of cron:
# MIN HOUR DAYOFMONTH MONTH DAYOFWEEK COMMAND
5 * * * * echo 'Hello'
Also, the Crontab Man page
For further reading on Crontab check out Understand Cron Jobs in 5 Minutes
Popularity: 59% [?]
Saturday, March 29th, 2008 at
10:41 am
Here’s a quick tip for finding files over 100M on Linux.
# find /home/adam/ -size +100M -exec ls -lh {} \; | awk '{print $5 , $8}'
Note that if you change 100M in the command you can find files with any size. Also, replace /home/adam with any directory you wish.
Popularity: 7% [?]