How to use your Android phone as a pc
So for anyone who doesn't know, the Samsung Galaxy SII is quite possibly the world's sexiest phone.
I'm in love with Android, and wouldn't have it any other way.
I'm also a big proponent of mobile devices in general and believe they will supersede personal computers in the next 5 or so years.
To test my theory of how relevant this was, I used only my phone at home for 3 months. No PC or laptops.
The result was... interesting. I was amazed at how much I could do, but my battery hated me.
It now only lasts about 60% of what it used to brand new. This was quite easy to fix as I just bought a few new ones.
But the critical part of how I was able to do this was the use of a few clever gadgets. The crux of which is a new standard called MHL.
It allows you to link your phone to your TV via a small cable which also has an adapter for the charger.

With this little connector, you can blow your phone screen on to any size TV over HDMI, and watch full 1080p videos on it. It is thus also your entertainment centre... in your pocket.
I also acquired a Bluetooth keyboard and mouse which worked perfectly with the phone.
You have many choices for the keyboard including an apple keyboard, the fabulous Logitech Dinovo mini or various other ones from ebay.
For the mouse, I chose a Logitech V470, but any Bluetooth mouse would have done fine.
This allowed me to play music, write documents, surf the web, and do pretty much anything I would normally do on a PC. Since Android also has support for flash, all websites render just fine on the device.
This opens some interesting doors for the future, and I'm very excited. Imagine having all your files in the cloud ready to be downloaded over high speed 4G internet anywhere you are. When you get to work, you plug your phone into your monitor and you are ready to go. Get home, plug it into your TV and watch a movie in 1080p, browse the net, and catch up with some friends. All your computing needs in the palm of your hand. We are so close. I can't wait.
First gen Macbook Air weak link
Just spent a large part of tonight trying to figure out why my macbook air had spotty wifi connection... it was driving me insane!
I finally tore it up and found two wires broken from the hinge body of the air. Manually joining the b0rked wire changed wifi condition from 50% packet drops to 900 kb/s rsync. Anybody know why the wifi wires are so thin? I'm thinking of soldering it back, but i'm worried about the thinness of the connections. Is there a better way?
Update: I soldiered it two lines today and full wireless strength now w00t!
New headphones!
After a 6 hour research marathon, I finally decided to plonk down for a pair of Etymotic Research hf2.
I've now had them for a good week and have tried every pair of the 4 different buds that come with it.
I went in knowing that it would be bass light, but great clarity on the high/mid end. But my logic was that if I want more bass, I can simply equalise it in.
So.... not quite.
The good news is, it has utterly phenomenal clarity. Every breath, every word is "crisp" as ice. And the noise isolation is absolutely incredible.
I've used the ER's signature triple flange before so I'm very used to the incredible vacuum seal/noise isolation it creates.
You will hear nothing of the outside world.... Seriously. Someone could be shouting in your face and you'll see their mouth moving, but no sound.
Now to the flaw in my super plan. The bass is... lacking. There, I said it.
The first thing you see when you open the pack is this "warning! you must create a seal for bass"... which, I've clearly got, since pulling them out feels like I'm bringing a bit of my eardrums with it.
But what about EQ?? Just pump up the lows you bass head!
Well, I did, and to my dread I got mud. The lows go muddy as soon as you bump it up beyond about 10-15%. These were clearly not able to reproduce the lows at a significant level.
I triple checked this by comparing the sound to my ageing PX100 and my Grados.
The result was that both of them produced the bass perfectly even with the lows jacked to the heavens.
To be honest, this was my own fault. I tried to have my cake and eat it too. There was simply no way a single driver in-ears was going to reproduce both crisp highs and deep lows. Something had to give.
So would I recommend them? Yes, somewhat. I'm still well within my refund period, but I'm definitely going to keep them.
They are great for most songs and for audiobooks/podcasts, especially on the train.
But I'll be using something else if I want alot of bass.... maybe I'll go try a pair of Shures.
TL;DR - Fantastic highs/mids, excellent noise isolation, poor/muddy lows. 8/10
Deployment strategy and symbolic links
Here's a quick neat idea involving using symbolic links on a production environment.
A most basic deployment strategy usually involves taking your site down, upgrading your database/files either manually or through svn.
Some more sophisticated strategies may involve tools such as phing (for php).
But there can be some problems, most of all the fact that the site might have to be down while maintenance is going on.
A better way to do this is to have your production environment sit on a symbolic link.
You can then deploy the new version to an entirely new directory and test it to make sure everything is fine, and then instantly switch the symbolic link to the new version when you are ready to release it.
If the flak hits the fan and you need to revert back, simply point the sym-link back to the original directory.
For example, lets say your site is currently on version 1.4, and you are upgrading to 1.5. The files might be here
/var/sites/mysite/version1.4/
Now copy everything from the above directory into:
/var/sites/mysite/version1.5/
Do your normal release strategy on this new directory.
Your symbolic link might looks something like:
/var/www/vhosts/mysite.com -> /var/sites/mysite/version1.4
/var/www/vhosts/staging.mysite.com -> /var/sites/mysite/version1.5
Once you are happy to do the switch, simply point the link to the same place as your staging environment
/var/www/vhosts/mysite.com -> /var/sites/mysite/version1.5
Just doing this is great for mostly read only content and no database changes.
Next up I'll write up something which deals with database changes and how to have a site that never goes down, even when complicated maintenance is required.
Simple host-based firewall Ubuntu style
Tired of pesky port scans? Just want to deploy a firewall for the heck of it? Like that added layer of protection? Whatever your reason lets do a simple one. Here a version where it includes a persistent ruleset and integration with your Ubuntu startup.
For me personally I tend to deploy iptables firewall for simple host-based firewall, e.g. just blocking stuff and making sure no one tries too many things on your server. For something more complicated I prefer to use shorewall (thats another write up for another day :)
Show me the bacon
New Script: /etc/init.d/firewall (something simple for start stop and reload)
This is a pretty simple script all it needs to run is the actual firewall rules in "/etc/default/firewall".
#! /bin/sh
### BEGIN INIT INFO
# Provides: Firewall
# Required-Start: $network
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start/stop Firewall
### END INIT INFO
test -r /etc/default/firewall || exit 0
case "$1" in
start)
echo -n "Starting Firewall Services"
/sbin/iptables-restore < /etc/default/firewall
;;
stop)
echo -n "Stopping Clearing Firewall Rules"
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -t nat -F
/sbin/iptables -t nat -X
/sbin/iptables -t mangle -F
/sbin/iptables -t mangle -X
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
;;
restart|reload)
echo -n "Restarting Firewall Services"
/sbin/iptables-restore < /etc/default/firewall
;;
*)
echo "Usage: /etc/init.d/firewall {start|stop|restart|reload}"
exit 1
esac
echo
exit 0
The actual firewall rules, this one is up to you but here's a simple version allowing only DNS and WEB traffic on the inbound and everything on the outbound. Store it under "/etc/default/firewall"
# Generated by iptables-save on Mon Feb 7 19:05:46 2011
*nat
:PREROUTING ACCEPT [2:307]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Mon Feb 7 19:05:46 2011
# Generated by iptables-save on Mon Feb 7 19:05:46 2011
*mangle
:PREROUTING ACCEPT [48:3929]
:INPUT ACCEPT [48:3929]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [22:2312]
:POSTROUTING ACCEPT [22:2312]
COMMIT
# Completed on Mon Feb 7 19:05:46 2011
# Generated by iptables-save on Mon Feb 7 19:05:46 2011
*filter
:INPUT DROP [2:513]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:FILTER - [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -p icmp -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i eth0 -p tcp -m multiport --dports 80,443 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -o eth0 -j ACCEPT
COMMIT
# Completed on Mon Feb 7 19:05:46 2011
Now apply the varnish
# Make it executable
chmod +x /etc/init.d/firewall
# Add it to the startup levels
sudo update-rc.d firewall defaults
Kick the tire
# If you are at the console and aren't afraid of your firewall rules locking you out
sudo /etc/init.d/firewall reload
sudo iptables -L -n # check that its loaded
# If you are over a ssh session and you are afraid of being dropped, this way you only get dropped for 10 seconds if you stuff up :)
screen
sudo /etc/init.d/firewall reload && sleep 10 && sudo /etc/init.d/firewall stop
Reverse DNS wall using DJBDNS
Another DNS post yay! Out of all aspects of DNS services this one is used least. So whats a reverse DNS wall? You know reverse DNS? thats where you look up an IP address and get the name associated as opposed to the other way round.
Now "some" special needs servers on the internet (FTP, SSH) like to do a reverse resolve of the incoming IP and block based upon the result. Some even rarer server would then would do a A record check on the reverse to make sure that matches the originating IP.
Lets say I have a whole bunch of computers that don't have DNS names, not now, not ever, how do they connect to these pesky services? Tell the service provide to stop be daft! Once you recover from the slap they gave you then setup our own reverse DNS wall. When queried these things will respond with the good stuff and take you to the promise land!
# Install
apt-get install daemontools daemontools-run ucspi-tcp djbdns
adduser --no-create-home --disabled-login --shell /bin/false walldns
# Config
walldns-conf walldns dnslog /etc/walldns 1.2.3.4
mkdir /etc/service ; cd /etc/service ; ln -sf /etc/walldns/
# Start and Test
initctl start svscan
# Checking status
svstat /etc/service/walldns
# Shutting down
svc -d /etc/service/walldns
# Starting up
svc -u /etc/service/walldns
Now get the upstream hosters of your IP address delegate the reverse zone to your server and you are good to go.
Useful Chrome Extensions
I thought I jot down a whole bunch of awesome chrome extensions which has made my life easy:
AdBlock - The grand daddy of all extensions :)
Chrome to Phone - If you have an Android phone this is a easy and painless way to send a link direct to your Android's browser
Instapaper - For those of you who read Instapaper, this takes all the hassle out of adding pages
1Password - Install this one through your 1Password's settings. This is a life saver, a single place for all my passwords and secret information, one click login to any website.
Official Facebook Extension - Enough said.
Ultimate Chrome Flag - I stumbled across this extension and boy is it a gem! It tells you lots of useful information about the website you are currently visiting like country, IP address, Google page rank, geo location and trust rating.
IP Address Information - Great extension for those of us that are interested in a bit of networking. Everything you want, DNS, Reverse DNS, ASN, Spam block lists you name it its just plain awesome.
Screen Capture (by Google) - take all those shiney pics of whats inside your tabs
Google Tasks (by Google) - Nice embedded way to access your tasks that sits with Google Calendar.
Google Calendar (by Google) - Nice way to see whats coming in your Google calendar. I found it a little too cumbersome and no quick way of getting to my actual calendar.
Google Calendar Checker (by Google) - Same as above but it acts as an instant jump to your calendar.
Google Translate (by Google) - If you view foreign language pages with any frequency this one will save you some hassle.
Google Share Button (by Google) - If you're a share-a-holic this is great :D
Do you have any favourite extensions? I would love to try it and put it on.












