Saturday, October 30, 2010

wget notes

wget is used to download files from a web site.  Too bad the vastly easier to use filezilla, which can do so for ftp sites, (as well as using the sftp protocol over ssh) doesn't have an html option.

wget is invoked with the url as the argument.  Possible tuning options include:

-c continue a failed download
-r recurse into directories
-l depth (level) to recurse
--retry-connrefused  retry this error, rather than stop
--no-host-directories  gets rid of fetching to directory "http...."
-t number (override default retries of 20)

.wgetrc  save options per use
/etc/wgetrc  global option file if present

handy shell script at:

source package system:

Wget follows parent directories and downloads lots of crap you don't want if you don't use the "noparent" option.

here is an example:

wget -np -r -l 1

Next hint to figure out is how to save the files w/o all the crap at the front of the file name.

The above results in files with index.php?path=linux%2Fpackages/ at the front of each file name.

At least I can get all the sources for building the linux onto my system.  next to figure out how to clean up the names, probably a script.

Need a slice and dice python script to use for these occasions. 

Wednesday, October 27, 2010

Linux Backup search

this is just a collection of backup solutions for linux.  I'll update it as they are investigated.

rsync (of any kind)
example for dry run on local nas:

rsync -avn -e /export/nas-10-11-d5 /export/nas-01-7B-75

rsync wrapper 

  • two directories
    rsync -zvr /var/opt/installation/inventory/ /root/temp
  • Preserve timestamps during Sync using rsync -a
    rsync -azv /var/opt/installation/inventory/ /root/temp/
  • Synchronize Only One File
    rsync -v /var/lib/rpm/Pubkeys /root/temp/
  • Synchronize Files From Local to Remote
    rsync -avz /root/temp/ thegeekstuff@
  • Synchronize Files From Remote to Local
    rsync -avz thegeekstuff@ /root/temp
  • Remote shell for Synchronization
    rsync -avz -e ssh thegeekstuff@ /root/temp
  • Do Not Overwrite the Modified Files at the Destination
    rsync -avzu thegeekstuff@ /root/temp
  • Synchronize only the Directory Tree Structure (not the files)
    rsync -v -d thegeekstuff@ .
  • View the rsync Progress during Transfer
    rsync -avz --progress thegeekstuff@ /root/temp/
  • Delete the Files Created at the Target
    rsync -avz --delete thegeekstuff@ .

Google command line tricks for access to google apps

A quick way to upload a lot of photos to Picassaweb is to use the google command line tool.  It is a python tool, so should be usable in both Windows and in Linux.

I have used it to upload a lot of photos to my picassa page  <didnt work will have to see why 

Here is the link to the google blog on the subject:

this is an example of the use of the command after the google python bit is loaded.

google picasa create --title "My album" ~/Photos/vacation/*.jpg

Much less painful than the google picassa web interface.  Unfortunately, the picassa application seems to take off and try to find all of your pictures when you start it, and that is in the many GB and several hundred thousands of photos.

installing googlecl load

also to get this to work gdata is required as well as

of course python 2.5 or later is required to get the xml parser and the basic language support.

Sunday, October 10, 2010

Linux Tips

I've been doing a lot of research on USB input devices and have found a lot of resources.  One fellow has a page with a lot of common complaints I've had happen to me over the course of years using Unix and Linux.

Ever cat a binary file and have a strange font confront you.  He's got observations and solutions for a lot of such problems.   BTW the answer to the strange font is that a 0x16 character (Shift Out) was sent to your terminal emulator.  Solution is to blind type an echo command of 0x17 (Shift In) to cancel it.

here are some links into useful sites:

This is a very useful page on find.  Useful for locating and reassigning owner to files.
here are some examples
find /usr/local/fonts -user warwick [RET]
To find all files in the `~/html/' directory tree with an
`.html' extension, and output lines from these files that contain
the string `organic', type:

 find ~/html/ -name '*.html' -exec grep organic '{}' ';' [RET]
NFS information
Play dvd's
Add Raid0 mirroring to single disk system (no reboot) 
Misc links 
Debug Bash scripts 
Debug Make files 
Admin tips