[13:12:17] Gavin:
`Mark, I need your help, I slipped with a knife in my hand and I accidentally cut my jugular, I'm bleeding quite heavily.'
`That's nothing! If I cut myself it would be much worse, and much more painful!'
Friday, 29 July 2011
Tuesday, 10 May 2011
mutt
(o): Sort messages according to options presented.
(l): Limit view to a search parameter.
(t): Tag message.
(;): Operate on tagged messages
(s): Save message (or, following `;' tagged messages)
(c): Change to directory
(b): Bounce message (forward, without changing the message at all)
(g): Group reply (reply to all)
CTRL b: View html links in message; select one; run in a browser. Needs urlview from apt-get
(l): Limit view to a search parameter.
(t): Tag message.
(;): Operate on tagged messages
(s): Save message (or, following `;' tagged messages)
(c): Change to directory
(b): Bounce message (forward, without changing the message at all)
(g): Group reply (reply to all)
CTRL b: View html links in message; select one; run in a browser. Needs urlview from apt-get
Thursday, 14 April 2011
Deleting .FS and .ES recursively.
for j in `find -maxdepth 1 -name '*parallel'`; do cd $j; echo $j; for i in `find -mount -name "*.ES"`; do ls -lha $i; done; cd ..; done;
Change the ls to rm when comfortable.
Or, bigger:
for j in `find -maxdepth 1 -name '*parallel'`; do cd $j; echo $j; for i in `find -mount -name "*.ES"`; do rm $i; done; for i in `find -mount -name "*.FS"`; do rm $i; done; cd ..; done;
------------------------
The find command gives a cleaner approach:
find . -type f -name "*.ES" -exec ls -lha {} \;
ls -lha can be replaced with, say, rm when I'm happy the command is working as expected.
Change the ls to rm when comfortable.
Or, bigger:
for j in `find -maxdepth 1 -name '*parallel'`; do cd $j; echo $j; for i in `find -mount -name "*.ES"`; do rm $i; done; for i in `find -mount -name "*.FS"`; do rm $i; done; cd ..; done;
------------------------
The find command gives a cleaner approach:
find . -type f -name "*.ES" -exec ls -lha {} \;
ls -lha can be replaced with, say, rm when I'm happy the command is working as expected.
Sunday, 27 March 2011
wow choppy audio
mplayer is fine; ubuntu audio is fine. WoW under wine plays a sound when the `play' button is pressed, but WoW is silent in-game.
Check sound preferences. Check the device in use. Analogue stero duplex works.
Check winecfg audio. Uncheck `use hardware acceleration'
Check sound preferences. Check the device in use. Analogue stero duplex works.
Check winecfg audio. Uncheck `use hardware acceleration'
Friday, 4 March 2011
Tuesday, 22 February 2011
flac to mp3
for file in *.flac; do flac -cd "$file" | lame -h - "${file%.flac}.mp3"; done
UPDATE
I used, `-h' above. Different conversion is possible with,
for file in *.flac; do flac -cd "$file" | lame --noreplaygain -q 0 --vbr-new - "${file%.flac}.mp3"; done
vbr: automatically choose bit rate to achieve a `quality': 4 is default (0 being highest,
9 being lowest).
Turn off level adjustment for each track. I can hear clipping, thank you, and will turn the level down if required.
-q 0 : highest quality encoding.
UPDATE
I used, `-h' above. Different conversion is possible with,
for file in *.flac; do flac -cd "$file" | lame --noreplaygain -q 0 --vbr-new - "${file%.flac}.mp3"; done
vbr: automatically choose bit rate to achieve a `quality': 4 is default (0 being highest,
9 being lowest).
Turn off level adjustment for each track. I can hear clipping, thank you, and will turn the level down if required.
-q 0 : highest quality encoding.
Thursday, 27 January 2011
python image cropping ( crop )
import Image
a = Image.open('screenshot-20110127@110832.png')
b = a.crop((100, 100, 400, 400)) # left, top, right, bottom.
b.save('output.png')
or, say,
import os, Image
a = os.listdir(os.getcwd())
# List of paired elements: [[image, filename], [image, filename], ...]
b = [[Image.open(i), i] for i in a if 'screenshot' in i]
c = [[i[0].crop((400, 312, 1410, 950)), i[1]] for i in b] # crop
[i[0].save(i[1][:-3] + 'new.png') for i in c] # save with new filenames.
a = Image.open('screenshot-20110127@110832.png')
b = a.crop((100, 100, 400, 400)) # left, top, right, bottom.
b.save('output.png')
or, say,
import os, Image
a = os.listdir(os.getcwd())
# List of paired elements: [[image, filename], [image, filename], ...]
b = [[Image.open(i), i] for i in a if 'screenshot' in i]
c = [[i[0].crop((400, 312, 1410, 950)), i[1]] for i in b] # crop
[i[0].save(i[1][:-3] + 'new.png') for i in c] # save with new filenames.
Subscribe to:
Posts (Atom)