Author Archive for la

Auto mounting

In Ubuntu Linux 5.04: The Hoary Hedgehog Release, the auto mounting of drives were removed. In plain terms for average user, it means “We want to see our drives under My computer”.

I saw someone post the this script over on ubuntu irc

#!/bin/bash
####################
# This utility searches for available HFS+, NTFS and FAT32 partitions, creates
# mount points for them and adds them to /etc/fstab
# (c)2005 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Instructions for use:
# - Save this file on your local hard drive
# - Open a terminal and type sudo bash winmac_fstab
# - If sudo asks for a password, use your own password
# - Your windows and mac partitions will now be mounted everytime
# you boot. You can delete this script now
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###################

# Root check
if [[ $UID != 0 ]]; then
echo ‘Tou should run this program as root or using sudo’
exit 1
fi

# Simple command line argument for installers
# -w: mount them with user,umask=0111
# -r: mount them with user,umask=0133,uid=1000,gid=1000
RWALL=-1;
if [[ $1 == '-w' ]]; then RWALL=1; fi
if [[ $1 == '-r' ]]; then RWALL=0; fi

if [[ $RWALL == -1 ]]; then
echo ‘By default the disks will be writable only by root and’
cat /etc/passwd | awk -F ‘:|,’ ‘/:1000:/ {print $5 ” (” $1 “)”}’
echo ‘Do you want to make the disk writable by all users instead? (y/n)’
read RESP
if [[ $RESP == 'y' || $RESP == 'Y' ]]; then
RWALL=1
else
RWALL=0
fi
fi

if [[ $RWALL == 1 ]]; then
OPTIONS=’user,fmask=0111,dmask=0000′
MACOPTIONS=’user,file_umask=0111,dir_umask=0000′
else
OPTIONS=’user,fmask=0133,dmask=0022,uid=1000,gid=1000′
MACOPTIONS=’user,file_umask=0133,dir_umask=0022,uid=1000,gid=1000′
fi

# Now for the real work
drivesntfs=`fdisk -l | grep -i ‘ntfs’ | awk -F ‘/| ‘ ‘{print $3}’`
drivesfat=`fdisk -l | grep -i ‘fat32′ | awk -F ‘/| ‘ ‘{print $3}’`
driveshfs=`fdisk -l | grep -i ‘Apple_HFS’ | awk -F ‘/| ‘ ‘{print $3}’`

donesomething=’n’
for drive in $drivesntfs
do
if [[ ! `grep $drive /etc/fstab` ]]
then
mkdir “/media/$drive”
echo “#Added by winmac_fstab utility” >> /etc/fstab
echo “/dev/$drive /media/$drive ntfs ro,$OPTIONS 0 0″ >> /etc/fstab
donesomething=’y’
fi
done
if [[ $donesomething == 'y' ]]
then
echo “NTFS drives will be mounted read-only!”
fi
for drive in $drivesfat
do
if [[ ! `grep $drive /etc/fstab` ]]
then
mkdir “/media/$drive”
echo “#Added by winmac_fstab utility” >> /etc/fstab
echo “/dev/$drive /media/$drive vfat rw,$OPTIONS 0 0″ >> /etc/fstab
donesomething=’y’
fi
done
for drive in $driveshfs
do
if [[ ! `grep $drive /etc/fstab` ]]
then
mkdir “/media/$drive”
echo “#Added by winmac_fstab utility” >> /etc/fstab
echo “/dev/$drive /media/$drive hfsplus rw,$MACOPTIONS 0 0″ >> /etc/fstab
donesomething=’y’
fi
done

if [[ $donesomething == 'y' ]]
then
# And mount them
mount -a
echo “All windows and mac partitions will now be mounted every time you boot”
echo “You do not need to reboot, the partitions are mounted now too”
else
echo “No usable windows/mac partitions found”
fi

now save it as “winmac_fstab” or whatever

get into the terminal.
sudo su
chmod +x winmac_fstab
./winmac_fstab

Opps, okay average user. Try this,

Click the Gnome footprint icon or “Applications” (like the apple icon in mac or start button in windows). Accessories, then click Text Editor. Then copy and paste the code in. (Tip, in linux, highlight what you want to copy, then middle (or both left and right)click to paste it)

Save the file on the desktop. Go to your desktop. Right click on it, click Properties, then Permissions. Check Execute.

Right click on the file, click Run in terminal. Now you will be able to see the drives under Place > Computer and automatically each time you boot. (My feature request, can the drives naming follow windows rather than the capacity of the drives?)

You can actually download the source here.

So far, ubuntu looks nice.

I’m adding some gnome applets to kill time while update apt to get universe sources. Some interesting ones are weather, drawer, eyes, notes, network & cpu meter.

Hopefully later I can get Beagle (spotlight/winfs for linux) to run nicely. [Update I did, except without Inode]. Self proclaimed newbies, this takes a little to the command line, but as long as you follow instructions, everything will go easy.

I’m an Archivist

I’m a PC addict :( But at least Tuesday was a day of PC soberness for me. Today almost is, until now. In a week to come, I would get more time away from my pc. (Unless the Netherlands National Service exemption for Internet addiction is applied here too)

Today while I was packing my room…

…Dusts, Boxes, Plastic bags, Papers, Lecture notes, Sketches, Cds, Floppy disks, Files, Folders, Keys, Key chains, Name cards, Souvenirs…

What is more amazing is…

6 Bags (Imagine just my room, I have even more in the store room. The last time I had a stock count of my clothing was over 200. The cloths keep piling up because I haven’t grow for some time)
Old Photos
Birthday cards
Autograph books (Yes it girl-dish but I have some)
Broken Parts

And the worst..
Journals and Ideas, spanning over various notebooks, organisers, diaries. Could have fill half a big box with that.

Here’s what. I’m bad memory. Even worst, unorganised, lazy, untidy. Hence all these pile up more and more, making my room the untidiest in the family.

Really, I do have bad memory, things passed few days ago and I wont remember (Unlike my father who can remember dates associated to events mentally). Could be the reason why I scribble bits and pieces of my thoughts, my life everywhere. Possibility the unconsciously I think, if I never write it down, and I try to recall a passed event, or what had I been doing over a period of time, I wouldn’t want to feel, “No I cant remember anything, I have no impression, was that a dream?”, and then think, “Is my life a dream?”.

Sometimes this feeling gets to me when I experiencing events. I think “Is this happening? Did I seem to envision this in my dreams?”. And this, could be dued to psychic problems, bad memory, or some gifts of prophecy.

I’m trying to change. I want to put childish things behind me. One day, our lives will be reviewed like a film frame by frame. Important thing is how would I live it?

Bad habits die hard. Dumping my thoughts, feeling into this blog, is this the new trend or the in-thing for youngsters? Or issnt this just my old habits, except with the additional use of technology.

Technology can fail us. It failed painfully me couple of times. In a way I abuse technology, using it to dump data I have (and grew to rely less on my brain). At least 4 times, harddisks burn out on me. That pains me even more, because of the collection I have is more than the stuff other would usually have. Today I received an RMA-ed maxtor harddisk after waiting for perhaps over 5 months.

Getting sidetrack again, I’m going to install and test this hard disk, and install Ubuntu on it, at the same time, adjust my neon lights cooling system.