Bash Shortcuts August 20, 2009
Posted by idimmu in linux.Meta-< -> go to beginning of history file
Meta-> -> go to end of history file
Meta-f -> go to next word in command line
Meta-b -> go to previous word in command line
Meta-d -> delete next word in command line (from the actual position of the prompt)
Ctrl-a -> go to the start of command line
Ctrl-e -> go to the end of command line
Ctrl-p -> previous command in history
Ctrl-n -> next command in history
Ctrl-f -> next character in command line
Ctrl-b -> previous character in command line
Ctrl-r -> reverse search in history file
Ctrl-d -> delete current character
Ctrl-k -> delete from the prompt to the end of command line
Ctrl-_ -> undo (yes, but limited)
Burning an XVid to DVD in Ubuntu Jaunty from the command line July 8, 2009
Posted by idimmu in linux.I needed to burn an XVid of one of my performances to DVD last night, remotely, as my MythBuntu box was being used by someone else to watch some crappy TV and I wanted to show off! It was a pretty simple process, just involving a bit of a wait during the transcode :)
First you will need to make install the relevent packages:
sudo aptitude install dvdauthor ffmpeg ~nlibav.+-unstripped.+If you already have dvdauthor and ffmpeg installed, you must install the unstripped libav packages as they contain a tool called mpeg2video and it's this that does the heavy grunt work!
Next we transcode the movie and create a DVD compatible MPEG. This is the part that takes the longest to do.
ffmpeg -i performance.avi -target dvd -aspect 16:9 -sameq performance.mpgNow we create the DVD structure, the VIDEO_TS etc. etc.
mkdir DVD
dvdauthor --title -f performance.mpg -o DVD
dvdauthor -T -o DVD
Which results in a structure that looks a lot like this:
DVD
DVD/VIDEO_TS
DVD/VIDEO_TS/VTS_01_1.VOB
DVD/VIDEO_TS/VIDEO_TS.BUP
DVD/VIDEO_TS/VTS_01_0.IFO
DVD/VIDEO_TS/VTS_01_3.VOB
DVD/VIDEO_TS/VTS_01_2.VOB
DVD/VIDEO_TS/VIDEO_TS.IFO
DVD/VIDEO_TS/VTS_01_0.BUP
DVD/AUDIO_TS
Then we create an iso image from that structure which we can then use to burn to a blank DVD
mkisofs -dvd-video -o performance.iso DVDThere are a million ways to burn the iso image, I actually SCP'd it to my MacBook and used the Disk Utility tool to burn it, but from the Ubuntu CD DVD Burning documentation you can use a tool called wodim!
You will need to install wodim
apt-get install wodimlist available DVD writers
wodim --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
0 dev='/dev/scd0' rwrw-- : 'LITE-ON' 'DVDRW SOHW-1633S'
-------------------------------------------------------------------------Insert a disk, then burn!
wodim dev=/dev/scd0 driveropts=burnfree -v -data performance.isogoogle-apis-mavenized does not compile April 15, 2009
Posted by idimmu in java.I need to write some backup software for our hosted Google Apps, so as we're a Java shop I'm going to be using the Java API. Also we're heavy users of Hudson and Maven so want to get the checked out source building with that.
There is a Google Code project called google-apis-mavenized which looks like it has done most of the work for us, but it does not build when it's checked out.
rus@builder:/proxy/rus$ svn checkout http://google-apis-mavenized.googlecode.com/svn/trunk/gdata-mavenized/ gdata-mavenized
<snip>
rus@builder:/proxy/rus/$ cd gdata-mavenized
rus@builder:/proxy/rus/gdata-mavenized$ mvn install
<snip>
/proxy/rus/gdata-mavenized/gdata-apis/client/src/main/java/com/google/gdata/data/extensions/ExtendedProperty.java:[20,31] cannot find symbol
symbol : class CoreErrorDomain
location: package com.google.gdata.client
After some investigation the gdata-mavenized project symlinks in files from the original gData project, but presumably due to the API constantly changing, the maintainers of google-apis-mavenized got bored or fed up so didn't symlink in newer files.
A really quick way to fix this is simply to delete the main google directory that contains all the symlinks, and just symlink that back to the real directory that contains all the source files!
rus@builder:/proxy/rus/gdata-mavenized/gdata-apis/client/src/main/java/com$ rm -rf google/
rus@builder:/proxy/rus/gdata-mavenized/gdata-apis/client/src/main/java/com$ ln -s ../../../../../../gdata-external/java/src/com/google/ .
Bamo, problem solved!
rus@builder:/proxy/rus/gdata-mavenized$ mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] google-gdata-mavenized-1-SNAPSHOT
[INFO] google-gdata-apis:1-SNAPSHOT
[INFO] gdata-client:1-SNAPSHOT
[INFO] gdata-appsforyourdomain:1-SNAPSHOT
[INFO] gdata-base:1-SNAPSHOT
[INFO] gdata-calendar:1-SNAPSHOT
[INFO] gdata-codesearch-1-SNAPSHOT
[INFO] gdata-photos:1-SNAPSHOT
[INFO] gdata-spreadsheet:1-SNAPSHOT
[INFO] gdata-docs:1-SNAPSHOT
[INFO] samples-1-SNAPSHOT
[INFO] sample-util-1-SNAPSHOT
[INFO] sample-appsforyourdomain-client-1-SNAPSHOT
[INFO] sample-authsub-webapp-1-SNAPSHOT
[INFO] sample-blogger-client-1-SNAPSHOT
[INFO] sample-calendar-client-1-SNAPSHOT
[INFO] sample-codesearch-client-1-SNAPSHOT
[INFO] sample-photos-client-1-SNAPSHOT
[INFO] sample-tester-client-1-SNAPSHOT
<snip>
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] google-gdata-mavenized-1-SNAPSHOT ..................... SUCCESS [11.711s]
[INFO] google-gdata-apis:1-SNAPSHOT .......................... SUCCESS [0.152s]
[INFO] gdata-client:1-SNAPSHOT ............................... SUCCESS [1:02.902s]
[INFO] gdata-appsforyourdomain:1-SNAPSHOT .................... SUCCESS [2.881s]
[INFO] gdata-base:1-SNAPSHOT ................................. SUCCESS [2.021s]
[INFO] gdata-calendar:1-SNAPSHOT ............................. SUCCESS [2.365s]
[INFO] gdata-codesearch-1-SNAPSHOT ........................... SUCCESS [1.397s]
[INFO] gdata-photos:1-SNAPSHOT ............................... SUCCESS [3.297s]
[INFO] gdata-spreadsheet:1-SNAPSHOT .......................... SUCCESS [1.912s]
[INFO] gdata-docs:1-SNAPSHOT ................................. SUCCESS [1.773s]
[INFO] samples-1-SNAPSHOT .................................... SUCCESS [0.173s]
[INFO] sample-util-1-SNAPSHOT ................................ SUCCESS [1.304s]
[INFO] sample-appsforyourdomain-client-1-SNAPSHOT ............ SUCCESS [1.651s]
[INFO] sample-authsub-webapp-1-SNAPSHOT ...................... SUCCESS [24.340s]
[INFO] sample-blogger-client-1-SNAPSHOT ...................... SUCCESS [1.466s]
[INFO] sample-calendar-client-1-SNAPSHOT ..................... SUCCESS [0.355s]
[INFO] sample-codesearch-client-1-SNAPSHOT ................... SUCCESS [1.396s]
[INFO] sample-photos-client-1-SNAPSHOT ....................... SUCCESS [1.192s]
[INFO] sample-tester-client-1-SNAPSHOT ....................... SUCCESS [1.656s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 6 seconds
[INFO] Finished at: Wed Apr 15 12:40:25 BST 2009
[INFO] Final Memory: 19M/45M
[INFO] ------------------------------------------------------------------------
rus@builder:/proxy/rus/gdata-mavenized$ find . -name *.jar
./gdata-samples/codesearch/target/sample-codesearch-client-1-SNAPSHOT.jar
./gdata-samples/authsub/target/authsub_sample/WEB-INF/lib/gdata-calendar-1-SNAPSHOT.jar
./gdata-samples/authsub/target/authsub_sample/WEB-INF/lib/gdata-client-1-SNAPSHOT.jar
./gdata-samples/appsforyourdomain/target/sample-appsforyourdomain-client-1-SNAPSHOT.jar
./gdata-samples/util/target/sample-util-1-SNAPSHOT.jar
./gdata-samples/tester/target/sample-tester-client-1-SNAPSHOT.jar
./gdata-samples/calendar/target/sample-calendar-client-1-SNAPSHOT.jar
./gdata-samples/photos/target/sample-photos-client-1-SNAPSHOT.jar
./gdata-samples/blogger/target/sample-blogger-client-1-SNAPSHOT.jar
./gdata-apis/codesearch/target/gdata-codesearch-1.0.jar
./gdata-apis/appsforyourdomain/target/gdata-appsforyourdomain-1.0.jar
./gdata-apis/base/target/gdata-base-1.0.jar
./gdata-apis/spreadsheet/target/gdata-spreadsheet-1.0.jar
./gdata-apis/docs/target/gdata-docs-1.0.jar
./gdata-apis/calendar/target/gdata-calendar-1.0.jar
./gdata-apis/client/target/gdata-client-1.0.jar
./gdata-apis/photos/target/gdata-photos-1.0.jar
./gdata-external/java/sample/codesearch/lib/CodeSearchClient.jar
./gdata-external/java/sample/appsforyourdomain/lib/AppsForYourDomainClient.jar
./gdata-external/java/sample/util/lib/sample-util.jar
./gdata-external/java/sample/spreadsheet/lib/GUIDemo.jar
./gdata-external/java/sample/spreadsheet/lib/IndexClient.jar
./gdata-external/java/sample/spreadsheet/lib/ImportClient.jar
./gdata-external/java/sample/spreadsheet/lib/ListDemo.jar
./gdata-external/java/sample/spreadsheet/lib/CellDemo.jar
./gdata-external/java/sample/tester/lib/TesterClient.jar
./gdata-external/java/sample/gbase/lib/gdata-base-cmdline.jar
./gdata-external/java/sample/calendar/lib/CalendarClient.jar
./gdata-external/java/sample/photos/lib/PhotosClient.jar
./gdata-external/java/lib/gdata-client-1.0.jar
./gdata-external/java/lib/gdata-appsforyourdomain-1.0.jar
./gdata-external/java/lib/gdata-spreadsheet-1.0.jar
./gdata-external/java/lib/gdata-base-1.0.jar
./gdata-external/java/lib/gdata-calendar-1.0.jar
./gdata-external/java/lib/gdata-codesearch-1.0.jar
./gdata-external/java/lib/gdata-photos-1.0.jar
Woohoo!
New Ubuntu Jaunty Screen April 9, 2009
Posted by idimmu in linux.At the moment I'm trying out the beta for Ubuntu Jaunty and one the first thing I noticed was the new version of screen available!
Initially you are provided with a menu to choose a theme!

I went with option 3, Ubuntu Dark! You're then presented with an interesting new screen display, with 2 rows of status at the bottom, in lots of colours, displaying information about the CPU and RAM etc!

There's a prompt to press F9 for options which presents a curses based interface to change settings and the information on the bottom status bar.

After smiling a little, I decided my best course of action was to delete the screen settings
rus@boosh:~$ rm -rf .screen*
and restart screen using option 1, plain! It's not that I fear change, but I don't need to know any of that information! It doesn't add value to my terminal experience, where as the extra 2 lines of space will!
Generating Secure Passwords With pwgen April 6, 2009
Posted by idimmu in linux.At my current place of employment we have a fairly strict password policy for everything, all passwords must be unique (so no single password used everywhere) and we use KeePass and KeePassX to manage them, so we can have fairly long passwords that aren't immediately rememberable full of fun characters.
Generating the passwords is a dull process so we take the sting out of it using the pwgen utility!
rus@boosh:~$ pwgen -y 12
foh8Yieghu-L aeChier/o0Si aiKaRa!ngie9 su$o3ooHe7ub Dov3oong$eis jia2ChieG(ee
ahbee`R9pei^ Di9Ep@o2Iuf: oFae3ahyi!th queix$ai6Sha ha6bem!oh4iG eiphoiCh8vu`
Dee0rohcae}j eyaeH2hah&hi kozo3aeP&ait xee4ee>Ghi9i ahR8iKe2Am`a roh.fei9deiN
Zu"u0xie2ahw ees4Gei<Lohv Ooh4holie'D poox1ooGhae- kai;gar2ieX1 Pe'oj1gae3im
Leip3pahGh{i ak0qua]u"Ghi Qui)wauDah8i Aiw~aish9oL7 sho]sh8Kae8i geipoo1Fei+n
Eengoh<nae1a rie_y#aiGh6L uX0sooch<aex Ahphai+y6aih el;ing3Ook3a Tuzai8voo#gh
kee<seeX8Dij quoL9Iu`p0ee eife7eeQuai^ wi5Ro9jei&S6 AishaiS0noh. roo*Zaic0ohc
AJ3aina`ax5j eegh2xa+a%Vo shia=qu3Thai xo{um9Wo1cha Eshei9WaeGh, eira1eiCh?oo
izie4ohT'oi4 jo.y0UYaeHeo Aich3Teiwe-u iR}e9eeDosoh ohree6iV-uom Eed.eC4Sho%f
choo2Phooyi; lu5ooChoh=Pi eengi1aVei]f ul5Reephae@s aiWa`naa2yai shei'ke1uNoo
gi3oph5Ea;b2 IeQu/oo]Ha6O Ohghoph4ieN} eeF@ee-n7ien Ohth;ei2ahhe otu@Th6phut1
vi"hah1leiSe aeGh<ahpe1ee aeh*ezeZaep6 ohL=eiquei8e AiSee)Fohh0h mohgh1Xa2ee:
cahLe>Ph1gox Dei`jaiGh1wo rei>pie'w4Ai iePhoom5ohr@ Ool1aingie?s aefii/K4tahl
tae5eeH^ei*w pheegha5Joh] Ku4va~Chaeg9 dei0she{i0Ae osha5ohF>aif ou;S3ucoW1Ba
AiK.aise5xub AeJ^ee4leebe rau(L8Bu2ail ir8keB/eik1e Soox*ai9aing Tho8heu/Ye4A
Oc(i3aeth~ae Hais!iey8phi oe4oothu5Av> ahv7ti-k0Cox sei(ch>ieg3B uoR3ieS8ooz@
eeBi@vei4igh Yi=ughi6Ur5y yag8ooYo|ezu wae1roo@Foh1 Aedah4AhG?ae we8aiYahj'ie
oogee3ui~Ng= jaefaD,oh5Ie Oopap9ariT;o ChahDeid=i3T aech)eeGee1a Eegh+oo+G0He
Bo4ahT*iejah Akou#fie7oi5 Giki9voom>og pai0boo"va6A woo0mah2AeX[ eiGh3pu&o7ee
kiequie1miL] oohei'soe2Ee The3yo_Mah2m ahzei:d1eTae Phay9Xoh;zai iu}qu6quiMie



