Friday, December 31, 2010

Happy new year 2011

I wish my sincere greetings for a start of a new year 2011 to all my family, friends, and especially you faithful readers of this blog.

I will draft some thoughts and resolutions in another post as I am in a hurry to prepare myself for the celebrities.

Thursday, December 30, 2010

My Last "RAW" ride for 2010

Last night I enjoyed riding with my club, Raw Bikers, and I have probably enjoyed it even more due to the fact that it was the last club ride of the year. The weather was clear but quite chilly, with temperatures even reaching 9°c.

We took advantage of the clear streets which was quite strange that there was no particular traffic in the road at this time of the year. We headed towards Coast Road and Mellieha while stopping at interims for a snack.

For the first time I had managed to hit the 180kmph mark on my Honda CBF500 on a particular stretch of the road - eventually I rejoiced my trust and love again with this bike.


Unfortunately as I was reading the newspapers this morning, I found out that a fellow motorcyclist was injured in Coast Road at about 6am this morning. Wishing him a speedy recovery.

Tuesday, December 28, 2010

Understanding reddit categories and subreddits

Reddit is a social news website and is used to share news or any other interesting Internet content - reddit users can post a link and then categorize it into a subreddit. This confuses most new users as a subreddit is not a normal tag but a specific category within reddit. Here I will explain where you can find a list of the most popular subreddits and how they can be used.


When a user tries to submit a link on reddit, he will be asked to enter a category (called a subreddit) relevant to the link content:

The default category is reddit.com. You can get a list of the most popular subreddits from here. You can also organise your favorite subreddits by clicking on the Edit Subscriptions in the My Reddits menu as follows:

You can add and delete entries by clicking on the left hand side +/- frontpage links. For example if you want to select only IT related subreddits:
My favorite subreddits are the following:

  • osx
  • linux
  • database
  • security
  • seo

Make sure you share this article on reddit in the internet subreddit!

Monday, December 27, 2010

Two-way syncing a shared Google calendar on iPhone

Many people are able to easily sync their personal Google calendar on iPhone but most of them have trouble doing the same job for a shared Google calendar. This article will describe how to sync personal and shared Google calendars using Apple's free nifty application called iPhone Configuration Utility (ICU).

According to our experience, ICU is not just a canned application which automates a batched tedious task, but the only method we know of, which guarantees a smooth configuration of both types of Google calendars (personal and shared) on iPhone. Without going into much detail one must appreciate that there is a difference between configuring a shared Calendar and a persona Calendar, and often most people have trouble deploying either one or the other on iPhone.

First of all, connect iPhone to your computer. Then get ICU from Apple's website - there is a version for OSX and another one for Windows. Once installed on your computer, start up the application and create a new configuration profile:
Next you need to enter the configuration details for each of the Google Calendars, similar to the following:
For those wondering, the Cal_ID is the Calendar ID which you can obtain from the Google calendar settings. This looks like an email address.

Finally you should see an Install button in the top right corner of the ICU application:
Click on install and allow some time for this configuration profile to be installed on iPhone.

Now connect iPhone to a nearby wireless network and allow some time for the new Google calendar to appear in your calendars list! Now you can access the calendar and make two-way syncs (you can create appointments from Google or directly from iPhone, and in both ways, synched accordingly to the other mirrored calendar).

Wonderful Christmas 2010

My Christmas festivities were spent mostly with my family. Yesterday's Christian teachings were coincidentally related to the values of the Family and it is a sheer pleasure to be surrounded by people who really love you. Although I have not slept for 24 hours due to the previous night work shift, I still managed to have that occasional glass of wine and have fun conversations while eating turkey.

Later that evening I noticed that I managed to gain an extra two kilos and tried to burn them while being involved in a traditional family tug-of-war and an arm-wrestling competition.

If you have some interesting story to share about this Christmas, why don't you post it here?

Saturday, December 25, 2010

First Christmas eve at work

This is the first Christmas eve I'm spending at work. By Christmas eve I mean 24/12 19:00 - 25/12 07:00. Luckily my office is situated in a rural area so I am not jarred by celebrations and drunkards. As atrocious as it may sound, I still managed to participate in a family celebration before heading to work...And will intend to resume the festivities by skipping my sleep after work and hear the 8:00 Mass followed by a good lunch.

Off to make some coffee..

