Monday, September 24, 2012

Project Streetfighter ZXR 750 complete!

Today I got the ZXR 750 bike back from the sprayer...yeah I know: too many delays!


It is now a fully fletched streetfighter and feels totally different from how it was - although it is much more comfortable, I have to take some time to actually adjust from more than 6 months riding just an enduro (my beloved XR400) to ride it confidently especially in the notorious Maltese roads.



This is how it was originally when I bought the bike almost two years ago:



Related posts of this project:
http://www.jamesattard.com/2011/04/day-i-got-my-first-superbike.html
http://www.jamesattard.com/2012/05/zxr750-streetfighter-project-part-1.html
http://www.jamesattard.com/2012/05/zxr750-streetfighter-project-part-2.html


Got myself the Note Android 4.0.4

Those who follow my blog know about my bad experience with the drowned iPhone 3GS. For a couple of months I have temporary used an old Nokia E51 which I tethered because of the remote nature of my work. Could not wait anymore so I got a Chinese Android 4.0.4.

The phone arrived today - beautifully boxed like the real deal. The specs, are actually very real!!


  1. CPU: 1GHz
  2. Screen: WVGA high-definition display 5 inch
  3. TV Mobile
  4. Large Battery Capacity: 2500mA
  5. ROM 32GBit + RAM 4GBit
  6. Dual SIM Card
Pretty awesome huh?

Sunday, September 23, 2012

Offroad experience in Gozo with XR400

I spent this weekend with my family in Gozo to take a break from a year of stressful activities. I took the opportunity to go solo with my XR400 to do some trailing and offroading. My favorite locations were Saguna Hills, Ta' Cenc, Imgarr ix-Xwieni, l-Gharb, San Lawrenz and Dwejra.




My XR not only withstood the fields, rocks and all the other plenty of trails, but gave me pleasure and fun in the process. The 4WD is of my bro Eman who was with me through this experience.









As a reminder, if you happen to ride a Honda XR in Malta or you are simply a fan of these fantastic machines, join our Facebook group.

Friday, September 14, 2012

Joining MySQL tables from different schemas

Today I ran into a situation whereby a client needed to join 2 tables which happened to be in different schemas but on the same host. One of the schemas was not being replicated and this particular table was moved appropriately there. To join tables which reside in different schemas, it is very simple:

SELECT u1.*, u2.* FROM database1.users u1 LEFT JOIN database2.users u2 ON u1.id=u2.id WHERE u2.id > 10 and u1.id < 100

Thursday, September 13, 2012

See timestamp with Linux history command

You can see a recollection of commands on a linux system by using the history command. I would like to share with you a good trick to not only see the command, but also the timestamp it was executed. This is particularly useful for auditing. You simply need to set the environmental variable as follows:

export HISTTIMEFORMAT="%F %T "

Now, history will display commands as follows:

 1476  2012-09-13 06:25:59 mysql
 1477  2012-09-13 06:25:59 exit
 1478  2012-09-13 06:26:02 history | less

The ultimate Linux screen tip

Ok maybe all my blog titles about Linux screen tool seem exaggerated but I cannot stress enough how this tool boosts my productivity! One of my biggest tips is the follow.

Paste the following code in your $HOME/.screenrc file (create it if it does not exist):

shell -${SHELL}
defscrollback 4096
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
bind ' ' windowlist -b
bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"



To give you an idea, this is what a typical screen session looks to me:

Sometimes I go hardcore mode and insert screens within screen sessions...but more on that in another article..

MySQL dumping triggers and procedures

To dump MySQL triggers and stored procedures using mysqldump, you have two options:

1) Dump the mysql schema (which may not always be feasible)

OR

2) Use the following mysqldump command:


mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database> > outputfile.sql


Insert a line at start of file in Linux

Adding a line at the end of file is very simple in Linux with the '>>' redirector. But adding a line at the beginning of the file entails the use of 'sed'. Suppose we have a file lines.txt:

bbb
ccc
ddd

If we want to add 'aaa' at the beginning we can use the following command:


sed -i '1i aaa' lines.txt

Tuesday, September 11, 2012

Soon moving to Aberdeen

I will be soon moving to Aberdeen for a year. I think this will happen next month and I am really excited. Would be really cool if I met someone who is reading this blog who happens to be a remote IT contractor as well.

Monday, September 10, 2012

People working from home are healthier and wiser

Ever since I embarked the journey of working from home, I have never actually talked about it..But for today let me just direct you to a good article: http://remoteworkerdaily.com/2012/02/02/people-who-work-at-home/

Sunday, September 09, 2012

Bye bye macbook!

Today I departed from my beloved macbook which I faithfully used for the past two years. Due to increased workload I had recently upgraded machine (no not another macbook! I went Linux..) so I had no use for it. Good news is that I managed to sell it for the same price I got it.

Saturday, September 08, 2012

Mysqldump - dump insert statements only

If you are only interested in generating the insert statements (i.e. exclude create/drop table, comments, locks, and stuff like that) you may want to use the --compact -t options. I normally use it when I want to do bulk inserts and create a table a priori without indexes.

Friday, September 07, 2012

More Linux Screen tricks

How to detach the screen from within another screen?
Ctrl-a a d

How to rename window?
Ctrl-a A

Saturday, September 01, 2012

Honda XR Malta Club

Last week I opened the Honda XR Malta facebook group (http://www.facebook.com/groups/hondaxrmalta/). The feedback was quite successful, maybe in the near future it will take the shape of a club where members can meet and discuss all the things they want about their XR.

If you are a Honda XR owner or just an admirer of these motorcycles here in Malta, you are encouraged to join this group and participate.