Friday, March 4, 2011

Problem with Internet Sharing in Mac OS X

I have unofficially graduated from Republic Polytechnic and I'm here back at my hometown Hanoi. Currently, I only have wired connection at home. The router is not around and I have so many devices that I want to connect to the Internet. Luckily I have my spare Macbook (old Santa Rosa generation) which I could use to share the Internet from Ethernet. However, there was a problem with devices not being able to obtain the correct IP addresses (most probably due to DHCP). So I've managed to Google my way out from this problem. Here are some steps you have to take in order to get Internet Sharing to work:


  1. Start Internet Sharing normally
  2. Open Terminal, type: cp /etc/bootpd.plist /tmp/
  3. Stop Internet Sharing
  4. In Terminal type: sudo nano /tmp/bootpd.plist
  5. Change the last  4 to 0
  6. Save it and: sudo cp /tmp/bootpd.plist /etc/
I'll try to write a simple applescript to automate copying bootpd file from /tmp to /etc and start Internet Sharing. Come back to see the updated entry


Saturday, December 25, 2010

Some dev tips picked up during holidays

Finally got time to continue developing Push Contacts. I've gotten a nerve-wrecking problem while developing with C2DM applications. When the app supposed to get the push message, it didn't respond to it. Looking at the logs I encountered an error stack related to GTalk (with TalkProvider tag). Decided to google the problem and the solution was to sign out of GTalk on the phone.

Ok now a tip related to Google App Engine development. I just added a new feature to Push Contacts which is allowing users to reply to the latest SMS received. I had to retrieve the email of the user the bot is chatting with to find which phone number to send the SMS to. Took a look at guru.appspot.com source code and decided to use xmpp_handlers.CommandHandler. Used this method text_message(self, message) and message.sender supposed to return the sender of a message but instead it returned an IM formatted string. Here is how you can retrieve the email.

Sunday, December 12, 2010

How to get a favicon from a website

Stumbled upon a website with a nice favicon that you want to use? No worries, Google S2 will let you do that. Here is a favicon from android.com

Sunday, December 5, 2010

Fix screwed up keyboard layout on Ubuntu 9.04

Got Gnome desktop installed on TonidoPlug but when trying to vnc to it I realised the keyboard layout is messed up. This is how you fix it:

  1. Kill existing vnc session: vncserver -kill :1 (1 here is the pid)
  2. Edit with: nano /root/.vnc/xstartup
  3. Add this line: export XKL_XMODMAP_DISABLE=1
  4. Rerun vncserver

Saturday, November 27, 2010

TonidoPlug

        Yes, TonidoPlug is a new toy that I've gotten last week. It is a basically a plug computer that can act like a home server. The hardware specs are the same as SheevaPlug with 1.2GHz ARM and 512MB RAM and 512MB Flash. The best thing about it is the energy consumption ranging from 5-10 Watts.
        So what's the difference between TonidoPlug and SheevaPlug? The main and the most noticeable difference is the built-in software that TonidoPlug provides which makes it really easy to get started with. It's seriously just plug-and-play and you will get all kinds of stuffs you need: torrent (yes torrenting 24/7 is leet), music player (that allows streaming), sharing files and photos, mounting drives.
       But the problem with this is the limitation of applications you can install. What if you want to run an rsync server or install a LAMP stack? Luckily there is an open source project called PlugApps that allows users to have more flexibility. Some kind souls have compiled Arch Linux and port it to work on a SheevaPlug hardware. They named it Plugbox. SheevaPlug naturally runs on Ubuntu 9.04 but apparently Ubuntu has dropped support for ARM that's why Arch Linux would be a perfect suit.
       I'm currently trying to run Plugbox from my external hard drive that has 2 partitions but TonidoPlug doesn't seem to boot from it. I'm gonna dive deeper into this. Will update the blog once I get it to work.

Edited:
Ok, like finally I got TonidoPlug booting from external hard drive but it still runs on Tonido (Ubuntu 9.04). There's no way I can make it boot from  external hard drive with PlugBox. The problem was with reboot command, I had to make a cold boot (plug and unplug te plug) in order for the plug to boot into my Samsung G3. I've recently installed awesome stuffs like:

  • webmin (for sysadmin)
  • gitosis (for git repos)
  • mt-daapd (iTunes Server)
  • ettercap (to monitor my home network)
  • lsyncd (to synchronize files)

Sunday, September 19, 2010

A fresh update of my life

     Since the last post, I have been quite busy with assignments and a final year project. Even though there was a 3-week school break after all these, I have sacrificed it to start my new project called Android Push Contacts.

     This project makes use of the newest feature on Android 2.2 called C2DM which allows Android device to receive push messages from third party applications. Initially I was only planning to push contacts to Android phones from a Chrome Extension, however I ended up having a better idea which is sending SMS from a website. Total period of time I have spent for this project was around 2 weeks thus I was left with only 1 week to enjoy my holidays plus study for the exams.

     In the end the exams weren't that difficult as I expected. I could have performed better if I've gotten more time to prepare for it. As soon as the exams were over, I had to plan for the showcase of RP Open Source Interest Group on Software Freedom Day 2010 which was 2 days ago. Nothing interesting came into my mind so I just decided to showcase my newly-created project which is of course open sourced.

     On the actual day, there were quite a number of visitors who were interested into my project and some have even suggested additional features to be added. The event itself wasn't really that successful as I have imagined it to be like, there was no crowd, there wasn't anything interesting, I couldn't feel the open source atmosphere in the event. Luckily, two of my geek friends (Andrew, Cheng Fu) came to accompany me, I would have died due to boredom without them.

     Today, I've just created my LinkedIn profile which I wanted to do long time ago. You can check it out here. From now on I'm gonna have a really long holiday break, hope I can learn more about node.js, couchDB and Twisted. Besides IT to do list, I have also decided to get myself buffed up during this holiday, guess I gotta go gym frequently and eat some healthy food

Sunday, June 13, 2010

Simple web service with Google App Engine

     It's been a while since I last posted an entry. Nothing much has changed in my life. The two-week holiday has just passed by in a blink of an eye. Has been busy with Android assignment, Cypher IGs camp and Pycon Singapore 2010. Now after Pycon, I'm pretty much convinced about the power of simplicity of Python. Knowing Google App Engine (GAE) quite a while ago, I decided to use GAE to help me out in my assignment (yes, yes, Google to the rescue) by writing a simple GAE web service which stores/retrieves feedbacks in form of JSON. The following tutorial is simple enough for beginners to follow.