If a 1Tb hard disk that is installed on a Gigabyte motherboard appears to have
a size of 33 Mbyte after some time then do the following:
>hdparm -N /dev/sdc (assuming that the disc appears as /dev/sdc)
/dev/sdc:
max sectors = 1953525168/1953525168, HPA is disabled
write the number that appears behind the slash in the following line:
>hdparm -Np1953525168 /dev/sdc
Then reboot the machine.
The disc has its original size and all data is still there.
Thanks to:
http://www.mail-archive.com/linux-ide@vger.kernel.org/msg16327.html
Montag, 31. Mai 2010
Donnerstag, 18. Februar 2010
howto encrypt a directory to a file
To encrypt a directory input_directory to a encrypted file do the following:
a) generated a file input_directory_file big enough to hold the data. This file will be the
filename of theencrypted file later. To do this you can use the command dd if=/dev/zero
of=input_directory_file bs=1M count=100. This command will generate a file with 100Mb size.
b) losetup /dev/loop0 input_directory_file
c) cryptsetup luksFormat /dev/loop0 (answer with YES and specify the password twice)
d) cryptsetup luksOpen /dev/loop0 containername
e) mke2fs /dev/mapper/containername (to put a filessystem to the device)
f) mkdir container_dirctory
g) mount /dev/mapper/containername container_directory
h) put all the files and directories inside this container_directory
i) umount container_directory
j) cryptsetup luksClose containername
k) losetup -d /dev/loop0
That's all
a) generated a file input_directory_file big enough to hold the data. This file will be the
filename of theencrypted file later. To do this you can use the command dd if=/dev/zero
of=input_directory_file bs=1M count=100. This command will generate a file with 100Mb size.
b) losetup /dev/loop0 input_directory_file
c) cryptsetup luksFormat /dev/loop0 (answer with YES and specify the password twice)
d) cryptsetup luksOpen /dev/loop0 containername
e) mke2fs /dev/mapper/containername (to put a filessystem to the device)
f) mkdir container_dirctory
g) mount /dev/mapper/containername container_directory
h) put all the files and directories inside this container_directory
i) umount container_directory
j) cryptsetup luksClose containername
k) losetup -d /dev/loop0
That's all
Donnerstag, 14. Januar 2010
how to read the database of sleep cycle and how to generate the same plots
1) copy the file /var/mobile/Applications/sleep cycle/Documents/eventlog.sqlite
to your pc.
2) use sqlitebrowser to open the file and to extract the data:
ZINTENSITY contains the data
ZTIME contains the time
ZSLEEPSESSION contains the session number (number of night)
-> the time is given in seconds since 1.1.1970
-> example: array=dblarr(2,200)
array(0,*)=ZTIME
array(1,*)=ZINTENSITY
3) for plotting:
->subtract the time of the first element from all times (remove the time offset)
array(0,*)=array(0,0)
->generate an empty array with the same number of elements as you have seconds
arind=fltarr(max(array(0,*)))
->put your data to that positions where the time was recorded.
arind(array(0,*))=array(1,*)
-> plot the data with plot,smooth(smooth(smooth(at,1001),1001),1001)
to your pc.
2) use sqlitebrowser to open the file and to extract the data:
ZINTENSITY contains the data
ZTIME contains the time
ZSLEEPSESSION contains the session number (number of night)
-> the time is given in seconds since 1.1.1970
-> example: array=dblarr(2,200)
array(0,*)=ZTIME
array(1,*)=ZINTENSITY
3) for plotting:
->subtract the time of the first element from all times (remove the time offset)
array(0,*)=array(0,0)
->generate an empty array with the same number of elements as you have seconds
arind=fltarr(max(array(0,*)))
->put your data to that positions where the time was recorded.
arind(array(0,*))=array(1,*)
-> plot the data with plot,smooth(smooth(smooth(at,1001),1001),1001)
Mittwoch, 2. Dezember 2009
use mouse gestures in fvwm2/suse
easystroke is a wonderful program that lets you record mouse gestures and executes
commands based on them.
In conjunction with a special definition in .fvwm2rc you can specify any action
to be executed. For example to switch to a special window on the desktop:
in .fvwm2rc:
Key Pause A N FocusWindowNumber 8
-> switches to the window remembered on position 8
PipeRead 'for i in `seq 0 9`; do echo Key $i A MC AssignNumberToCurrentWindow $i; done'
->remembers the window and stores it on position 8
in easystroke define key "Pause" to a gesture of your choice.
If executing that gesture the window 8 is switched to.
commands based on them.
In conjunction with a special definition in .fvwm2rc you can specify any action
to be executed. For example to switch to a special window on the desktop:
in .fvwm2rc:
Key Pause A N FocusWindowNumber 8
-> switches to the window remembered on position 8
PipeRead 'for i in `seq 0 9`; do echo Key $i A MC AssignNumberToCurrentWindow $i; done'
->remembers the window and stores it on position 8
in easystroke define key "Pause" to a gesture of your choice.
If executing that gesture the window 8 is switched to.
Mittwoch, 18. November 2009
tell mplayer which sound device to use
mplayer -ao oss:/dev/dsp *.mp3
mplayer -ao alsa:device=hw=0.0 *.mp3
or
mplayer -ao oss:/dev/dsp1 *.mp3
mplayer -ao alsa:device=hw=1.0 *.mp3
mplayer -ao alsa:device=hw=0.0 *.mp3
or
mplayer -ao oss:/dev/dsp1 *.mp3
mplayer -ao alsa:device=hw=1.0 *.mp3
Dienstag, 10. November 2009
wacom bamboo stops working after unplugging
to solve this (to get it working as a graphic tablet again without restarting X) just switch from X11 to Console (press Ctrl + Alt + F1 together then release them) and then switch back to X11 (press Ctrl + Alt + F7 together then release them).
Then the graphic tablet works as before unplugging!
Then the graphic tablet works as before unplugging!
Dienstag, 27. Oktober 2009
Tethering of iPhone 3GS with 3.1.2 and use it as bluetooth modem in linux
1) go to Cydia and install "Enable tethering on 3GS..."
2) go to "Setttings->General->Network->Internet Tethering"
and switch tethering on. Press "Turn on Bluetooth"
3) on your linux machine establish a pairing of the iphone with the pc
in SuSe 11.2 you can do this with bluetooth-applet or bluetooth-wizard
4) on your iphone (with Settings->General->About->Bluetooth) or on your pc
(with "sdptool search DUN") find out the MAC address of your iphone's bluetooth
5) on the pc call "pand -c MACADDRESS -n" where MACADDRESS is the MAC address
discovered in step 4) (something like 00:01:02:03:04:05)
6) Set up your network on YaST2: "Network Devices->Network Settings->Add->Device Type=Bluetooth->
Next->Next->Ok
7) adjust your /etc/resolve.conf to contain
nameserver 81.3.216.100
nameserver 194.24.128.100
search 194.24.128.118
that's it.
2) go to "Setttings->General->Network->Internet Tethering"
and switch tethering on. Press "Turn on Bluetooth"
3) on your linux machine establish a pairing of the iphone with the pc
in SuSe 11.2 you can do this with bluetooth-applet or bluetooth-wizard
4) on your iphone (with Settings->General->About->Bluetooth) or on your pc
(with "sdptool search DUN") find out the MAC address of your iphone's bluetooth
5) on the pc call "pand -c MACADDRESS -n" where MACADDRESS is the MAC address
discovered in step 4) (something like 00:01:02:03:04:05)
6) Set up your network on YaST2: "Network Devices->Network Settings->Add->Device Type=Bluetooth->
Next->Next->Ok
7) adjust your /etc/resolve.conf to contain
nameserver 81.3.216.100
nameserver 194.24.128.100
search 194.24.128.118
that's it.
Abonnieren
Posts (Atom)