Friday, December 24, 2010

Digging a delicious reddit twit!

Lately I have immersed myself in the wonderful world of social bookmarking, namely, Digg, Del.ico.us, Reddit, and Twitter. It's a whole new Internet and experience and I am using it not only to bookmark and share r00tb0x.com articles but also to discover what is hype in the Internet community.

I know these have existed already for a while, but only got to appreciate them now, by myself...

Thursday, December 23, 2010

Exceeded Internet threshold

Oh well, looks like I have to give up my home Internet connection for the rest of the month as I've exceeded the maximum download threshold. So will either burrow Internet from my neighbors or social engineer my provider to allow me some graceful connection... *grin*

After all, it's Christmas time!

Wednesday, December 22, 2010

Wohoo, Top 10 ranking in Google!

One of my r00tb0x.com articles, called Syntax Highlighting + CKEditor in Drupal, ranks 8 in Google! Considering that the article is only one month old, my SEO is working quite well...

What does it mean in layman terms? Well, that among 31,000 results which geeks search for in Google, my geek-counterpart website ranks 8th in Google!


Tuesday, December 21, 2010

Christmas Pantomime

This evening I'm off to enjoy the Christmas Panto themed around Scrooge at the MFCC. The panto is produced by MADC with Alan Montanaro as the Dame. This will be the perfect evening to spend in Christmas time with my fiancee` and her family after a very busy week at work!

Sunday, December 19, 2010

Flights to Malta still delayed

Looks like the bad weather is still affecting local and international airlines, although London seems to be recuperating a bit:




















In Malta the situation looks quite stagnated and can be confirmed by today's news reports:

 

Saturday, December 18, 2010

Hide or show Education and Work info on Facebook

Facebook's privacy settings are pretty granular. The only problem is that these settings are not really evident, and their default values are pretty much 'unsecure'. This article will show how to hide (or display) your education and work information on your Facebook profile.

Perhaps the privacy setting for the Education and Work information is the trickiest one. The reason is that its setting is not in the same menu of the other privacy settings (ex. Photos, Relationship Status, Birthday, etc..). To access these privacy settings you must go to Account -> Privacy Settings in the upper right corner of your profile:

Next step is to select the Connecting on Facebook settings:

Here you will be presented the option to show or hide your Work and Education information. From this menu you can also change privacy settings of your friend list display among other things:

SEO: Are your keywords competitive?

If you want your website to rank high in search engines, you need to know how your keywords rank. If your website is about flowers, your keywords (i.e. phrases in your title tags and content), might be 'roses', 'daffodils', 'bouquet', etc...If there are plenty of other websites which use those keywords, then you are in competition! This article will explain how to determine whether your keywords are competitive or not.

In Search Engine Optimisation (SEO), we normally aim for non-competitive keywords, i.e. keywords which are not used by many websites. In this way we will have a better placement in search engines such as Google and Yahoo.

Let's take an example of this article's keywords and their current ranking in Google. This article is called "SEO: Are your keywords competitive" - the keywords being mainly: 'SEO', 'keywords', and 'competitive'. To determine their competitiveness, you only need to enter these keywords in Google and take note of the total results. For example, at the writing of this article, jamesattard.com will be competing against 2,860,000 other pages:
You will realize that popular topics are difficult to compete against in Search Engines and you must carefully choose your keywords by using the methodology we have just described.

Looks like an ideal day for a picnic

