Node.js handling mysql disconnects.

You may lose the connection to a MySQL server due to network problems, the server timing you out, the server being restarted, or crashing. All of these events are considered fatal errors, and will have the err.code = ‘PROTOCOL_CONNECTION_LOST’. See the Error Handling section for more information. A good way to handle such unexpected disconnects is shown below:…

svn fails to transmit data: Transmitting file data .

I had svn not committing to the repository. It would just stop at Transmitting file data . and would not budge. upgrade , and committing another file on it’s own would work .   I sudo’ed as root and used chown user. on the folder where the working copy was and it sorted itself out….

Vim auto align columns

Best trick ever i found on vim : if you start with rough space, comma delimited files to align them just type in command :  :%!column -t AWESOME !!! I love VIM nJoy 😉

Installing and configuring Postfix Ubuntu 10.04

Introduction Postfix is the default Mail Transfer Agent (MTA) for Ubuntu. It is in Ubuntu’s main repository, which means that it receives security updates. This guide explains how to install and configure postfix and set it up as an SMTP server using a secure connection.   What is a Mail Transfer Agent In other words, it’s a…

Enable SSI on Apache2 under Ubuntu

Tested on: – Ubuntu Linux 10.10 Maverick Meerkat (2010-11-21) – Ubuntu Linux 7.10 Gutsy Gibbon – Ubuntu Linux 6.06 Dapper Drake – Ubuntu Linux 5.10 Breezy Badger   1)  Optional: Install the Apache2 httpd server if not already installed. sudo apt-get install apache2 2) Create the following symlink. sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled 3) Open…

Install ffmpeg on Centos 6

Step 1 – Install ATRPMS Repository rpm –import http://packages.atrpms.net/RPM-GPG-KEY.atrpms rpm -Uvh http://dl.atrpms.net/el6-x86_64/atrpms/stable/atrpms-repo-6-7.el6.x86_64.rpm Step 2 – Install FFMpeg from ATRPMS Repository yum -y –enablerepo=atrpms install ffmpeg Verify that you have FFMpeg installed: ffmpeg -version nJoy 😉

Recording a session for a user when he / she logs in ssh

  To start recording each session add this to the users .profile file DATE=$(date +”%Y%m%d%H%M”) mkdir /log/$DATE script -t 2>/log/$DATE/bashlogs.timing -aqf /log/$DATE/bashlogs.script   to playback go to /log/<timestamp> and run scriptreplay  bashlogs.timing bashlogs.script 3 where the 3 is the speed up factor. nJoy;  

MegaCLI Megaraid useful instructions

Recently I installed a server with a Supermicro SMC2108 RAID adapter, which is actually a LSI MegaRAID SAS 9260. LSI created a command line utility called MegaCLI for Linux to manage this adapter. You can download it from their support pages. The downloaded archive contains an RPM file. I installed mc and rpm on Debian with…