Uncategorized

Long Time No Blog

It’s been a while since I’ve blogged here. Facebook has practically made casual blogging obsolete, due to its simplicity, convenience, and ability to reach more people.

Granted that you still cannot perform full featured edits on Facebook, for the most part, sharing of links, photos and posting one-liners have been trivialized.

This, actually, is hurtful for the standard of creative writing, especially for much of the younger generation who waste most of their productive time on Facebook. What value do they add to society, other than making Facebook share holders even richer than they already (disgustingly) are?

We could leverage Facebook to enable its users to accumulate credit, monetary or otherwise, by contributing to social or commercial projects that small companies or non-profits need to to get done, but do not have the financial capacity to engage full-scale resources to undertake the work.

Some immediate examples come to mind:

  • Electronic data entry for digitizing old receipts or invoices for businesses looking to consolidate their historical customer information
  • Visual Identification and tagging of photos for image recognition, artificial intelligence and machine learning projects
  • Grading of written quizzes
  • Vetting or provision of translation services of articles

Social is a powerful force that can be leveraged in more ways than we can imagine right now. While it might not solve world hunger or promote world peace, I foresee that it might be able to get us out of the current economic doldrums that we never seem to be able to shake off.

Finance

Banks to CHARGE Interest on YOUR Deposits Soon?

http://www.bloomberg.com/news/2011-08-08/euro-crisis-may-pack-u-s-banks-with-deposits-they-can-t-deploy.html

Bank of New York Mellon Corp. (BK), the world’s largest custody bank, announced plans last week to charge institutional clients for unusually high balances above $50 million. In a letter to customers, the New York-based firm said it’s “taking steps to pass on costs incurred from sudden and significant increases in U.S. dollar deposits” linked to events including the Greek crisis and the uncertainty over the U.S. debt-ceiling debate.

Software

Publishing Mercurial Repositories with Rocket

The Mercurial wiki already covers how to serve a Mercurial repository using Apache and mod_wsgi, which take quite a number of steps ranging from downloading, compiling and installing mod_wsgi (if it is not available for your platform) to making arcane Apache configurations.

Here’s how to serve any number of Mercurial repositories using a few lines of Python code and a WSGI web server. Rocket is a WSGI server written in Python. It is the internal web server being used by the Web2Py project.

Install rocket into your Python installation with

easy_install -U rocket

or simply download the standalone script and extract it into the current directory.

Copy and paste the below segment of code into a filename of your choosing into the same directory as the rocket.py script as extracted above. You only need to change the first line containing repoconf to point to an actual file with the repository information. You only need ONE repoconf line.

repoconf = 'c:/documents and settings/user/repo.ini' # in Windows
repoconf = '/home/user/repo.cfg' # in Linux/Unix

from rocket import Rocket
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir

Rocket(
    ('127.0.0.1', 80),
    'wsgi',
    {
        "wsgi_app":hgwebdir(repoconf)
    }
).start()

Example of the repoconf file can be found in here. It is referred to as the hgweb.config file, but regardless of what the name is, it is the file path that needs to be passed to the hgwebdir() function/constructor.

As of Mercurial 1.8.2, quotes are not needed in the hgweb.config file. Spaces and backslashes in the path are also OK.

Remember these are actual strings read from a config file, not strings in Python representation!

[paths]
repo1 = /path/to/unix/location
repo2 = c:/documents and settings/username/repo # no quotes needed, spaces are OK!
repo3 = c:\documents and settings\username\repo # back slash also ok!
repo4 = "c:/documents and settings/username/repo" # with quotes => wrong!!
Software

Web Notes

There is so much good software out there! Web page annotation can be so simple, yet useful! Check out Web Notes. I’ve just started using it to highlight important points on my technical wiki. Thanks to Wikipedia for providing the links!

Computers Networking Software Uncategorized

Pycopia – Rapid Application Framework

The Pycopia project is a framework of frameworks for the rapid development of applications related to telecommunications networks, web, data processing, process control, and more.

http://www.pycopia.net/

Uncategorized

WPTouch Theme

Installed the cool WPTouch theme which automatically transforms your blog into a mobile-friendly layout. It looks really nice when browsing from a mobile browser. Don’t let the “iPhone” in the name confuse you – it works for any mobile browser (at least on my Android/WebKit).

Uncategorized

Updating DNS Entries for Linux DHCP Clients

Finally solved the mystery on how to get Linux machines registered in the local DNS server after getting a DHCP lease.

Use the nsupdate utility to inform the DNS server of the IP address. This is the simplest set of commands:

           # nsupdate
           > server 192.168.55.66
           > update add newhost.example.com 86400 A 192.168.55.99
           > send

Where 192.168.55.66 is the DNS server and 192.168.55.99 is the address acquired via DHCP.

In fact, for local LAN setups where security is not much of an issue, updates can even be sent from a central server on behalf of other hosts that do not support the update protocol.

Computers Networking

ARP manipulation in vista

When trying to clear the ARP cache in Windows Vista, the familiar

 arp -d

mysteriously throws up a “the arp entry deletion failed: 87″ error. It turns out that Windows Vista has a re-written IP stack that does not play nicely with the arp manipulation commands of old.

Saw the solution being mentioned at http://social.technet.microsoft.com/Forums/en-US/itprovistanetworking/thread/9382ced0-6575-47d6-89d7-8b1581ff60f1 which introduced the use of the

netsh interface ipv4 set neighbours

command to change/set the ARP entries.

C:\>netsh interface ipv4 set neighbors help

Usage: set neighbors [interface=] [address=]]
             [neighbor=]
             [[store=]active|persistent]

Parameters:
       Tag              Value
       interface      - Interface name or index.
       address        - Network address of neighbor.
       neighbor       - Link layer address of neighbor
       store          - One of the following values:
                        active: Address will disappear on next boot.
                        persistent: Address will be persistent.
                                    This is the default.
Example:
       set neighbors "Private" "10.1.1.1" "12-34-56-78-9a-bc"

Use

netsh interface ipv4 delete neighbors

to remove all arp entries on the system.

Software

MP4 on WordPress

Had a big struggle with getting MP4 videos encoded with ffmpeg to stream using JW Player. Should have done more reading in the first place, but the problem was an encoding option in ffmpeg – you have to specify -vcodec libx264 – and possibly apply one of the presets that came with ffmpeg.

Here’s what I used:

ffmpeg -i <input_video> -vcodec libx264 -vpre default -acodec aac -strict experimental <output>.mp4

Note: ffmpeg looks for preset files in only certain locations,

  1. ~/.ffmpeg, or
  2. Path pointed to by the FFMPEG_DATADIR environment variable.
    • E.g. On Windows: set FFMPEG_DATADIR=c:\program files\ffmpeg\share\ffmpeg (since I extracted mine to c:\program files\ffmpeg)
    • E.g. on Linux: export FFMPEG_DATADIR=/usr/local/ffmpeg/share/ffmpeg (assuming that is where the *.preset files are located)
Computers Development Networking Software

Mechanize – Non-Interactive Web Browsing

This is more of a quick note to myself, but I really have to share this…

Mechanize is a Python library for automated, non-interactive web browsing and form submission.

Other tools

Check out twill as well! It makes light work of automating web form submission.

MaxQ is a web functional testing tool