Thursday, January 31, 2008

find duplicate files on your machine

ive had need for this before. A program to find duplicate files on your computer. i have been told by a very reliable source that this is good:

http://www.beautylabs.net/software/dupseek.html

so i am going to write it down so that next time i need this, i will have it

dupes are evil

Thursday, January 24, 2008

Java: reading / writing international characters

It is actually very easy to support international characters in java. The only trick is knowing the charset that the text is encoded in. Most of the time is a safe bet to try UTF-8 if you dont know. If you use Apache's HTTPClient it has methods to get the charset of the stream you are reading from.


Tuesday, January 22, 2008

Music for January

this place has lots of kraftwerk and other interesting stuff:

http://elf.art.pl/

this place has a BUNCH of music, lots of normal music with weird Japanese bands i've never heard of:

http://side7.homeunix.net/s/mp3/

Unix: Compress or delete files older then X days

Problem:
I have some logs in some directories that i need to back up if the file is at least 12 days old, if the file is older then 24 days, i need to delete it

Solution:

to compress:
find <path within you're looking> -xdev -mtime +<number of days> -exec /usr/bin/compress {} \;

to delete:
find <path within you're looking> -xdev -mtime +<number of days> -exec /usr/bin/rm -f {} \;


Note: This was tested on Solaris 8

Examples:

find /usr/local/apache/logs/ -xdev -name "sar.*" -mtime +24 -exec /usr/bin/rm -f {} \;
find /usr/local/apache/logs/ -xdev -name "sar.*" -mtime +12 -exec /usr/bin/compress {} \;

Tuesday, January 15, 2008

Cooking: How to make sushi rice

Making perfect sushi rice is hard, it has to be cooked though, soft and sticky. Ive always had trouble doing it because i would end up burning the rice on the bottom of the pot (i dont have a rice cooker). My rice wouldnt be sticky enough to stick to the seaweed. My friend Sam always emphasized to me how important it was to make the rice "just right" when making sushi.

Enough, babble! i found a blog entry that makes cooking sushi rice easy! it actually came out great the first time i tried the oven method.

http://beyondsalmon.blogspot.com/2006/02/technique-of-week-how-to-make-sushi.html

Thursday, January 03, 2008

how to: use cron

ok, now that i really know how to use the cron i should blog it incase i forget

this assumes you have nothing in your cron / or your crontab is in sync with hostname.cron because you always use this method to modify the crontab.

0. run crontab -l to make sure your crontab is empty, if its not, paste what it has to the bottom of the file you make in step 1

1. make a file called hostname. cron and add this into the top of it for later:
#########################################
# #
# Cron file for [username] #
# #
#########################################
# min hour dom month dow usr cmd
# use '*' as skipped element

2. add your stuff to it, here is a better explanation on what to add:
01 * * * * echo "This command is run at one min past every hour"
17 8 * * * echo "This command is run daily at 8:17 am"
17 20 * * * echo "This command is run daily at 8:17 pm"
00 4 * * 0 echo "This command is run at 4 am every Sunday"
* 4 * * Sun echo "So is this"
42 4 1 * * echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * echo "This command is run hourly on the 19th of July"

3. save your file.

4. run this:
crontab < hostname.cron

done!

useful info happily stolen from here: http://www.unixgeeks.org/security/newbie/unix/cron-1.html

Wednesday, January 02, 2008

do you like guns, knives or real estate?


I recently made a website using adobe contribute and i need it to start being found on the internets:

http://TheTraditionalHunter.com <- go here if you want to see some 600$ pocket knives, or muzzle loading guns and other neat stuff. I have some high res pictures up that are pretty neat.

http://www.BayStateHomesForSale.com
<- go here if you are planning to buy/sell a house in MA or NH, they have a nice MLS search (thing that lets you look up houses for sale in the area).