After a couple of heavy raining and cold days here in Malta, this afternoon I will take the opportunity to organize a little picnic with my fiancee`. We will probably head to somewhere in the north with the motorcycle and settle a little tent while enjoying the clear weather. I enjoy these days as they normally clear up my mind and brings me closer to my other half while at the same time finding the perfect excuse to eat good food and drink tasty wine!

Friday, December 17, 2010

Importing a vehicle in Malta

Importing an automobile or a motorcycle in Malta is pretty straightforward albeit expensive! Around thirty minutes ago I was looking around online for a Honda Transalp 650cc (2005 model) and managed to find one just under EUR2000. Fair deal!

But then the shock came when I estimated the registration taxes (excluding admin fees of course!) - another EUR1070.


For those who are wondering, you can calculate the registration tax from http://www.valuation.vehicleregistration.gov.mt/ .

Thursday, December 16, 2010

Awesome debut UNDER3KINGDOMS

Yesterday's gig was awesome. The crowd was not just 'warm'. It went mad (no pun intended MCH guys!) by the middle of the set list. And our girls were supporting us all the way. An hour and a half of music orgasm (at least we had all those faces while playing).

Will upload some photos as soon as we get them...

Wednesday, December 15, 2010

Barefooted in the office

Another wet morning for a bike ride to work. Had to take off the boots and let them dry in the terrace while sitting barefooted sipping coffee and monitoring servers. The joy of not working in a corporate environment!

Tuesday, December 14, 2010

Who likes wet rides?

Definitely myself. When I put on the jacket, strap on the gloves, and secure the helmet, riding the motorcycle in the rain is something which only a few people have the luck to experience. Rain drops hitting your face at high speeds, the rear wheel starts wobbling on each thrust of the throttle and a feeling that you are just by yourself hitting the roads, are just a few things I experience every time I decide to go for a night bike run when it rains in the streets of Malta.

Tomorrow debut of UNDER3KINGDOMS

Emerging Maltese rock band UNDER3KINGDOMS will play live for the first time at Rookies tomorrow @ 22:00...I play the bass with the band and I can tell you it's really fun playing with these guys - they are all seasoned musicians and friends of mine. So if you want to taste our music make sure to be there!

Singer - Suzanne
Bass - Myself
Guitar - Fofi
Drums - Chris

Facebook latest upgrade

I must thank Mark Zuckerberg and the entire Facebook development team for upgrading its look and feel. Now ex-bloggers like me can take their course back to their glorious blogging days.

That was sarcasm of course. With Facebook becoming more like a MySpace profile, it gave us a valid reason to go back and do some proper blogging on a real blogging framework.

That said, like many bloggers around, I still use facebook to leave comments and advertise any content of interest (known as retweeting in Twitter jargon). In fact I am going to retweet this post and others from r00tb0x.com. More on r00tb0x.com later...

Back to blogging here!

For the past couple of years I have had this on-again-off-again relationship with this blog. Lots of things have changed, not only in my life, but also in this blog (if you take a look at it you'll notice that I have cleaned it up a bit and revamped its design).

So fire up your RSS readers and subscribe again as I will be posting here in no time! ;)

Setup a custom domain or subdomain for Blogger

Blogger is one of the most popular blogging engines available for free by Google. We at r00tb0x.com are actually fans of blogger and do own a couple of blogs which are hosted there! This article will explain how to setup your own domain to host a blog on Blogger.

Whether you want www.yourdomain.com or subdomain.yourdomain.com pointing to a Blogger blog, the process is perfectly identical. First things first - add the following DNS records:

A          www  216.239.32.21
A          www  216.239.34.21
A          www  216.239.36.21
 
CNAME      www  ghs.google.com



Of course you can replace 'www' with any subdomain of your choice.

Once the DNS is setup and pointing to Blogger, next step is to tell Blogger about your custom domain name. From the dashboard go to the Settings menu and choose 'Publishing':
Finally enter your custom domain in the advanced settings section:

Good! now www.yourdomain.com will point to your Blogger account and vice-versa!

Friday, December 10, 2010

Using Gimp to make a rounded corner image

One of the most popular and frequently used techniques in image editing, is the use of rounded corners. Rounded corner banners or menus look more sleek than squarish ones. Here we describe a step by step easy way to achieve this in Gimp.

Following this guide will help you achieve a rounded corner image like this one:

So start by loading the image in gimp and add an alpha layer as shown below:

This will add a transparency layer to the image. Next we need to make a rounded rectangular selection of the image. This is similar to the conventional rectangular selection, only that with this one, it is rounded!

You will be prompted to enter the radius. This controls how big is the rounded edge...For this example you can set the radius to 11.

Now we are going to invert the selection, so we are going to actually select the edges:

Final step is to chop this selection (i.e. the edges) by choosing 'Edit..Cut' or by just pressing the Delete key on your keyboard:

Good! You ended up with a nice rounded corner image. Remember that you can adapt this technique to other image editing software programs such as CSS.

Wednesday, December 08, 2010

Import Outlook or iCal Calendars in Google

It is possible to transfer events from Outlook or iCal calendars to Google. While this article will not explain the various advantages of placing your calendars inside Google, we will show you how to perform the import operation. Moreover, you might be tempted to centralise all your Microsoft Outlook calendars (such as work, friends and family) and import them in Google.

The very first step is to save your Outlook Calendar in iCalendar format by right clicking on the calendar and choosing 'Save as...'.
Next you will need to go inside Google Calendar and click 'Add..' -> 'Import Calendar' as shown below:

This will allow you to import your previously saved Outlook Calendar inside Google. Therefore next step is to select the Outlook Calendar to import and also the Google Calendar into which you want to import it:
Click 'Import' and voila`! You got your calendar details imported to your Google Calendar. Remember that you can import into a different calendar by first creating a new blank calendar before doing the previous step.

