Archive for the 'Ideas' Category

Jar Clean Up Story

I'm pretty happy with moving some common Java libraries out of the project source folders.

I have about 4 branches of the same project checked out. Each of them were about 57mb a piece. I noticed this while I was trying to sync my projects to a remote server. (I hate slow running scripts)

I managed to move the jar files out to a common folder which was about 27mb. I wrote another recursive ant clean script (which I will share below) that helped me clean up before the sync.

Moving the libraries was relatively simple with a few changes in the ant build scripts.

Anyway I managed to bring down each project to about 10mb. Here is the recursive ant clean script.


#!/bin/bash

projects=~/projects

for project in $(ls $projects/);
do
if [ -f $projects/$project/build.xml ]; then
echo ""
echo "Cleaning $project"
cd $projects/$project
ant clean
fi
done

I tried a similar script in Windows batch, didn't work as easily. Don't need bat files, Cygwin is better. And the same bash shell scripts on Linux most of the time with little or no modification.

For a programmer tweaking never stops. I try not to work on Sunday. But its a good day to take a step back and do backups, cleanups etc.

I knew about this jar duplication but really saw it while trying to run a backup and then looking at the projects folder with jDiskReport. Need more tools like this.

Technorati Tags: , , ,

SQL Play with Firefox 3 Places

I heard good things about Firefox 3. Now that I've got Ubuntu 8.04 I thought I'd try a few commands.

1. Get the places database
2. open with sqlite
3. query the bookmarks table

cp .mozilla/firefox/xxxxxxxx.default/places.sqlite .

sqlite3 places.sqlite
sqlite> .tables
moz_anno_attributes moz_favicons moz_keywords
moz_annos moz_historyvisits moz_places
moz_bookmarks moz_inputhistory
moz_bookmarks_roots moz_items_annos

sqlite> select * from moz_places limit 1;
1|place:queryType=0&sort=8&maxResults=10|queryType=0&sort=8&maxResults=10||0|1|0||0

Happy data mining!

Technorati Tags:

Make Windows Shortcuts with Cygwin

Did you know that you can make Windows shortcuts with Cygwin and ln? I did not know this, just tried it out today and it works!

This is probably the smallest thing I'm blogging about, but read on you might get some new ideas (like I did) about file organization in Windows. I swear some days Cygwin is the only thing that keeps me sane on this office Windows XP computer.

I like to keep my /projects folder separate from my /clients folder. It just saves clicks I guess and I'm a separation junkie I can't help it. I could have manually created these shortcuts for each project but now I can do it in a bash script. Yay!

Still not following? Let me explain. I have a clients folder like this.


/clients/a/projects/a
/clients/a/projects/b
/clients/b/projects/c
/clients/a/projects/d

But I like to keep my projects in a root level projects folder like this for easy access and backups etc.


/projects/a
/projects/b
/projects/c
/projects/d

I have simple, unique, short project names. That helps a lot. Here is the magical command that can help me a great deal.


ln -s /cygdrive/d/clients/a/projects/a /cygdrive/d/projects/a

This way I can keep projects I'm currently working on in /projects and move others back to /clients/x/projects. Ideas for a project folder management script is brewing will post about that later.

Technorati Tags: ,

Browser Buttons

Did some browser button organizing, thought I'd share.

Browser Buttons

Share your browser button bar, lets see if there are anymore important buttons to add.

Technorati Tags: , ,

Things to do on Earth Day and Beyond

April 22 is Earth Day so I thought of spending my lazy Sunday morning looking at how to save the world! Here is what I came up with.

Lighting
Change to CFL bulbs for long running locations. I've noticed they bust sooner for short running lights like in the store room and bathroom. I've switched to 90% CFL. The units are down but the bill keeps going up (only in Sri Lanka).

Buy CFL's at an electrical shop rather than a supermarket. They will advise you better on which ones are better and where they will fit.

Consider motion sensors and timing units for lighting where appropriate. I have a motion sensor spot light at a dark corner of the garden and an automatic water pump system. I'm waiting for LED home lighting but I guess it'll be a while more till we get them down here.

Make use of daylight as much as possible. Move desks around knock down walls if needed. :)

Heating and cooling
That last point helps with ventilation and cuts down on running fans all day.

Look at overall air flow in the house, use an exhaust fan where needed. Consider running the exhaust fan on a solar panel directly. When the heat is up the sun is up, use the free energy falling from the sky.

If you need heated water consider solar heating. If you have a electric water heater turn it down to the bare minimum you need.

Water
If you have space and a garden look at rain water harvesting. At least to water the garden. You can also filter it and use it to flush the toilet.

In the bathroom change to a low-flow shower head and a dual flush toilet. Use faucet aerators for kitchen and bathroom taps.

Electronics
We love our gadgets, but do they have to be on all the time? Stand by power still uses some power. Turn it off from the wall if you are not using it.

According to this a LCD TV is better than a Plasma. My aging CRT is close to a LCD so it'll do for the time being.

Reality
The cost of solar even CFL's are not cheap. Living in a third world country some of these things are not available to buy even if you have money. But press on, do what you can. Influence local government, inspire business to notice these things.

Links

Technorati Tags: ,

Choosing Your Freelance Clients

Freelancers have this advantage over companies. You can choose who you want to work with on a personal level. Old school business types would tell you its not personal just business, that you should be able to work with anyone.

But when we work from home and get to know our clients first hand and see their software grow up with them, it becomes personal.

Choose your clients well. A few will stick with you for a long time. That one annoying client that pays more but gives you too much stress will take your attention away from your other, probably better clients.

Oh sometimes you get great clients that pay well too! :)

Update: similar articles

Top 10 Ways to Fire the Client From Hell - Inside CRM

SitePoint Blogs ยป How to fire a client

Cleaning up

I've been dropping a few things and cleaning up. This started around the end of last year when I wanted to clean up some stuff from 2007. I think its a on-going process.

The goal is to cut down, simplify and focus on a few good things. The information space I live in is big, its exploding everyday. There is only so much my aging mind can hold. Also the more I get into it the more I miss real life. So I'm cutting back and sticking to the few things I like.

I’m an Icon

Tumblr was using my profile photo as the Favicon. Hey that's nice an idea. This is my blog so now my face is an icon on this blog too.

Favicon 1

Favicon 2

Contactify: It’s email. Without the address.

Contactify looks like a good idea. You give them your email address and they give you a contact form. Hmm you still have to give out your email. Why? What if these sites get hacked or start selling your emails?

How about this?

  1. You sign up with a user name and password.
  2. They give you a contact form.
  3. When someone contacts you it gets added to a RSS feed only you can access on the site.
  4. If you want you contact someone back or let the RSS item expire.
  5. No email account used, no chance of spam.