17 August 2012

irc in terminal

sudo apt-get install irssi
irssi

/connect server_name
/join #channel_name
/nick new_nick
/msg user xdcc send number
/window number
/dcc get

10 August 2012

resize and delete exif data

exif data exists
identify -format %[EXIF:DateTime] p.jpg
identify -format %[exif:*] p.jpg 


strip exif files
jhead -purejpg p.jpg 

convert in batch
for i in *jpg; do convert -resize 50% $i s$i; jhead -purejpg s$i; done

03 August 2012

viewing usb raw (usb snifing) in ubuntu karmic

1. check kernel version
uname -r
mine is 2.6.31-14-generic
2. since my kernel is > 2.6.21, I need libpcap 1.1.0
locate libpcap
found out mine is libpcap.so.1.0.0
4. ???

25 July 2012

rsync to copy only new files

copy only new files (keep old files on server) to server.
rsync -avz -e 'ssh -i id_rsa' from/* server:~/to/
for just printing, not executing, of what it will do
-avzn

notes
  • works with local folders as well
  • auto create folder for you, no need mkdir

23 July 2012

bash script: copy to server, files that are modified today

(all in one line)

find * -mtime 0 -printf "%p " | 
awk '{print "scp -i sshid "$0" user@hostname:/path"}' | sh

copy files modified after 13 days ago
find * -mtime -13 -printf "%p " | awk '{print "cp -p "$0" ~/folder "}' | sh

20 July 2012

editing mov files in virtualdub

to be installed:
x264: x264vfw_37_2200bm_33968.exe
xvid: Xvid-1.3.2-20110601.exe
ffdshow: ffdshow_rev4422_20120409.exe
virtualdub quicktime plugin: Quicktime_VD_v0.2.0.0_bin.zip (place .vdplugin in plugins and edit Quicktime.ini line to Mode=2)
Apple Quicktime
avisynth


create a file.avs:
make sure you write the full path!!
DirectShowSource("c:\locationto\video.mov")

You can now open a .mov file in virtual dub. (ぱちぱち)
For compression, I currently use xvid, which converts a 22 minutes-ish .mov 1.9Gb video file to a 361mb .avi (resolution is 640x480).

Any Video Converter is a good encoder, though it has a suspicious name... but i need more compression, virtualdub may do it... i guess.

source

17 July 2012

valgrind

there are times when the code works in mac while it breaks in ubuntu.
munmap_chunk(): invalid pointer
the problem was that i was trying to set a minus array id.
this was found by
valgrind --leak-check=full --memcheck:leak-check=full --show-reachable=yes -v ./programName