Saturday, November 20, 2010

GPS coordinates and Google Maps

Many times we require to extract the GPS coordinates from a Google Map location. Similarly we might need to pinpoint an exact location in Google Map with knowledge of GPS coordinates obtained from a GPS device. This articles demonstrates how you can use GPS coordinates with Google Maps.

Suppose you are using your favorite GPS device and have located an interesting place to share with your friends. Once ytou record the GPS coordinates with your GPS device, you can easily share the location with your friends by mapping the GPS coordinates on Google Maps. Just go to the following URL:

http://maps.google.com/?ll=LATITUDE,LONGITUDE

, substituting the LATITUDE and LONGITUDE above with the ones you obtain from the GPS device. For example I am currently writing this article from coordinates  (35.892944,14.460829), and you can easily find this location on Google Maps by visiting http://maps.google.com/?ll=35.892944,14.460829:


If on the other hand you are given a location on Google Maps and you want to record it on your GPS device, you need to extract the GPS coordinates from Google Maps. This is a very easy thing to do and all you need is to type the following javascript code in the address bar of your browser while you are still on the Google Map page:

javascript:void(prompt('',gApplication.getMap().getCenter()));

So for example, if you were to extract the GPS coordinates from the previous example, load the Google Map and enter the javascript code:

Basic Apache Rewrites

URL rewriting is a powerful technique not just for the Webmasters, but also for the SEO and Security guys. This article will give an overview towards the most common ways to implement rewrites using the Apache mod_rewrite.

A basic rewrite will look like this:

RewriteRule ^(.*?)/abc(.*) $1/def1$2 [R=301]



So for example if you try to access  http://www.r00tb0x.com/abc123/whatever you will be redirected to http://www.r00tb0x.com/def123/whatever.

The R=301 flag tells Apache that the rewrite is a Permanent (301) Redirect. Furthermore, $1 substitutes the first regex pattern, $2 the second regex pattern, and so on.

If you want to redirect specific requests made by Googlebot or Bingbot (the crawlers used to index pages on Google and Bing search engines), you can use the following code:


RewriteCond %{HTTP_USER_AGENT} .*(Googlebot|Bingbot).*
RewriteRule ^(.*?)/abc $1 [R=301]



This is useful if you want to omit specific pages from being indexed (such as administrator or user profiles). In this case if Googlebot or Bingbot try to access http://www.r00tb0x.com/abc they will be redirected back to http://www.r00tb0x.com.

Another popular use of URL rewriting is to make SEO friendly URLs. As you may know, websites in the form http://www.r00tb0x.com/?page=123456 are not ranked properly by Google as they lack keywords. A more SEO friendly URL would be http://www.r00tb0x.com/content/apache-rewrites-101 since the URL name contains keywords specific to the content of the page. In order to convert URL variables to SEO friendly names, one can use the following code:

RewriteCond %{QUERY_STRING} ^uuid=123$
RewriteRule ^(.*?) $1/123? [R=301]




This will redirect requests from http://www.r00tb0x.com/?uuid=123 to http://www.r00tb0x.com/123

Monday, November 15, 2010

Insert a repeated line in a text file with awk

System administrators, DBAs, network gurus, and perhaps developers, often feel the need to insert a particular word or phrase every 'x' number of lines in their script. For example a DBA might have a list of insert statements and needs to place a commit line every ten lines. This would be quite a burden to do it manually for a large script. Worry not! With awk you can easily do it like this:


awk 'ORS=NR%10?"\n":"\ncommit;\n"' db_patch.sql


This example will insert the text commit; every ten lines for the document db_patch.sql. More awk examples will follow on our website.

Find recent large files in Unix

