Ubuntu Hardy MemoryStick fix

Posted by mastrboy on April 26th, 2008

After installing Ubuntu hardy i noticed my card reader had some problems with memstick cards, but i found a fix on a blog:
http://swehrmann.blogspot.com/2008/04/memorystick-support-unter-ubuntu-hardy.html

After following those instructions the memstick now works, i created a .DEB package with checkinstall for easyer install next time.

Here is the deb package:

Download: Ubuntu Hardy MemStick Fix  Ubuntu Hardy MemStick Fix (198 KB)

CD Copy Script

Posted by mastrboy on March 6th, 2008

I needed to copy 32 MP3 cd’s into my file server today, and figured that since all the CD’s had the same directory structure it would be quicker to write a bash script that did everything except putting in the CD for me, and i tought i could share it someone needed something similar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
CDROM_DEV="/dev/hdc"
 
# Color Definitions
RED="$(tput bold;tput setaf 1)"
GREEN="$(tput bold;tput setaf 2)"
BLUE="$(tput bold;tput setaf 4)"
YELLOW="$(tput bold;tput setaf 3)"
WHITE="$(tput sgr0;tput bold)"
NORMAL="$(tput sgr0)"
 
SOURCE_MP3="/media/cdrom/MP3/"
DESTINATION_MP3="/mnt/lagring/share/mp3/"
 
while true;do
    #load data from drive
    CD_LABEL=`dd if=$CDROM_DEV ibs=1 skip=32808 count=32 2>/dev/null`
    LAST_CD=$CD_LABEL
    NUMBER_OF_FILES=`ls $SOURCE_MP3|wc -l`
 
    # output data. Remove spaces from the end of text fields with {x%% *}
    echo "$GREEN>>$WHITE Found CD: ${CD_LABEL%%  *} $NORMAL"
    echo "$GREEN>>$WHITE Found $NUMBER_OF_FILES files $NORMAL"
    echo "$GREEN>>$WHITE Copying files to $DESTINATION_MP3 $NORMAL"
    echo
 
    i=0
    for file in $SOURCE_MP3*; do
        i=$(expr $i + 1)
        PERCENT=`pwd|awk "{ print $i/$NUMBER_OF_FILES*100}"`
        ROUND_PERCENT=`printf "%.0f" $PERCENT`
        cp "$file" "$DESTINATION_MP3"
        echo -n "   $ROUND_PERCENT% Complete"
        tput hpa 0
    done
 
    echo
    echo
    echo "$GREEN>>$WHITE Copied $NUMBER_OF_FILES files $NORMAL"
    echo -n "[$GREEN DONE $NORMAL], please insert next CD and press any key to continue..."
    eject
    read dummy_variabel
    mount /media/cdrom
done

(It calculates % done by checking how many files and doing a for loop on each instead of using cp with wildcard *)

Quick Tip: Disabling ctrl-alt-delete reboot in FreeBSD

Posted by mastrboy on December 6th, 2007

Yeaa, my first blog post, but to the point.

To disable ctrl-alt-del reboot from a physical keyboard on a system running FreeBSD you do the following steps:

  • edit the file /etc/sysctl.conf , add the following line and save.

hw.syscons.kbd_reboot=0

Currently this will only activate if you reboot the machine, but you can change kernel options whithout rebooting very easily, to do so type inn the following command at a shell prompt:

# sysctl hw.syscons.kbd_reboot=0

Now ctrl-alt-delete rebooting should be disabled, test it out ;)


Copyright © 2007 mastrboy’s blog. All rights reserved.