Thursday, October 1, 2009

apt-build

used to build source packages from apt WITH deps optimized for your architecture
booyeah!

Wednesday, September 30, 2009

'Password-less login with ssh'

These instructions explain what to do in order to be able to use ssh for
logging on a remote machine without entering your password.
All our machines use ssh protocol 2, so please follow the corresponding
instructions. However, for completeness, the instructions for protocol 1
are provided here as well.
Please note that all instructions pertain to
<a href="http://www.openssh.org/">OpenSSH</a>.

<h3>Protocol 2</h3>

On the originating machine, say<br>
<blockquote>
<b>ssh-keygen -t rsa</b>
</blockquote>
Save the key in the default file (~/.ssh/id_rsa) and do not use a passphrase.
This will create a file ~/.ssh/id_rsa.pub. Add the contents of this file to the
file ~/.ssh/authorized_keys2 on the <em>remote</em> machine (i.e., the machine
on which you want to log on). Whereas the id_rsa.pub file is world readable,
the authorized_keys2 file should only be readable by you. Use chmod to set the
permissions accordingly.

Monday, August 24, 2009

distcc with cmake

apt-get install distcc ccache avahidaemon
edit /etc/default/distcc
STARTDISTCC="true" ALLOWEDNETS="192.168.1.0/24" LISTENER=""
edit ~/.bashrc
CCACHE_PREFIX=distcc CXX=<homeDir>/g++-4.1 CC=<homeDir>/gcc-4.1
echo "#!/bin/bash" > <homeDir>/g++4.1
echo " " >> <homeDir>/g++4.1
echo " /usr/bin/ccache /usr/bin/g++-4.1 $@" >> <homeDir>/g++4.1
echo "#!/bin/bash" > <homeDir>/gcc4.1
echo " " >> <homeDir>/gcc4.1
echo " /usr/bin/ccache /usr/bin/gcc-4.1 $@" >> <homeDir>/gc4.1
run:
sudo /etc/init.d/avahi-daemon restart
sudo /etc/init.d/distcc restart
distcc show-hosts

Friday, May 15, 2009

Friday, March 6, 2009

twitter from the command line using curl

#!/bin/bash

uid=""
pw=""
maxLen=140
tweet="$*"
len=${#tweet}
if [ ${#tweet} -gt $maxLen ]
then
   echo "Tweet too long"
   exit
fi

curl -u $uid:$pw -d status="$*" http://twitter.com/statuses/update.xml >
/dev/null 2>&1
if [  $? -ne 0 ]
then
   echo "failed to tweet"
else
   echo "Tweeted"
fi

Tuesday, February 24, 2009

Thursday, February 19, 2009

shared libraries g++

for the executable that will load the dlib, include the linker option '-rdynamic'

<lib_name.so> - shared library
<src> - source file
<src_obj> - object file of source

$(DEBUG_DIR)/<lib_name.so> : $(DEBUG_DIR)/<src_obj>
   g++ -shared -Wl,-soname,<lib_name.so> -o $(DEBUG_DIR)/<lib_name.so> $(DEBUG_DIR)/<src_obj> -lc
  
$(DEBUG_DIR)/<src_obj> :
   g++ -fPIC -g -c -Wall -I . -c src/<src> -o $(DEBUG_DIR)/<src_obj>


Wednesday, January 21, 2009

ffmpeg examples

ffmpeg -i <infile> -t 6.8 -ar 22050 -acodec libmp3lame -ab 32k -r 25
-s 320x240 -vcodec flv -qscale 9.5 <outfile>

-t time to encode
-ar audio rate
-ab audio bitrate
-r framerate
-target ntsc-dvd (to convert to dvd)
-crop[top|bottom|left|right]
-pad[top|bottom](multiples of 2) && -padcolor(hex)

to screen grab fro x11:
ffmpeg -f x11grab -s 320x240 -r 12 -i :0.0 -r 29.97 -qscale 2 <outfile>

image to video:
ffmpeg -loop_input -i <imagefile> -r 29.97 -t 10 -qscale 2 <outfile>

..and he does some awesome vhook stuff. great tutorial

original video:
http://revver.com/video/1063833/linux-howto-video-editing-magic-with-ffmpeg/

Tuesday, January 13, 2009

mac mini boot options

Mac option key - bring up boot partition options (including optical
and attached)
C - boot from optical
T - target disk mode
Shift - safe mode