One morning you log into a Unix server and find that one of the disk partitions is filled up. You wonder why, or perhaps, what caused it to fill up recently? The answer to this question is just a piece of cake.

Fire up Bash or your favorite shell and enter the following in the terminal:

find /home/r00tb0x/ -type f -mtime -2 -exec ls -ltrh "{}" ";"

This tells Unix to find all files (nodes of type 'f') which have been modified (created or appended to) in the last couple of days. The output will be sorted in chronological order with human readable format of the size field.

Similarly you can find old files by giving the mtime argument a positive value.

Tuesday, November 02, 2010

Syntax Highlighting + CKEditor in Drupal

This article is aimed for those users who use CKEditor to update their Drupal powered website. If you include lots of code snippets or program listings in your articles, then you might consider reading this post to improve the reader's experience.


I recommend the module Syntax Highlighter which can be downloaded from Drupal. This will enable you to format code similar to the screenshot, and has syntax highlighting capabilities supporting a multitude of different programming languages!

Once you install this module by putting it in Drupal's modules directory, you will need to install a plugin which enables you to use the Syntax Highlighting module with CKEditor. This plugin can be downloaded from here and to install you simply need to extract the source directory (located in the downloaded archive) inside modules/ckeditor/ckeditor/plugins. Next step is to configure the plugin. Open up the file modules/ckeditor/ckeditor.config.js and add the following lines of code:

config.extraPlugins += (config.extraPlugins ? 
',syntaxhighlight' : 'syntaxhighlight' );
 
config.toolbar_DrupalFull = [
  ['Source'],
  ...
  ['DrupalBreak', 'DrupalPageBreak','Code']
];

The first part of the code enables the module, while the second part adds the Syntax Highlighting button.
In theory this should work and you are ready to use this feature, but in practice most users either don't have the button or else no code formatting takes place. Therefore, make sure you read these
two important steps:

1. Make sure that you are using the DrupalFull toolbar (not the Basic or the Full). To enable go to admin/settings/ckeditor/edit/Advanced and change the settings as follows:
2. Make sure that you are using the FullHTML input format filter and not the FilteredHTML filter. To enable go to admin/settings/filters and change the settings as follows:

How to take screenshot in Macbook

Whether taking a shot of the entire screen or just a screenshot of an area, is a fairly easy task to do on a Macbook. Unlike in Windows, the screenshot is directly saved to disk rather than in memory...

To take a shot of the entire screen simply press the Command + Shift + 3 Keys. To take a shot of a rectangular area simply press the Command + Shift + 4 keys and adjust the size and location of the highlighted area by dragging the cursor.

Sunday, October 17, 2010

Make an incredibly fast Linux Desktop with Fluxbox

There are a lot of Linuxers out there who make use of lightweight window managers due to the benefit of having a customized and lightning fast Desktop environment yielding productivity on a cheap machine. Fluxbox is this kind of window manager and has been r00tb0x's favorite for a long time.

This article will not cover a detailed installation of fluxbox as it is a fairly easy process if you have a decent package manager such as apt-get:

apt-get install fluxbox

After installation, reboot the machine and choose Fluxbox as your default window manager. If you have problems installing Fluxbox you can just visit the official website. Once you are inside Fluxbox you might get lost. So the following are configuration tips to maximize your environment:


Changing the background:
This task is not a right click on the desktop, select background, and save the settings. You would need to execute the following command from terminal:

fsetbg -f /path/to/wallpaper.jpg

Keyboard Shortcuts:
The default Fluxbox is not very usable. To launch an application you need to click on the desktop and select the application from a little context menu (TWM lookalike) which is very unpractical. However when you assign keyboard shortcuts, Fluxbox becomes an efficient monster. The ones defined by default are the F1 to F12 keys and are assigned to change the workspace. While switching workspace is a common task, there are other important shortcuts to define such as minimizing and closing windows and launching applications. All the key bindings are defined inside ~/.fluxbox/keys file. Note that Mod1 refers to 'alt' and Mod4 refers to the windows key.

As a tip, you can define most of shortcuts through the Mod4 key so they do not interfere with the inbuilt applications' shortcut keys. This is an extract of a configuration file which was used by one of the authors at r00tb0x, and which you can easily adapt to your desktop as you wish:

# locks X11 display to the current user
Mod4 l :ExecCommand xscreensaver-command --lock
 
