Posts Tagged ‘linux’

Default sort order in Thunderbird

03/29/2010

If you are like me, you like the newest mail on top. The default in Thunderbird is to sort the mailboxes by date in ascending order. This is just stupid, it makes the newest mail go on the bottom, and on top of that, it will put mail sent by someone with a wrong date on their computer somewhere in the middle of it all, so you don’t notice it easily.

The fix for this, is to choose to sort it by order received, and descending order. But changing it for every and all folders if you have a few, is annoying, and for all new folders it will also be wrong. So what do you do?

Open the options, go to advanced and then Config Editor. Then confirm you’ll be careful, and in the new window that pops up write the following in the text-field on top:
mailnews.default_sort
Then double-click on the sort_order and change it to 2 (the number 2).
Then double-click on the sort_type and change it to 21 (the number 21).
Close the window, and then click on ok in the options window. This will now apply for all your new mailboxes, but for all the existing ones I am afraid you will have to change it manually through the “View -> Sort By” menu.

Time drifting in VirtualBox RHEL/CentOS

01/13/2010

I am running VirtualBox on a Solaris 10 installation, with a CentOS 5.4 virtual machine. The problem I have had is that the time in the virtual machine has been going nuts. Sometimes it goes so slow it almost seems like time is standing still, sometimes it speeds ahead. It is so bad, that neither ntpd nor guest additions’ time sync could keep it running properly.

After googling this a lot and trying different things, I can now bring you the solution:
1) Be sure you’re running the guest os additions (same as vmware tools)
2) Add the following kernel boot parameters:
nmi_watchdog=0 elevator=deadline noapic nolapic divider=10 nolapic_timer clocksource=acpi_pm
3) Reboot, and maybe do a ntpdate one time to get it right. After that, the guest additions should keep the time up to date. Oh, and you should probably not run ntpd at the same time as the guest additions, they could get in each other’s way…

Oh, and it should be fixed in later linux-kernels, but it seems RHEL 5.x (and therefore CentOS 5.x) is stuck on kernel version 2.6.18, which means we don’t get the fix before a new major release.

Enjoy.

Move into folders

01/02/2010

Often when you download something, for instance movies, it is a big pack of many movies, and they are all in one folder as .avi files or something like that. You might want all of those in their own separate folder to use with f.ex. XBMC, and it can be a tedious task to make a folder for each movie, and move them into that folder.

Well here is the script to do it, filled with comments to explain what is happening. Hope someone finds it useful.

First: This is the quick and dirty oneliner to do it if you are sure there are only files with extensions in the dir, it’s without any error-checking:
IFS=$’n’;for f in `ls -1`; do mkdir “${f%.*}”;mv “${f}” “${f%.*}/”;done

The whole script is attached, with an abundance of comments describing what’s happening.

pakkut.sh

12/31/2009

Et lite script for å gå ned i hver underkatalog, se etter filer som
slutter på .rar, og pakke de ut.  Så spør den om du vil slette “*r??
*sfv” hvorpå den evt. sletter de.

Kjekt når man laster ned noe som kommer som en haug med underkataloger
med rar’et innhold.

Mounting ext2/3, FAT16/FAT32 and NTFS in Solaris 10

12/19/2009

You might be using Solaris like me, and you might have some disk containing ext3 partitions on it that you want to mount. This can not be done out of the box on Solaris, since it doesn’t support ext2/3 and ntfs. But do not give up, the solution is here!

First off, note that it’s only read-only support for NTFS/ext2/ext3. It has full read/write support though for fat16/fat32.

Follow these simple steps:
Download these two packages:
http://www.belenix.org/binfiles/FSWpart.tar.gz
http://www.belenix.org/binfiles/FSWfsmisc.tar.gz

Unzip and install them:
gzcat FSWpart.tar.gz | tar xvf –
gzcat FSWfsmisc.tar.gz | tar xvf –
pkgadd -d . FSWpart
pkgadd -d . FSWfsmisc

Now run the prtpart tool on the disk you want to read partitions. You can see the devices Solaris has recognized through “echo|format”.

/usr/bin/prtpart /dev/rdsk/p0
example:
/usr/bin/prtpart /dev/rdsk/c2t1d0p0 -ldevs

This might result in something like this:

Fdisk information for device /dev/dsk/c2t1d0p0

** NOTE **
/dev/dsk/c2t1d0p0 – Physical device referring to entire physical disk
/dev/dsk/c2t1d0p1 – p4 – Physical devices referring to the 4 primary partitions
/dev/dsk/c2t1d0p5 … – Virtual devices referring to logical partitions

Virtual device names can be used to access EXT2 and NTFS on logical partitions

/dev/dsk/c2t1d0p1 Linux raid autodetect
/dev/dsk/c2t1d0p2 Linux swap
/dev/dsk/c2t1d0p3 Linux raid autodetect

To mount NTFS partition use
mount -F ntfs /dev/dsk/c2t1d0p /mnt/windows

To mount FAT 16 / FAT 32 partition use
mount -F pcfs /dev/dsk/c2t1d0p /mnt/windows

if the above command fails you can try the below option
prtpart /dev/dsk/c2t1d0p0 -fat
the above command should list the available PCFS / FAT partitions in colon notation, then use the same for mounting (eg)
mount -F pcfs /dev/dsk/c2t1d0p0:d /mnt/windows

To mount Ext2 / Ext3 partitions use
mount -F ext2fs /dev/dsk/c2t1d0p /mnt/linux

To unmount a partition use “umount ”
umount /mnt/linux

This also means you can share this folder to a branded zone running RedHat Enterprise Linux or CentOS, but remember that it’s read only…

Fancy ny Nokia-mobil med linux

08/29/2009

Denne så ikke så dum ut…
http://www.itavisen.no/821827/saa-raa-er-nokias-linux-mobil

 Video av herligheten presentert av ansatte i Nokia på dårlig engelsk:

 Fancy reklame-video:

 Blir spennende å se denne og om det kommer mye software til den. Og
ikke minst hva den vil koste i Norge…