Archive for category Technology

MAMP 403 issue and fix

I have been using MAMP for a while. For no apparent reason today, I got a 403 message for the start page (http://localhost:8888/MAMP/):

Forbidden

You don’t have permission to access /MAMP/ on this server.
Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2 Server at localhost Port 8888

Figured out the solution by a little search but it is useful enough to share.

1. Quit MAMP or stop servers.
2. Open /Applications/MAMP/conf/apache/httpd.conf file in vim or any text editor.
3. Find this section of code:

<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>

4. Change “AllowOverride All” to “AllowOverride None”.
5. Save the httpd.conf file.
6. Launch MAMP or start servers, then open up the start page.

It works !

1 Comment

Wordpress blog development tip

When I started this personal blog, it was a matter of a few clicks in a tool called fantastico and everything was up and running. Whatever development and style modifications I have done over the time were directly on the server. As a matter of fact, I still do.

Clearly, it is not the best idea for incremental development, not without inevitable “production downtime”. Working in a big internet company at least taught me this truth among other things. So, when I started my photoblog using pixelpost, I set everything up in my local MAMP stack and pushed the data to server one time.

joy@localhost ~ $ mysqldump -u user -ppass db > db.sql
joy@localhost ~ $ scp -C db.sql joy@server:
joy@server ~ $ mysql -u user -ppass db < db.sql

Afterwards all code pushes happen by rsync.

joy@localhost photoblog $ rsync -avz . joy@server:public_html/photoblog

This way, even though locally I have a small set of data, I can change code and test all features before doing a production push. Works very well for me. Also I check in my code in a local git repository. Double win.

I am in the middle of setting up another wordpress blog right now, and forgetting a small detail cost me a bunch of time. After getting the blog running locally, I took a mysql dump and synced it with the db in the server. It just won’t load. I mucked around here and there and figured that the blog url is set as “http://localhost:8888/newblog” in the local db. I modified the .sql file and re-synced to production and voila, it worked.

I suspect that I might need to do the db sync a few more times before I have enough volume of data to keep it growing in the server. I will probably set up a sed script to do the search-and-replace in command line.

, ,

No Comments

Speech to Text: the toughest challenge for mankind

The biggest frustration of being partly hearing impaired is the continuous tension in a conversation scenario. It is a daily struggle with failed efforts to reconstruct words and sentences out of fragments of sound. A fraction of the affected people can do lip-reading well (useless in a telephone conversation) and the ones with severe deafness has to resort to sign language which very few hearing people know (or could be bothered to learn).

We are in the age of warp-speed technology right now and this article is an attempt to figure out how today’s technology can be leveraged to provide the single most useful communication tool between the hearing world and the impaired, irrespective of medium or gadgets: The subtitles (closed captions or CC).

Imagine a handheld device with a display screen which can translate any speech to text. Any speaker, any kind of accent. But as fast as a complete sentence is spoken. This gadget alone can change the whole world. It can even be only 80% accurate and the human brain can still decipher the missing parts in a real-time conversation.

Technology in advanced countries like in the US has subtitles in TV programs which is a god-sent for the hearing impaired. For the 25 years I lived in my country, I never understood a movie or a TV show. On the first day in the US when I turned on the TV at a friend’s place, I felt like I was reborn. Movies on TV became an instant addiction for the next few years.

Closed captioning has enormously helped the hearing impaired people, but it still does nothing for the daily struggle. A major part of that is undoubtedly the use of telephone. The existing TTY technology is old, and not scalable. A recent innovation in this arena is brought by CapTel which still needs a dedicated device and plan. They even launched a web based service Web CapTel in Australia which a blogger found really great. This is a service powered by human translators, so still does not solve the fundamental problem of machines converting speech to text.

In this age of smartphones, it will be really really awesome to have a smart speech-to-text app in an handheld phone like the iPhone. Imagine being able to talk either face-to-face or on the phone while reading real-time subtitles. It would be the best app and invention for the mankind, I am petty damn sure.

1 Comment

Wordpress upgrade

A necessary upgrade of my wordpress blog was long due. And so was the default theme that looked so 2004. While the previous upgrades till 2.7 was smooth, this one (version 2.8) needed a bit of manual effort. After backing up the database and code I followed the instructions as given here: http://codex.wordpress.org/Upgrading_WordPress_Extended

The primary trick was to keep

wp-config.php

from the previous installation. The new codebase came with a

wp-config-sample.php

so there was no overwriting. After that I hunted for a cool theme and could not be happier with “Fusion”.

Wordpress rocks.

2 Comments

git rocks !

I just set up my brand new git repository at github: http://github.com/jdutta. Don’t know what took me so long to embrace git but I am glad to be ready to move out of my CVS based workflow for personal projects.

A quick look at the tutorial was all I needed to convince myself towards this change. Now I can work on my personal projects from anywhere without worrying about merge issues later on. I just published my favorite config files under repository dotfiles. Could not be an easier backup/version-control mechanism.

Some good resources to learn git:
1. http://www-cs-students.stanford.edu/~blynn/gitmagic/book.pdf
2. http://git-scm.com/documentation
3. http://www.eecs.harvard.edu/~cduan/technical/git/

1 Comment

Goldwing trunk lockout solution

Today I managed to lock myself out of my 2005 GL1800. I was in a hurry at Palo Alto airport before a flying trip to Napa valley with Vaibhav and Pooja, so I did something I never would normally do – putting my jacket in the trunk. Now I typically just pop the trunk using the key fob while the whole lock system remains locked. The moment I shut the trunk lid I realized what just happened. To add insult to injury, I also recalled that the spare key was in an inside pocket of the jacket. Darn !

My fellow CA2Q chapter winger Susie gave some suggestions but that was for a GL1500. I wished she could come for a rescue but she was at Mesquite NV on a rally. It almost looked like I had to tow the bike when as a last resort I did a google search from 3500 feet in the air. I landed on Steve Saunders goldwing forum where a neat electrical solution is outlined: GL1800 trunk lockout fix

What a relief after an awesome flight. My roomie Piyush brought a bicycle allen key set which had the 6mm hex key I needed, plus some picture hanging wire. I had to borrow an adjustable spanner from the airport fueling guy and the seat came off without much fuss. Initially I thought the red wire in the 14-pin grey connector block is the target but it didn’t work. I read through the page and found that for a 07 model the blue wire was to be connected to battery +ve to unlock the trunk. It worked !!! Very valuable lesson learnt before my long trip. I am going to keep a 6mm allen, an 11mm crescent spanner and a wire in one of the unlocked compartments.

No Comments

Efficient Software Development – Part 1

I have been meaning to write something on this topic for a while. The motivation largely comes from the experience of working in a large company and getting work done amidst a mindless number of context switches. It kind of reminds me of the term “thrashing” where the CPU spends most of the time switching between tasks than doing the tasks themselves.

Slow development is a major pain point of every developer I would imagine. To reduce stress I have setup my own environment to minimize the time it takes to reload the brain with the context of the task at hand.

At work I primarily have to develop stuff that can used/tested/mucked-with in a browser so I primarily just need a shell and browser. My work laptop is a macbookpro so I am all set with Terminal, Firefox, Safari and Thunderbird. And Adium, ofcourse.

1. Screen
Regardless of whether the terminal supports tabs or not, screen is a must-have tool to group several shell sessions together. With a nifty .screenrc and a few memorized shortcuts, it is probably better than sliced bread. Whenever I start a new project, screen -S projectname will start a screen and it will exist till the end of the project. Using different tabs on the terminal it is cool to switch between different screen sessions. Here is my .screenrc:

# .screenrc

startup_message off
escape “

hardstatus alwayslastline
hardstatus string ‘%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}'

