About this blog

The name of this blog is small alley. As in an alley, I hope to post a variety of things that I find interesting and as you walk through the alley, you would find things that you like.

I have posted some songs that I wrote. I am not a great singer. I sing and play the guitar purely for fun and I hope people who thinks they can't sing can be inspired by me. No former singing lessons and no former guitar training. Just pure fun......

The recording is also done at home with a drum machine and one guitar through a small amp. The sound file has been touched up slightly by removing the noise. Otherwise the songs are as original as it gets.

I practise Taiji regularly. For me, it is a great exercise requiring control of mind and body to perform well and for it to be enjoyable. You can get more videos of Taiji from YouTube.

Other posts include places and events that I think are interesting and more important, which I have time to upload.

Enjoy your walk through this small alley.....

Sunday, November 3, 2013

Random number generator

I developed an Android app RandNo2 which can generate random numbers.  I developed this to generate luck draw numbers in events.  What is so different about this app?

Here are some features:-

- Range of numbers to generate (1 - 9999)
- Can decide if numbers generated are saved
- Can omit certain numbers
- Different options to display the numbers generated
- Vary the duration of the "roll"


You can download the apk file from:-

Random Number Generator 2

To install, you may have to change the setting of your device to allow installation of applications from 3rd party sources.

Enjoy.

Wednesday, October 9, 2013

Interesting Youtube channel by Brian Johnson on various mental health issues

This channel discusses topics related to happiness, meditation, goal setting, etc.  These are topics that affect our mental health and I find his explanation clear and concise.

Saturday, September 28, 2013

Raspberry Pi as a Wifi Hotspot

My intention was actually to set up a Raspberry Pi print server for my home.  After buying the Raspberry Pi, I realised that my printer does not support the ARM architecture.  However I am discovering other interesting ways to use the Pi and using it as a WiFi hotspot is one option.

While trying to set up the hotspot, I made reference to may wonderful posts found on the Internet.  However I found that the posts do not cover everything and there are assumptions that they made which does not apply to me.  Or they have missed posting some information/knowledge that I found was crucial in setting up the hotspot.  In posting my experience, I hope to fill in some gaps and help others just as I have been helped.

I set up my Pi hotspot using Raspbian and I am going to assume that you have got this set up on your SD card.

In my setup, I have the wired Ethernet cable connect to the router provided by my ISP.  I use the Edimax EW-7318USG dongle.  It is a couple of years old but it is supported by Linux out of the box.

Note that all commands are run from a terminal window.  I also assume you know how to use the nano editor.  You also need to know a bit about how networks are defined by IPs (Get this knowledge from the Internet if you have problems in this area).

Step 1

After you start up the Pi, update your system:-

sudo apt-get update
sudo apt-get upgrade


Type:-

ifconfig -a

and ensure that you see the eth0 and wlan0 listed.  Make a note of the IP address of eth0.  For example, mine says 192.168.1.77 and this IP is assigned by the DHCP server of my router.

You need to know this as your wlan0 needs to be set up on a different network - for example 192.168.0.0.  (Please look at the numbers carefully and compare with those assigned to eth0).

If you cannot see wlan0, your wifi adapter may not be detected or supported.  Search the Internet for solutions.

Step 2

Install iw:-

sudo apt-get install iw

After the installation, run:-

iw list


You should see some thing like this:-


Supported RX frame types:
* IBSS: 0xb0 0xc0 0xd0
* managed: 0x40 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* mesh point: 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0



Note that you have "AP" and "AP/VLAN" which indicate that your wlan0 can support hotspot configuration.  If not, you may need to buy another adapter.

Step 3

Get the necessary software:-

sudo apt-get install hostapd isc-dhcp-server iptables

Step 4

Configure your network interfaces (if you are worried, make a backup of all the files before changing them):-

sudo nano /etc/network/interaces

When the editor opens, change the entries to look something like this:-


auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static
 address 192.168.0.1
 netmask 255.255.255.0

##iface wlan0 inet manual
##wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
##iface default inet dhcp

up iptables-restore < /etc/iptables.ipv4.nat



You can see that I have assigned the IP address 192.168.0.1 to my wlan0.  Remember, the wlan0 must be on a different network from eth0.

Step 5

Now you configure the DHCP server, isc-dhcp-server.

sudo nano /etc/dhcp/dhcpd.conf

Search through the file to find the location which says something like:-



default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
authoritative;


Remove the hex sign "#" so that the line containing "authoritative" looks like this:-



default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;


Next go to the bottom of the file and enter the following:-


subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.20;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}



Note that the above are my figures.  Take note of those numbers starting with "192" and change them to suit your need.  But remember they must be on the same network but different from that of eth0.

After you are done, save the file.


Next you need to link isc-dhcp-server to wlan0.  Do the following:-

 sudo nano /etc/default/isc-dhcp-server

Scroll down to INTERFACES="" and change it to say INTERFACES="wlan0"

Save the changes.


Step 6

Configure the access point - hostapd by creating the hostapd configuration file:-


sudo nano /etc/hostapd/hostapd.conf



