Squirreling

storing bits of the internet away for a rainy day

Makefiles

Posted by squirreling on July 18, 2008

Gnu Make Documentation

Automatically generating dependencies

Posted in Uncategorized | Leave a Comment »

Install Debian testing packages

Posted by squirreling on June 11, 2008

http://forums.spry.com/showthread.php?t=620

The solution for keeping stable and installing the package is to modify apt-get configuration to setup what is called a mixed system:
-create or modify the /etc/apt/apt.conf file and make it contain the following line:

Code:
APT::Default-Release "stable";

-modify the /etc/apt/sources.list file: copy all the lines containing stable (or etch), insert them at the end of the file, and replace the stable in the lines you just added by testing. You must have all the original lines in the files plus all the lines where stable has been replaced by testing.
-run apt-get update to update the list of installable packages.
-if you want to install the package foo that is present in the testing sources, use the following command:

Code:
apt-get -t testing install foo

Be very careful about which packages you install from testing. By definition they are not as stable as the packages found in the stable distribution.

Posted in Uncategorized | Leave a Comment »

Passwordless ssh

Posted by squirreling on June 11, 2008

http://linuxproblem.org/art_9.html

SSH login without password

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host local / user me to Host remote / user metoo. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

me@local:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/me/.ssh/id_rsa):
Created directory '/home/me/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/me/.ssh/id_rsa.
Your public key has been saved in /home/me/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 me@local
me@local:~> chmod 600 /home/me/.ssh/id_rsa

Now use ssh to create a directory ~/.ssh as user metoo on remote. (The directory may already exist, which is fine):

me@local:~> ssh metoo@remote mkdir -p .ssh && chmod 700 .ssh
metoo@remote's password:

Finally append a’s new public key to metoo@remote:.ssh/authorized_keys and enter metoo’s password one last time:

me@local:~> cat .ssh/id_rsa.pub | ssh metoo@remote 'cat >> 
.ssh/authorized_keys'
metoo@remote's password:
me@local:~> ssh metoo@remote chmod 644 .ssh/authorized_keys
metoo@remote's password:

From now on you can log into remote as metoo from local as me without password:

me@local:~> ssh metoo@remote hostname
remote

Keywords: ssh openssh password Author: Mathias Kettner

* Edited by me to change the users/hosts to me@local and metoo@remote

* Edited so that files have correct permissions. The .ssh directory should be 700, the .ssh/id_rsa should be 600, and the .ssh/authorized_keys file should be 644. Added troubleshooting section. Thanks to this thread for help setting up passwordless ssh on fedora.

Troubleshooting:

  • On the remote machine, kill sshd (try ‘sudo /etc/init.d/sshd stop’ or ‘sudo pkill sshd’)
  • Run sshd on the remote machine with ‘sshd -dd -e’ to view verbose output
  • Open a new terminal on the local machine and try to login to the remote (‘ssh -v metoo@remote’)
  • Look for any error messages in the output. Fix them then restart sshd. (‘sudo /etc/init.d/sshd start’)

Posted in Uncategorized | Leave a Comment »

Creating a bootable USB from an iso

Posted by squirreling on June 7, 2008

From Damn Small Linux
Convert .iso to USB installation

With the guide from [1] you can install the .iso contents non-destructively onto a USB partition. Leave out all the partitioning or formating stuff to prepare an existing and used USB drive for DSL booting:

