So, I wanted to host a small project made in web.py on my current server. I am running lighttpd as my HTTP server.

The process to set it up is pretty straight forward as explained in the webpy documentation.

I am writing this how-to to cover a couple of things which I didn’t find well documented and had to search around a lot to find

  • To get web.py running with lighttpd and fastcgi you need to install the package flup. In debian it is known as python-flup.
  • On this server, I run php based sites as well so I had to setup fastcgi for both. Here’s what the code looks like:
fastcgi.server = ( ".php" => (( 
"bin-path" => "/usr/bin/php5-cgi", 
"socket" => "/tmp/php.socket",
"max-procs" => 1,
"bin-environment" => (
 "PHP_FCGI_CHILDREN" => "4",
 "PHP_FCGI_MAX_REQUESTS" => "1000"
)
)),
"/code.py" => ((
"socket" => "/tmp/fastcgi.socket",
"bin-path" => "/path-to/webpy-app/code.py",
"max-procs" => 1,
"bin-environment" => (
 "REAL_SCRIPT_NAME" => ""
),
"check-local" => "disable"
))
)
  • To use web sockets instead of unix sockets change
"socket" => "/tmp/fastcgi.socket",
to
"host" => "127.0.0.1",
"port" => "8081",

 

 

 

After getting my new HDD couple of days back, I decided to install Arch Linux on it. The idea with Arch is to sufficiently control what goes into my system but without too much management overhead unlike in Gentoo. Thus, I installed stated with Core install of Arch and added fluxbox over it as my default WM(I am not running any DM as of now, but might go with qingy). Thus, I have tried to avoid any GNOME or KDE libraries and do as much via minimal system as possible.

Since I disconnected my broadband a few months back, I have been living on Mobile Internet connectivity. So far I had been tethering my phone to the wifi router and then using LAN cable to connect to the PC. Horrible way to go, I agree! To simplify matters I got a USB GSM modem. It was as easy as pie to set up the connection on Ubuntu using Network Manager but with Arch, I decided not to go for nm-applet but manage it via CLI.

First I setup NetworkManager as instructed on the Arch Wiki and I got Wired Connection working in no time. The most important tool at this juncture was nmcli. I checked

nmcli dev

and it showed that gsm modem is being detected. But, on checking

nmcli con

It only showed the wired ethernet connection. Going through the man pages and googling for hints didn’t help at all. I finally turned to #nm IRC channel on Freenode.

Thanks to some excellent support, I was connected using the GSM Modem in no time.

Here’s the quick rundown

  1. Create a new file in /etc/NetworkManager/system-connections and as per the sample file. PS: You can generate uuid using uuidgen or input any random UUID as long it isn’t in use elsewhere in your system.
  2. Now, chmod the file to 0600.
  3. Restart NetworkManager
  4. Voila! What have we here. I could now see the new connection in the list.

Now to get connected to the new connection. First we disconnect the Wired connection

nmcli dev disconnect iface <iface name>

And then connect to the new interface

nmcli con up id <connection id>

For those using MTNL Mumbai, you can use my settings

[connection]
id=MTNL
uuid=15d742f1-2b5a-421e-9f27-fcb1fc26d72c
type=gsm
autoconnect=true

[ipv4]
method=auto

[gsm]
number=*99#
username=mtnl
password=mtnl123
apn=gprsppsmum

[serial]
baud=115200

 

 

 

 

The Problem

With each passing day, the traffic situation in Mumbai is worsening. Big traffic jams, accicents, parking woes, etc. Various solutions have been proposed to combat this problem.

Here's a slightly outdated statistical information on the traffic growth in Mumbai from 2005 to 2008. An annualised growth of 12%! That was 1.5 years ago, it has worsened further now.

""

This problem has been widely debated and discussed topic everywhere. I had the opportunity to be a part of it on two occasions, once on twitter and once during Raxit's session at BCM6. This prompted me to express my views on the topic on this blog.

Many solutions have been proposed to solve our traffic problems – promote public transport, improved road conditions, car pooling, levying of taxes in certain zones, allowing different vehicles on odd and even numbered days.

Preferred Solution

Public transport is the most viable solution, according to me. I am basing this on certain assumptions

  • Only road transport is covered
  • The scenario described is that of Mumbai, it may or may not apply to other places

Reasons

  1. Less Congestion: Mass means of transport like buses and trains can carry higher number of passengers in lesser space compared to vehicles like cars and bikes.
  2. Reusability: Once a person reaches their destination, the same space can be taken up by somebody else. Thus, there's resusability of the same space. In case of private vehicles the space lies vacant till used again.
  3. Space Saving: Since public transport is reusable, we need a lower number of public transport vehicles. Also, that mass means of transport can fit in more people per area. This leads to saving of space for parking and while plying the vehicles on the road.
  4. Flexibility of Timing: As compared to other options like car pooling, public transport is much more flexible with respect to time. Trains are much faster over longer distances, over shorter distances cabs and autorickshaws can take you to your destination as quickly.
  5. Lower Total Cost: Mass transport options like buses and trains are cheaper to travel. Though, cabs and rickshaws may sound expensive, when considered with option of sharing it becomes cheaper. Add to that, the cost of maintenance is to be borne by the vehicle owner unlike public transport.