Type the following into the empty file:-



interface=wlan0
driver=nl80211
#driver=rtl871xdrv
ssid=YourRaspberryPiRouter
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YourPiRouterPhrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP



Replace "YourRaspberryPiRouter" and "YourPiRouterPhrase" with something suitable for your case.

Note that the nl80211 driver works for me.  Your wifi adapter may use another driver.  But I recommend you try nl80211 first as the hostapd software that comes with Raspbian works with this.  If you use another driver, you may need to tweak hostapd and I do not know how to do that.

Do not put in extra space at the end of the file.  hostapd can be picky.

Once you are done, save the file.


Now we will tell hostapd where to find this configuration file:-

sudo nano /etc/default/hostapd

Find the line #DAEMON_CONF="" and edit it so it says DAEMON_CONF="/etc/hostapd/hostapd.conf"

Remember to remove the # in front of "DAEMON".

Then save the file



Step 7

You will now configure the iptables to ensure that eth0 communicates with wlan0:-

sudo nano /etc/sysctl.conf



Go to the bottom and add the following line to start IP forwarding on boot:-

 net.ipv4.ip_forward=1

Save the file.

Also run

 sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"



Run the following (3 lines) to create the rules for iptables:-


sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state ELATED,ESTABLISHED -j ACCEPT

sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT



Save the rules by typing:-

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"


Step 8


To ensure that hostapd and isc-dhcp-server start up on boot, type the following:-



sudo update-rc.d hostapd enable
sudo update-rc.d isc-dhcp-server enable




The setup is completed.  Restart Pi:-

sudo shutdown -r now


After Pi boots up, use another device (tablet, HP, computer) to scan for the hotspot.  It should show up and allow you to connect to it.


If you encounter errors, try the following:-

Run hostapd and see what error messages are displayed and correct them.

sudo /usr/sbin/hostapd /etc/hostapt/hostapd.conf


Restart isc-dhcp-server to see if it display any errors and correct them.

sudo /etc/init.d/isc-dhcp-server restart


The iptables rules can be viewed by typing:-

iptables -L


Mine shows:-



Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere          

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination



I hope the above helps.  I am not an expert but just want to share my experience.  Good luck.


Saturday, August 31, 2013

King of fruits in South East Asia

Heard of durian?  Well it is regarded as the king of fruits in South East Asia by many.  This year we have a bumper harvest.

It is an acquired taste.  Some find is repulsive but many in South East Asia likes the fruit very much.

It takes skill to select and open one.  However nowadays, most sellers are honest and they will select really good durians for you.  One of the seller allowed me to video tape his durian opening skill.  Enjoy the art form...




Sunday, July 21, 2013

Confirmation Ceremony of my son

On 21st July 2013, my youngest son was confirmed at the Our Lady of Perpetual Succour Church, Singapore.  If you are not sure what Confirmation is, you can search it on the Internet.

Basically it is one of the Sacraments where a Catholic receives the Holy Spirit to become an adult member of the church.


The picture above shows the Archbishop laying his hand on my son.



After the ceremony, we went to Werner Oven Restaurant and had German food.  May not be the best but we had a good family time - also with the god-parents of our children.


Sunday, June 23, 2013

Trip to Sikkim

Went to Sikkim with my students on 22nd Jun 2013.  Landed in Calcutta and it reminded me of the book entitled "City of Joy".

Below are some photos of Calcutta taken from outside our hotel and from our bus.















There are also new developments in Calcutta where mega malls and private housing are built.  Maybe another 4 to 5 years the area will be like a modern city.

The we flew to Bagdodra enroute by car to Sikkim.  At Bagdodra we had lunch at a mall.  Must say that I enjoyed the food. 






Below are pictures enroute to Gangtok.  It was a winding ride up the hill, above the clouds.











To go into Sikkim we need to obtain another permit. Spent about an hour there as things are done by hand.  Look at the poster carefully.  I noticed Sikkim has an interesting law that is hard to implement in Singapore.





The trip from Bagdogra to Gangtok took about 4 hours.  Gangtok is cool and the people are nice.  You'll find yourself living in and above the clouds.  Be prepared for wet conditions.









Went to a very nice shopping street of Sikkim.  It reminded me of Europe.




The video below showed the road condition.  Basically the roads are narrow.  At some parts, two cars can hardly pass each other.  Many parts of the roads also need maintenance.  The walkways along the shopping area are wider than the roads.




Also met a very talented driver for our group.  He played some great blues and we did some jamming.  I played some blues harp and that's what great about the harp - it is so portable.










Sunday, June 16, 2013

Family jamming together

Today (16th Jun 2013) jammed with my sons.  They are really wonderful (not forgetting the camera lady, my wife).  For our first session, I think it is ok.

Here are some of the videos.



After the jam, we had dinner at Stuttgart Blackforest Boutique S Cafe.  Why "S Cafe"?  According to the waitress, it is synonymous with Mercedes S-Class.  The ambience is indeed nice but they ran out of pork knuckles and cheese.  We had to settle for sausage and pasta.  Beer is good though.