Note: All path names are examples! Please adapt or you may corrupt existing partitions or files.

  1. Mount USB drive, with e.g. mount /dev/sdx1 /flash – can be either FAT16 or FAT32!
  2. Mount ISO image, with e.g. mount /tmp/dsl-3.2.iso /tmp/iso -o loop
  3. Copy all contents from ISO to USB drive: cp -vr /tmp/iso/* /flash/
  4. Rename and move syslinux files to root directory: mv /flash/boot/isolinux/* /flash/
  5. Rename isolinux.cfg: mv /flash/isolinux.cfg /flash/syslinux.cfg
  6. Unmount USB drive: umount /flash
  7. Install syslinux: syslinux /dev/sdx1 and eventually set the MBR boot flag for this partition (with fdisk).

Posted in Uncategorized | 1 Comment »

Bash Scripting: Mp3 Renaming

Posted by squirreling on May 11, 2008

Just wrote a quick script to rename a bunch of mp3 files, removing the site name from the file.  (ie from “23 Glory [www.site.com].mp3” to “23 Glory.mp3“.  This uses the ${var%remove-from-end} bash variable manipulation.

for file in *.mp3
do
       mv "$file" "${file%\[www.site.com\].mp3}.mp3"
done

See the Advanced Variable Manipulation in Mendel Cooper’s very useful Bash Scripting Guide.

Posted in Uncategorized | Tagged: , , , , | Leave a Comment »

ARM JTAG Programmer Schematics

Posted by squirreling on April 27, 2008

Parallel Port Programmers aka JTAG Wiggler Clones

Just uses parallel port lines to drive the JTAG programming lines.  Most schematics use AC244 or HC244 for the buffer driver (These work for target voltages of 2-6V, although I’m not sure how they’d fare using a target voltage of 3.3V with 5V signals coming in from the parallel port. The scienceprog.com schematic recommends 74LVP244 or 74LPT244 for using 3.3V targets, but these won’t work for 5V targets.). These are compatible with many ARM JTAG programming software programs (as long as they are Wiggler compatible).

Schematics:

http://www.frozeneskimo.com/electronics/arm-tutorials/jtag-wiggler-clone/

http://www.k9spud.com/jtag/

http://winarm.scienceprog.com/arm-development-tools/jtag-wiggler-clone-for-arm-microcontrollers.html

http://www.bicotech.com/?page=prod_wiggler&lg=en

ARM JTAG Programmer fully assembled available from SparkFun for $21 USD or from Olimex for $15 Euro

USB Based Programmers

The USB ARM JTAG programmers will only program with the OpenOCD software.  These are based on the FTDI USB chip.  There are USB drivers for Windows and Linux.

OpenOCD website

Hubert Hoegl’s USB ARM JTAG Programmer

Joern’s OOCDLink

Fully assembled USB Programmer, from Sparkfun for $52 USD or from Olimex

Amontec also sells USB Programmers.  The regular one works for voltages down to 1.4V, whereas the Jtag Tiny works for 2.8 to 5V.

Posted in Uncategorized | Tagged: , , , , , , , , , , , , , , | 3 Comments »

EBooks

Posted by squirreling on February 8, 2008

So Paulo Coelho made it onto the NY Times bestseller list by pirating his books.  I’ve only read the first few, but The Alchemist seems like it would be a good read. (I don’t remember exactly, but I may have read this book already a long long time ago).

Which brings me to electronic readers. Most visible is probably the Amazon Kindle and Sony’s Reader. While I’ve never been a fan of reading from a screen, these eink devices are supposedly a lot easier on the eyes. I’d like to try one out, just to see how much I would miss a few hundred pages of paper. I have my eye on the iRex iLiad or the Han Lin eBook v9, which both sport larger screens than the 6″ Kindle or Sony screen. Here’s a spec matrix of current readers, thanks to the MobileRead forum.

Posted in Uncategorized | Tagged: , , , , , , , , , , | Leave a Comment »

Asteroid to pass 344,000 mi to Earth

Posted by squirreling on January 26, 2008

Asteroid 2007 TU24 will pass Earth by ~344,000 miles (around 1.44 times the mean distance to the moon) It should be visible from Earth night of January 28/29. Time to go stargazing!

http://www.skyandtelescope.com/community/skyblog/observingblog/14346437.html

Posted in Uncategorized | Tagged: , , | Leave a Comment »

Deciphering Laundry Code

Posted by squirreling on January 17, 2008

Making sense of laundry tag

(Which apparently means normal wash in warm water without bleach, dry on low heat. Do not iron. Dry clean without trichloroethylene.)

http://www.textileaffairs.com/c-common.htm

http://www.tide.com/en_US/articles/read.jsp?topic=laundry_symbols

Posted in random | Tagged: , , , , , , | Leave a Comment »

Rat Heart Created In Univ of Minnesota Lab

Posted by squirreling on January 16, 2008

Dr. Doris A. Taylor grew a new rat heart on the scaffold of an old heart using heart cells from young rats.

Posted in Uncategorized | Tagged: , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.