jacob's blog

Linux tip: sudo

At work yesterday, I had to solve a problem with a strange error.

Sorry, user <user> is not allowed to execute '/usr/bin/command' as root on <box>

Reading the work order (which did not include the error message, just that the user could not access a file), I thought it had to be a permissions issue, and in a sense I was right, but not a file permissions issue as I suspected.


Bash: if statements

An if statement in shell scripting looks something like this:

if [ "$VAR" = 1 ]
#do something
elif [ "$VAR" = 2 ]
#do something else
#do something by default

Notice we're quoting the variable to protect from shell expansion.

There are a variety of file tests one can use:

if [ -e /tmp/test.file ]
#do something
elif [ -d "$VAR" ]
#do something else
#another default action

Bash: variables

First in a series of notes in reference to shell scripting as I am just learning it myself. I have started on a script that will configure a bridged network interface for VirtualBox.

Working with variables in the shell is very easy.

#set a variable
VAR="Hello World"

#output the same variable
echo $VAR

#assign a new variable
#the value of our old variable

echo $VAR2

Linux conversion: Anonymous

Czzessi has blogged about his co-worker who decided to install Kubuntu on his laptop instead of buying Windows for it, and so far, loves it. =)

"For the record: When someone who is around 45 year old and used the pc only for office and email say: "Wow, it's amazing and so easy", then Riddell, his team did a great job."

I completely agree. Most people who don't play third party games love Linux in my experience. Especially Ubuntu and Kubuntu.

Better web development with Ubuntu 8.04

Ubuntu 8.04 provides many free tools that makes a web developer's job very easy and the tools we use better and moe secure.

First, BlueFish is a very good source editor. It has all the expected features and is very fast. Quanta is a good KDE equivalent, but so far, I believe BlueFish is faster and a bit better.

Second, virtualization is highly supported. Why is this important??

I decided to start over with my home computer. I backed up my home drive, then wiped my system drive and reinstalled. Oops...I forgot to backup mysql.

Back to gnome (Unbuntu 8.04)

Gnome vs KDE

I decided to go back to Ubuntu at home. I was having a tough time deciding which version of Ubuntu I wanted to use when I realized I can just use Ubuntu at home and Kubuntu at work. I had originally installed Ubuntu with Windows and have done quite a bit of work on Ubuntu experimenting and installing from source, so I felt like I needed a clean system.


Fortune and xscreensavers

One of the coolest commands in Linux is fortune. =)

$ fortune

If you don't have fortune installed:

$ sudo apt-get install fortune-mod fortunes

The above command will output a random fortune, quote or saying. This command has been around forever and it's one of my favourites. The better email clients will allow you to use the command to append a random quote at the end of your emails.