index

September 20, 2006

ubuntu package list

Filed under: useful snippets — yordan @ 2:28 pm

First, let’s make the list. You’ll be doing all of this in a Terminal Session:

dpkg –get-selections | grep -v deinstall > ubuntu-files

Now you’ve got a list of all of your installed debs in a fairly small file. In my case, I simply moved this file to a thumb-drive. You could also store it on a seperate partition or on a disk somewhere. Heck, it’s not that big, email it to your gmail account.

So now you’ve got this list and all is well, until you’re Ubuntu install either dies or has to be reinstalled for some reason. Go ahead and do the base install.

Once you’ve got Ubuntu back up and running, copy your ubuntu-files back into your home directory and do the following:

sudo apt-get update

sudo apt-get dist-upgrade

dpkg –set-selections < ubuntu-files

Now you’ve told your system what it needs to install, so let’s install it all.

sudo dselect

This will open up a dselect session. Type ‘I‘ and allow dselect to install of the the packages listed in your ubuntu-files document. When it’s finished, type ‘Q‘ and hit the ENTER key to exit dselect.

July 19, 2006

ntfs support

Filed under: useful snippets — yordan @ 11:23 am

A cool little app has been released which allows you to safely read and write to your Windows NTFS drives directly in your Linux machine. Previously it was only possible to read from NTFS drives. The driver can be downloaded here. *Note that NTFS-3G is only compatible with 32 bit systems, so the people using 64 bit distro’s are out of luck. Your Linux distro should have Fuse installed, before NTFS-3G is installed. After downloading the NTFS-3G driver you can do the familiar “./configure” then “make” then as root “make install” to compile NTFS-3G. Afterwards it should be as easy as mounting the drives via fstab.

ntfs-3g /dev/hda1 /mnt/windows

or for full access for all users :

ntfs-3g /dev/(your partition like hda1 or sda1) /mnt/(mount point) -o silent,umask=0,locale=en_US.utf8

For Ubuntu users an easier method than compiling your own driver is provided below. Click the read the rest of the entry link for specific console commands to get your Ubuntu box working with NTFS-3G.

In Ubuntu Dapper you need to have FUSE installed first. Open up your terminal and type in these 3 commands :

wget http://flomertens.keo.in/debian/ntfs-3g/binary-i386/fuse-utils_2.5.3-1_i386.deb
wget http://flomertens.keo.in/debian/ntfs-3g/binary-i386/libfuse2_2.5.3-1_i386.deb
sudo dpkg -i libfuse2_2.5.3-1_i386.deb fuse-utils_2.5.3-1_i386.deb

From there download & install the .deb driver :

wget http://flomertens.keo.in/debian/ntfs-3g/binary-i386/ntfs-3g_20070714-BETA-1_i386.deb
sudo dpkg -i ntfs-3g_20070714-BETA-1_i386.deb

Now add your NTFS drive to your fstab file, so it will be loaded on boot up :

sudo gedit /etc/fstab
/dev/(your partition like hda1 or sda1) /media/(mount point) ntfs-3g silent,umask=0,locale=en_US.utf8 0 0

Now you need to add Fuse to your modules file so it can be loaded on boot up :

sudo gedit /etc/modules

Add Fuse to the bottom of the file

Now you can either reboot and the drive will be mounted or you can try mounting it without rebooting by typing this command in the terminal :

ntfs-3g /dev/(your partition like hda1 or sda1) /mnt/(mount point)

Now your NTFS drive should be loaded and ready to read & write to your hearts content.

June 21, 2006

css vertical positioning

Filed under: useful snippets — yordan @ 10:08 am

 

Vertical centering is just as important. I want to be able to (without tables) place a 500×500 box center of the window without resorting to some wierd javascript to do it. You give me a div (or p) that does this in all browsers with zero javascript and I will be impressed.

The way I usually do it is with negative margins. It's kind of a workaround, but it does work. Position the div 50% from the top and left, and then give it a negative margin-top & margin-left equal to 1/2 its own height & width respectively (in the case of 500×500, use a -250px margin) and it should center vertically.

For example, I use something like this on one of my sites:
#container {
position: absolute;
left: 50%;
top: 50%;
z-index:1;
width: 500px;
height: 500px;
margin-left: -250px;
margin-top: -250px;
}

Create a free website or blog at WordPress.com.