screen 1
screen 2
screen 3
screen 4

2. Vim
I am a vim guy and I understand there is an equally strong crowd of emacs folks. I have been using vim since 1998 and every time I see someone straining with a text editor and mounted remote drive I feel really sorry about the pain. I am not going to list all the cool features of vim, but the most used setup is in my .vimrc as below. A big monitor can make using split screens a dream, even on a remote server and using vim in text mode (non gui).

# .vimrc

syntax on
set ai nu showmatch
set incsearch hlsearch ignorecase
set shiftwidth=2

"formatoptions extra to make big comment lines easier
set fo+=ro

"show the command as it is typed
set showcmd

"customized key mapping - v to comment, z to uncomment
:map v I// ^[
map z I<Del><Del><Del>^[<Right>

3. Aliases
I lost track of wasted time typing "tail -f /foo/blah/blah/yapache/error" in a remote box, so I made a list of aliases that I will actually remember to use. Before using a remote box, copy the .bashrc one time and be done with it. Some of mine:

# .bashrc

PS1="\u@\h \w \$ "

alias a='alias'
alias ls='ls -pF'
alias l='ls'
alias ll='ls -ltr'
alias rm='rm -i'
alias c='clear'
alias src='source ~/.bashrc'
alias xvi='gvim -rv'
alias f='find . -name'
alias cnu='cvs -n up 2>/dev/null'
alias cdi='cvs di 2>/dev/null'
alias pd='pushd'
alias ppd='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias sls='screen -ls'

alias ht='cd /foo/blah/share/htdocs'
alias ta='tail -f /foo/blah/logs/yapache/access'
alias te='tail -f /foo/blah/logs/yapache/error'

4. ssh-agent
If you often ssh to remote boxes, then setup ssh-agent. Typing password multiple times in one terminal session is totally dumb.

First generate the public-private key pair using ssh-keygen.
Concat the public keys to ~/.ssh/authorized_keys and copy it to the remote box. Now do this:

$ eval `ssh-agent`
$ ssh-add

To be continued and/or edited...

1 Comment

Epson 2200 waste ink mod

So, I am now set with a refillable cartridge kit coming next Monday. I plan to print a lot in a few weeks but there is always the worry of the printer’s waste ink sponges to be full soon. The waste ink counter can be reset using a combination of keys, but the sponge replacement is supposed to need a lengthy surgery on the printer (unless taken to an epson center and spending $$$).

I was looking for a painless workaround, and the closest I found is as follows:

http://www.continuousink.info/forum/viewtopic.php?t=4149

http://picasaweb.google.co.uk/pavelnemo/Epson2100NemoMod?authkey=7QzJC-KLLdk#

http://www.wasteink.co.uk/waste-ink-mods/epson-2100-wibox-mod/

So basically I need to pull out the waste ink tube from the right side and attach an exit tube to it which will lead the ink to an external container. Sweet.

4 Comments

The great inkjet rip-off

I am tired of how fast my Epson 2200 printer guzzles the color inks. Not only the color cartridges hold a measly 18ml ink, their “intelligent” chips overestimate the ink usage and makes me replace them even when there is a decent amount of ink left in them. And at the price of $11 a cartridge before tax, it is the biggest ripoff ever. Some people have tried to refill the original epson cartridges and a very good writeup is here: http://www.bobpowell.net/refill.htm

I took interest on a Continuous Ink System (CIS) that many reported as fantastic savings without much loss in quality. I found this site http://www.efillink.com/ with pretty good reviews and videos. By the specifications, CIS seems to be suitable only for volume printing, so I decided to go with the refillable cartridge system. A 4oz kit for $208 can refill each of the 8 inks about 10 times, which would otherwise cost me $880 before tax.

I will report back with my findings.

No Comments

Tweaked my pixelpost photoblog

I started a photoblog a month back after being convinced by my good friend Francesco. The idea was to think of photography at least once a day and post a favorite image in fairly big size (900px). We both started liking the pixelpost framework a lot for its clean looks and ease of tweaking. So much so that we had to consider making it as a portfolio website as well. The obstacle to make pixelpost work like a static portfolio was the inability to view image sequences within a category or tag. In the browse page, you can see thumbnails under respective categories but the category information would be lost once an image is viewed large.

After a day of tweaking code I managed to pass the category and tag parameters between the browse and image pages. So under normal conditions without any specific category or tag it will behave like a chronological sequence, but if we pass a category and/or a tag they will be honored by the image navigation links. As an example, browse page that shows only images with tag=portfolio: http://joydutta.com/photoblog/index.php?x=browse&pagenum=1&tag=portfolio

This can now serve as my online portfolio page. If you click any image thumbnail, the tag will be passed so the image sequence will only be within tag=portfolio. For example, see the navigation links: http://joydutta.com/photoblog/index.php?showimage=16&tag=portfolio

If in the browse page with tag=portfolio you click on a category, the collection will be narrower as expected. Now, both the category and tag information will be passed on when you click a thumbnail and the resulting sequence will honor both. For example, see the thumbnail links: http://joydutta.com/photoblog/index.php?x=browse&category=3&pagenum=1&tag=portfolio

Pixelpost rocks.

No Comments