linux

linux os tutorials, hacks, tips & tricks

wow. i never thought i would have to google how to right click using ubuntu on the powerbook.

apples powerbook touchpad has no middle or right mouse button – where this isnt a big problem using os x, in ubuntu it can generally be an issue.

after much googling i finally found that by default the mouse middle-click was f11 and the mouse right-click was f12. now these are mapped and can be changed by editing the /etc/sysctl.conf and mapping dev/mac_hid/mouse_button2_keycode and dev/mac_hid/mouse_button3_keycode to their corresponding key scan codes.

you can get the key scan codes by running sudo showkey then pressing the key or keys for which the scan codes are to be printed. to exit the key mapping software, press ctrl d.

i did this all on a ubuntu 11.04 server virtual machine inside of an ubuntu 11.04 host.

open /etc/apt/source.list in your favorite editor and add the following line
deb http://download.virtualbox.org/virtualbox/debian natty contrib

 

get the virtualbox public key
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

 

update the package database
sudo apt-get update

 

now install virtualbox 4
sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.0 dkms

 

download and install the extension pack (this is required since virtualbox outsourced some funcionality)
cd /tmp/
sudo wget http://download.virtualbox.org/virtualbox/4.0.8/Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack

 

add user to vboxusers group
sudo adduser mike vboxusers

 

now virtualbox is installed and ready to use. the next posts will be on configuring and using virtualbox via the command line and managing your vms via phpvirtualbox

 

here is a fix for getting guest additions working inside of an ubuntu host.

 

sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install virtualbox-ose-guest-x11

 

i am a diehard google fanboy. so i finally decided to make the switch to using chrome over firefox. dont get me wrong, firefox is amazing and i will still continue to use it for testing and such. however, chrome is waaaay better.

i am using slackware 13.1 for this, so all the slackbuilds links will be for 13.1.

download and install the ORBit2 slackbuild

download and install the GConf slackbuild

download and install the google chrome slackbuild

and you should be all set to use chrome in slackware!

i found the command below here. what it does is grab your service tag number using dmidecode.

dmidecode | grep 'Serial Number' | head -1

after seeing how that worked i decided to look at the dmidecode output. a lot of it wasnt anything i could actually use, however, i did find this one particularly useful when recompiling the kernel.

processor info from the BIOS with flags:
dmidecode |grep 'Processor Information' -40

it gives a good look at the processor flags, more detailed than cat /proc/cpuinfo, however, cat /proc/cpuinfo listed off more flags. it also states on the dmidecode homepage they say

Beware that DMI data have proven to be too unreliable to be blindly trusted. Dmidecode does not scan your hardware, it only reports what the BIOS told it to.

run the last command as root:

sudo !!

 

when you put in sudo !! the !! translates to !-1. you can also write it as sudo !-n to refer to the n-th previous command.

way to often i start editing a file without using sudo. here is a fix for that. when you go to save the file, do the following:

:w !sudo tee %

 

to mount a windows share via the command line:

smbmount //machine/share /where-you-want-it

 

an awesome compilation of one liners for awk. check it out here

here is an awesome tutorial on bash scripting. it is possibly the most informative and thorough tutorial i have ever read. it is a definite must read for anyone who is trying to get into bash scripting or learn more about it.

this tutorial is written to help people understand some of the basics of shell script programming, and hopefully to introduce some of the possibilities of simple but powerful programming available under the bourne shell. as such, it has been written as a basis for one-on-one or group tutorials and exercises, and as a reference for subsequent use.

steves bourne/bash shell scripting tutorial