My Story

But, there are reasons why I use public transport lesser:

  • Is much less fun unless when travelling in a big group over longer distances.
  • Going out and exploring some nice places is better done in your cycle, bike, car as compared to public transport
  • Going out biking with a group of friends once in a while is a must.
  • Trains and buses are too crowded, which makes me choose my 2 wheeler over those.
  • Still, I tend to balance between using public transport and my bicycle (now that my bike is stolen), though I tend much more heavily towards my bicycle.

 

BarCampMumbai is back with it's 5th edition and a brand new venue.

"BCM5

Date: – 1st February 2009
Time: – 10:00 a.m to 5:00 p.m.
Venue: – VJTI College, H.R. Mahajani Marg, Matunga, Mumbai.

BarCampMumbai will be held in VJTI college during their technical festival Technovanza. Unlike, the previous BarCampMumbai, this one will be a one day event but it will be preceeded by BotCampMumbai on the previous day to appeal to robotics enthusiasts.

Some important links regarding BCM5
How to get there – http://barcampmumbai.org/BCM5_Venue
Register your session – http://barcampmumbai.org/BCM5_Sessions
Register as a volunteer – http://barcampmumbai.org/BCM5_Volunteers
Register for attending – http://barcampmumbai.org/BCM5_Register
Facebook page for the event – http://www.facebook.com/event.php?eid=45216741177
Link your blog/photos here – http://barcampmumbai.org/BCM5_Online#Photos
Follow on twitter – http://twitter.com/barcampmumbai
Mailing List – http://groups.google.com/group//barcampmumbai2
BarCamp Blog – http://blog.barcampmumbai.org/

See you at the BarCampMumbai.

 

 

Heh! Please don’t mistake me for one of those LHC guys. No, I am not talking about planets as in heavenly bodies which reflect lights from the stars but have give out no light on their own. I am talking about planet as in a feed aggregator.

Firstly, planet is a web based feed aggregator software developed in python. Planet was originally developed for GNOME and Debian. It can parse RSS, Atom and RDF feeds.

So, let’s get started up.

First step is to download planet software from here or checkout the latest stable bzr version from here.

Then untar the file if you downloaded the tarball.

tar -xpvf planet-xx.tar.bz2

Now untar the planet tarball and install the planet files eg.

tar -xpvf ~/planet-2.0.tar.bz2

cd ~/planet-2.0

su

./setup.py install

Now we need to configure the config.ini file in fancy directory to get started quickly. If you wanto take your time

vim examples/fancy/config.ini

Look at the file, it’s nicely commented you should have no problem at all in configuring it to your tastes, believe me. It’s too easy.

I set my output directory as

output_dir = /var/www/localhost/htdocs/planet