# opens a number of programs with quickkeys. These are just examples, I am sure
# you get the point...
Mod4 f :ExecCommand firefox
Mod4 e :ExecCommand firefox <a href="http://gmail.google.com" title="http://gmail.google.com">http://gmail.google.com</a>
Mod4 i :ExecCommand aterm -name aterm -sl 3000 -tr +sb -sr -sk -bg black -fg white -fade 90 -bl -tn xterm -fn -misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859
-15 -g 116x57 -e /usr/bin/irssi
Mod4 g :ExecCommand gaim
Mod4 u :ExecCommand amule
Mod4 m :ExecCommand gmplayer <a href="http://wm.smgradio.com/vruk_vc_hi" title="http://wm.smgradio.com/vruk_vc_hi">http://wm.smgradio.com/vruk_vc_hi</a>
Mod4 v :ExecCommand vmware
Mod4 Print :ExecCommand gnome-screenshot
 
# This launches fbrun, which in turn launches other programs
Mod4 r :ExecCommand fbrun
 
# Program Control. It just makes life simpler...
Mod4 4 :Close
Mod4 q :Minimize
Mod4 w :Deiconify All OriginQuiet
 
# if you have aterm (emerge x11-terms/aterm), then this opens a really nice
# transparent aterm with no borders, fitting nicely with 1024x768
# resolution, while still leaving room for conky. Once again, feel free to
# modify.
Mod4 a :ExecCommand aterm -name aterm -sl 3000 -tr +sb -sr -sk -bg black -fg \
white -fade 90 -bl -tn xterm -fn \
-misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-15 -g 116x57
 
# Fluxbox has no sound control, so we need to do a hack to get one
# Modify Sound
Mod4 F11 :ExecCommand aumix -v -3
Mod4 F12 :ExecCommand aumix -v +3
 
# Reconfigure Fluxbox
Control Mod4 Delete :Reconfigure

This is a very powerful configuration and will maximise your productivity - We guarantee you that with these shortcuts you will not use the mouse for a while, and it is only a little portion of what you can define in Fluxbox. Note that in the last part of the configuration we are also including the possibility of changing the sound volume through keyboard as well - you just need to install aumix, which is a command line mixer but takes arguments so volume is altered on the fly.
Startup Programs:
You might need to execute a bunch of commands when you start fluxbox, such as setting the desktop, or launching some scripts. You can make all these configurations inside the ~/.fluxbox/startup file. Just add entries to that file and next time you boot into fluxbox, they are executed on startup. This is an extract of our startup file:

# Define background:
fbsetbg -f /home/r00tb0x/wallpapers/43492-escher.jpg
 
# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
gnome-settings-daemon&
gkrellm&
amule&
fetchmail -d 60&

Save Window positions:
One of the most things I enjoy in fluxbox is the possibility to save window sizes, positions, and workspace locations. This is a feature which one cannot find in other environments such as Gnome or KDE. This is ideal if you want to launch certain applications in the same workspace so that your default workspace will not be cluttered. Again, this is another reason why Fluxbox increases your efficiency and productivity.

To save the window position, just right click on the window and select Save Window Position from the context menu.

One word of advise...Make yourself a favor a get used to Fluxbox for a couple of days before you give up and return to your old overbloated windows manager.

Friday, October 01, 2010

Setting up a Linux box as a router

If you have a virtual machine in a Linux host which requires Internet and physical LAN connectivity, or you just need to pass all traffic of a LAN through a Linux machine, you may need to set up Linux as a router.

Prerequisites:
Enable IP forwarding on the Linux box
Create a NAT rule to masquerade the IP

A virtual private IP must be configured on the Linux machine:

ifconfig eth0:1 192.168.1.1


This will serve as the gateway address for the other machines in the network (or of the virtual machine). In this case the other machines must have an IP in the form of 192.168.1.x. IP forwarding must be enabled:

echo 1 > /proc/sys/net/ipv4/ip_forward


Then we need to create the NAT rule to masquerade the private IP into a public one:

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE

That's it! Remember that for the other machines you must set the gateway IP as 192.168.1.1. You might also need to enter the DNS details (you can easily obtain it from dig [your ISP]. To list all the NAT rules:
iptables -t nat -L

To delete the NAT rule:
iptables -t nat -L

