Completely remove MySQL server including all the data from Debian

I just tried to uninstall MySQL on Debian via

apt-get remove --purge mysql-server

apt-get remove --purge mysql-client

apt-get autoremove

and wondered that the directories /var/lib/mysql /etc/mysql still existed after the commands. Then I recognized, that a

apt-get remove --purge 'mysql-server.*'

is doing better and removes everything.

Note:

if you get a

/etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read.

error when you try to re-install MySQL, try a

apt-get purge mysql-common

and try to re-install again.

‘xterm-256color’: unknown terminal type.

The following error popped up when I was accessing a Ubuntu EC2 instance from my MacOS X system:

xterm-256color’: unknown terminal type.

To fix this error I needed to install ncurses-term via

sudo apt-get install ncurses-term

Netbeans IDE 7.1 Beta

Just found out that the new NetBeans IDE 7.1 Beta has integrated GIT support. Nice. And it’s so much nicer to work with Netbeans compared to Eclipse. Especially if you are working with Glassfish.

get text between 2 lines from a file with sed

I just had the problem that I wanted to get 2000 lines of text from a big log file (> 20 million lines). It was too much to select it in my Terminal. The only thing I know was where the text of interest started and where it ended. Sed what the hero of this day and helped me with this command:

sed -n '19121287,19123287p' big_log_file.log > sliced_text.log

19121287 was the line number where it starts and 19123287 was the line where it ends.

Developing for Google+

Just a quick note: Google+ API released:

The Google+ platform brings that nuance and richness to all of the web. We started with Google’s own products, added the +1 button for site owners and content publishers, and introduced games from a handful of partners. That’s just the beginning though — we want every one of you who builds applications to be able to include rich sharing, identity, and conversations in your app. Today, we’re taking the next step on that journey by launching the first of the Google+ APIs.

Neo4j. NoSQL graph database

Neo4j is a graph database, storing data in the nodes and relationships of a graph. The most generic of data structures, a graph elegantly represents any kind of data, preserving the natural structure of the domain.

Kill processes by their name

Sometimes you have lots of processes running on your Linux system and you want to kill them all. But you don’t want to spend too much time on killing each process by their process id. A good way to handle with this problem is to combine ps, with grep and awk:

ps -lax | grep "MY SEARCH PATTERN"| awk '{print $3}' | xargs kill -9

In this case I am getting the whole process list, then I search for processes which contain MY SEARCH PATTERN. After this I am getting the 3rd column, because there is the process ID. After that we kill ‘em all!

Yet another like button

Facebook’s like button. This time from Google: +1

http://www.google.com/webmasters/+1/button/

HJCache: iPhone cache library for asynchronous image loading and caching.

Another lazy loading approach:

HJCache is an iOS library that makes it very easy to asynchronously load images from URLs, display them in smooth scrolling tables, and cache the images in file storage.

via HJCache: iPhone cache library for asynchronous image loading and caching..

Completely remove MySQL server and MySQL client in Debian

Sometimes it is necessary to remove MySQL completely from your Debian system. E.g. after a complete misconfiguration. I had this problem and found this commands to get rid of MySQL server and client (in this case in version 5.1). Both commands need to be executed as root:

# apt-get autoremove --purge mysql-server mysql-server-5.0

# apt-get autoremove --purge mysql-client mysql-client-5.1