cp -R examples/output/* /var/www/localhost/htdocs/planet

This will place all the output files in the planet and the second command will copy the images folder and css file to the DocumentRoot so your page renders well.

Now to generate the output

./planet.py examples/fancy/config.ini

Now you can install the planey.py and planet-cache.py to /usr/bin using setup.py so that you can run it via cron

./setup.py config && ./setup.py install

crontab -e

0 * * * *   /usr/bin/planet.py /home/user/planet-2.0/examples/fancy/config.ini

Now open up your web browser and point to localhost/planet. Of course you need a web server running on localhost to try this out.

To show your image, put it in /var/www/localhost/htdocs/planet/images

Happy journey. Enjoy the feeds on your own planet!

 

No how-to from my side this time around. But a nice link I followed to setup tor and privoxy on my machine. It’s really easy to follow and straightforward.

http://www.opensourcehowto.org/how-to/privoxy/setup-tor–privoxy-for-anonymous-searching.html

Probably I will write a how-to on customising privoxy to block ads, unwanted url’s, redirect machines on the network to use tor and privoxy using firewall rules.

 

Today on ##linux-india at irc.freenode.net people were discussing about DNS and the recent DNS security issue and it’s implications and solutions. So, I decided to try out the test for my ISP’s nameservers, the default nameservers that I use. The test can be found on Kaminsky’s Website.

The test confirmed that my ISP’s nameservers aren’t patched, so I decided to finally configure my dnsmasq finally and again use local DNS servers. But, the dnsmasq configuration is too lengthy and complicated for this purpose. It’s a great software if you want to have a lot of function like tftp boot, dhcp and such. But, in my case I just need a caching DNS server so decided it was either bind which I always use or try maradns, as suggested by someone on the channel.

Since, I have gone with bind in the past I decided to go with maradns, which I heard is easy to configure and is supposedly as secure as djbdns. So maradns it was. I downloaded the latest release from their download page as no binaries are available in arch repos.

So, let’s start with the process, now that you’ve downloaded the binary. This will work, only for linux. Please check the README files and documentation for further details and different platforms.

First untar the downloaded file, in my case the tar.bz2 file

tar xjvf maradns-1.3.07.08.tar.bz2

cd maradns-1.3.07.08

Then run

./configure

make

Now, your binaries have been created and you’re ready to test out the DNS server

Note:-You need to be root henceforth

mv server/maradns /usr/local/sbin

mv tools/duende /usr/local/sbin

mkdir /etc/maradns

touch /etc/mararc

Now open the /etc/mararc file in your favourite text editor and add the following

ipv4_bind_addresses = “127.0.0.1″
chroot_dir = “/etc/maradns”
recursive_acl = “127.0.0.1″

Now start maradns

/usr/local/sbin/maradns

Then test it

dig @127.0.0.1 example.com

If it returns a reply, you’re good to go :) If not, post the errors I will be glad to help out.

Now, try running it in daemon mode

killall maradns

/usr/local/sbin/duedne /usr/local/sbin/maradns

If all is fine till here then we can proceed to actually install maradns.

First cd to the maradns directory, where the source is place then run

make install

Now, we need to add /usr/local/sbin and /usr/local/bin to our PATH variable

add the following to your bashrc

export PATH=$PATH:/usr/local/sbin/:/usr/local/bin

That’s it, you’re done! Your server is ready to run.

TODO :- Find init scripts for starting it at boot time. My distro is arch. If anyone can supply me one I will be thankful.

PS :-

If you want the server to listen to multiple IP’s add them in a comma separated list inside the quotes for ipv4_bind_addresses. Check http://www.maradns.org/tutorial/recursive.html

Lots of nice stuff can be found at http://www.maradns.org/tutorial/tutorial.html

 

I was sitting at night browsing some friend’s blogs and adding RSS feeds to Akregator, after my new found fondness for KDE 4(more on that in a later post). Then Gaurish Sharma asked how to get webcam and fingerprint scanner to work on linux. I didn’t really have much clue but asked him to dig around with /var/log/dmesg and /var/log/messages to get more info on the webcam to start with. While he was looking around, I decided to dig up my own webcam from the closet.

I connected the webcam to the PC just to see a bunch of errors being spewed out by /var/log/messages. Then I installed gspcav1 kernel module and loaded it

pacman -S gspcav1

modprobe gspca

Still, no go. I still got errors on reconnecting the webcam. Then, I peeked around the Arch Linux wiki and found some other drivers that may be needed by device. Then ran

lsusb

It showed up a microdia webcam but still /var/log/messages spewed out errors. Then I went for verbose option of lsusb to see if there’s anything worthwhile.

Here’s the lsusb -v output for those interested

Still nothing. :(

Then I decided to remove bluetooth from the other port and insert the webcam there. And voila! there it works. The webcam was detected, no errors this time and the required device was created.

Now, to test if it works or not. I tried kopete but alas! it doesn’t support all the webcams and mine is in one of those unsupported ones. I started looking at other apps which support more webcams. I started with cheese and ekiga but both looked to install evolution-data-server, why would I want that? Then I installed skype

pacman -S skype

Then add the user to video group and execute

chown :video /dev/video0

Now, logout and log back in for group settings to take effect. Then I ran skype.

Hurray! My webcam worked! Though the picture was hardly visible, I would place the blame on the webcam rather since it hasn’t been used in years now and it has always been throwing out grainy pictures since the beginning.

 

What is qingy?

Here’s the quote from qingy developers Quote:
qingy is a replacement for getty. Written in C, it uses DirectFB to provide a fast, nice GUI without the overhead of the X Windows System. It allows the user to log in and start the session of his choice (text console, gnome, kde, wmaker, …).

Source :- http://qingy.sourceforge.net

Features:-

  • It works
  • It remembers last user who logged in, with focus on password
  • It also rememebers last session each user chose
  • Alternatively it remembers last session on a per-tty basis
  • Fully themable
  • A theme will look the same on all machines, independently of the resolution
  • You can select your favourite theme, or a random one every time
  • Both text and X sessions are supported
  • You can start more that one X session at once
  • You can even start X inside a console when X sessions are already running
  • PAM support
  • Support for screen savers
  • Auto log-in support
  • Session locking support
  • Session timeout, with lock or logout as available actions
  • tty specific options support
  • Customizable key bindings
  • Text mode support

I came across qingy while browsing gentoo-wiki

Here is the gentoo-wiki qingy guide

© 2012 Sneek-A-PeekSuffusion theme by Sayontan Sinha

Switch to our mobile site