If you need to access your windows share, you can use smbclient as follows:
smbclient -U r00tb0x_user //192.168.1.2/public
smb: \] dir
file1.txt
file2.txt

Note that you can do all the FTP stuff here..If you want to list shares available on a windows host:
smbclient -U r00tb0x_user -L //192.168.1.2/
If you want to mount a SAMBA share on your filesystem:
mount -t smbfs -o username=r00tb0x_user //192.168.1.2/public /mount/point

Saturday, September 11, 2010

Unlocking iPhone 3GS

This article explains how to unlock an iPhone 3GS with firmware version 4.0.1. This technique is ideal for those users who have not stored the SHSH blobs before upgrading to this version. The whole process is easy, because we made the homework for you, however make sure that you have read all the content of this article before attempting the unlocking process.

Prerequisites:
  • PhoneBook SIM card
  • Wi-Fi and Internet connectivity
Activating:

If after you insert a SIM card you get locked into a 'Connect to iTunes' screen, then your iPhone is locked to a particular carrier and you need to activate the phone before you are even able to access the main menu.


This can be done by using a PhoneBook SIM (which you can purchase from eBay for less than $10). This is essentially a blank SIM and is able to activate any iPhone and get past the locked emergency screen.

Once inside the main menu go to settings and switch on the following options:

Airplane Mode
Wi-Fi

Jailbreaking:

Jailbreaking is the process which allows a user to install any application on iPhone - including the ones not approved by Apple, such as that application which we'll use later on to unlock the iPhone.

To jailbreak simply open the iPhone Safari browser and visit jailbreakme.com. Just follow the onscreen instructions and the entire jailbreaking process should complete in less than 15 minutes after which you need to reboot the iPhone. This process will also install an application called Cydia which is used to retrieve and install applications not approved by Apple.

Unlocking:

Open up the Cydia application and select Manage-->Sources-->Edit-->Add and add the following repository: repo666.ultrasnow.com

This is the server hosting the unlocking program ultrasn0w. Let Cydia do the magic for you and install ultrasn0w.

Now you are able to use any SIM card and install any application on iPhone 3GS 4.0.1.

Update: Some users have reported that there are some types of SIM cards which are not unlocked by ultrasn0w using the above steps, resulting in the following error message - 'Different SIM Detected' after they swap the PhoneBook SIM with their carrier one.

Wednesday, February 10, 2010

Using mp3 as a ringtone for iPhone

By default you cannot use an MP3 as a ringtone on iPhone. Apple wants you to purchase ringtones even if you own the MP3. However, there is a way around that!

Open up iTunes and right click on the MP3 you want to use as a ringtone. Select Get Info and go to the Options tab. Choose a reasonable length for the ringtone by setting the Stop Time, otherwise iTunes will complain later on, and then click OK.

Now right click again on the MP3 and choose Create AAC Version. You will notice that iTunes created another MP3 with the duration you have set earlier. Now just drag this MP3 to your Desktop and rename its extension from .m4a to .m4r.

You are nearly ready! Open up the dragged .m4r file and it will be automatically added to iTunes in the Ringtones section. Now just sync with your iPhone and you are ready to use it as a ringtone!

Sunday, January 10, 2010

Linux keyboard flashing at new e-mails

If you are a Linux user who reads e-mails through the command line, you might try out this free simple mod to make your keyboard LEDs flash whenever a new e-mail arrives.

This can be done by using a tool called ixbiff which is Linux specific. You can download it from the official website. The installation is quite straightforward and the only configuration required is to define the mailbox to monitor and which LED to assign it to when a new e-mail arrives. The configuration file is /etc/ixbiff.conf. Since a standard keyboard has 3 LEDs, it is only trivial that you can only monitor three mailboxes at the same time.

So let's assume that there are three Linux users in a machine: user1, user2, and user3. If each user has a mailbox defined in /var/mail, then /etc/ixbiff.conf can be defined as follows:


# Blink Num Lock when user1 has new mail
led1 = /var/mail/user1
 
# Blink Caps Lock when user2 has new mail
led2 = /var/mail/user2
 
# Blink Scroll Lock when user3 has new mail
led3 = /var/mail/user3

Similarly, one can assign one single LED for all mailboxes by using the following configuration:


# Blink Num Lock when any mailbox has new mail
led1 = /var/mail/