Since I have the memory of a goldfish, this will basically used to catalog/archive things so that I can use it as a reference. Maybe someone might find it helpful. It will mostly revolve around tech/linux stuff.
Tuesday, November 17, 2009
Thursday, October 1, 2009
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>.
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
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
Wednesday, March 25, 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
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
Subscribe to:
Posts (Atom)