Tuesday, May 1, 2012

XAMPP: How to change default language for phpmyadmin

Today I installed XAMPP. After installing, First thing I wanted to do was change mysql password. After searching on xampp site, I found out I can change mysql password using phpMyAdmin. (Ref: link) When I went to phpMyAdmin, everything was in German. After some search, I found out that you have to add two lines in config file.
C:\xampp\phpMyAdmin\config.inc.php
In this file add following line.
$cfg['DefaultLang'] = 'en-utf-8';
After this just reload phpmyadmin page.

Thursday, February 9, 2012

Cygwin: rebaseall utility

You may sometimes see cygwin error like this.
bash 4944 exception::handle: Exception: STATUS_ACCESS_VIOLATION
emap to same address as parent

Short answer

To fix these errors, run these commands from your MS-DOS command prompt.
cd \cygwin\bin
ash
PATH=. rebaseall -v

More Details

Rebaseall utility
Rebaseall utility should be available under /cygwin/bin/ directory.
To check if rebaseall is available or not. If it is available it will print something like this.
priyank@~:>which rebaseall
/usr/bin/rebaseall

Only ash process is allowed to run rebaseall. Means you cannot run rebaseall directly from cygwin.
Open MS-DOS command prompt and follow these steps to to run rebaseall.
cd \cygwin\bin
ash
PATH=. rebaseall -v

Thursday, December 29, 2011

JAVA: SAXParseException - entiry must end with ';' delimiter

Exception: org.xml.sax.SAXParseException: The reference to entity “T” must end with the ';' delimiter

The problem is with an XML which you are trying to parse. Your xml contains special character "&". It should be replaced with "&"

Thursday, September 22, 2011

How to generate ssh public/private key (using command)
Use following command:
ssh-keygen -t rsa

where
-t: specifies type of key to create
rsa: is a type to create You can to check more options by using man command.
man ssh-keygen

Friday, August 19, 2011

Some advice

I stumbled upon this while reading a blog.

- An hour of sleep before midnight is worth two, and an hour of work before noon is worth two.

- Always pick your kids up from school. That’s when they want to talk.

- Never let your skill exceed your virtue.

- Never take less than two weeks off when you have a child or for your honeymoon. Don’t let them talk you down.

- When you mess up, admit it frankly and quickly, and move on.

- Always do your very best in your job, but if you don’t like what you’re doing enough that you would do it for free, quit.

Friday, July 15, 2011

MYSQL: Change mysql db schema name

How to change mysql database schema name?

Here s what you need to do:
1. Use mysqldump to dump old mysql database.
2. Create new database using mysqladmin.
3. And run the sql generated via mysqldump.

e.g. if you want to change database named "school_old" to "school_new"
Here are the commands.
mysqldump -u username -p -v school_old > old_db_dump.sql
mysqladmin -u username -p create school_new
mysql -u username -p school_new < old_db_dump.sql

Wednesday, June 15, 2011

Updated twitter bookmarklet

Recently twitter updated the way you post tweets. So the previous version of bookmarklet stopped working.

So here is the updated version. Just drag this bookmarklet to your bookmarks bar.

Twitter Bookmarklet

Check out his link if you want to know what this bookmarklet does.
Click here

Here is the code:
javascript: var longUrl=document.location; var url = 'http://api.bit.ly/shorten?version=2.0.1&login=tweetthees&apiKey=R_e1266a2cb3177ea0a9e1114cc49d8ad9&longUrl='+longUrl; loadScript(url+'&callback=tweetme'); function loadScript(scriptURL){ var scriptElem = document.createElement('SCRIPT'); scriptElem.setAttribute('language','JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem); } function tweetme(json){ var shortLink=json.results[longUrl].shortUrl; window.location='http://twitter.com/intent/tweet?text=Reading: '+document.title+' '+shortLink }