Thursday, July 10, 2014

/usr/sbin/mysqld: Can't open file: .frm (errno: 24)

Suddenly when tried to connect with mysql client, started appearing /usr/sbin/mysqld: Can't open file: xxx.frm (errno: 24). Tried to restart the mysql service but failing to restart properly and can't get it on its feet.

Found below solution which works like a charm !!!

mahen@laptop# vim /etc/mysql/my.cnf

[mysqld]  
innodb_file_per_table=1  
local-infile=0  
open_files_limit=9978
 
Save the file and restart mysql service by giving following command 

mahen@laptop# /etc/init.d/mysql start
 
Thus mysql starts without any errors. :)
  
OS : Ubuntu 14.04 LTS
MySQL server : 5.5.37-0ubuntu0.14.04.1

Monday, March 10, 2014

Skype not able to run on ubuntu 64 bit versions


1. Open the desktop file with this command -
~$ gksu gedit /usr/share/applications/skype.desktop

2. You will see a line in this file which is similar to : Exec=env PULSE_LATENCY_MSEC=60 skype %U

replace this line with Exec=env PULSE_LATENCY_MSEC=60 LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu/  /usr/bin/skype %U

save the skype.desktop file.

3. You will be  able to run skype normally.

If above changes doesn't solve the problem then we need to install few i386 packages in ubuntu : lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1

Thursday, October 24, 2013

search text in running unix process commands arguments

ps -elf | grep <process type> | pargs -aceFx $(awk -F' ' '{print $4}' - ) | grep <text to be searched>

e.g. ps -elf | grep java | pargs -aceFx $(awk -F' ' '{print $4}' - ) | grep "mahendra"

Wednesday, July 10, 2013

command line - find and replace a text recursively in a specified folder in linux

$> grep -R <path of the folder> -ls -e "<text to be searched>" | xargs sed -i 's/<text to be searched>/<text to be replaced>/g'

one more way :

find <path of the folder> -exec grep -li '<text to be searched>'  {} \;

Monday, June 17, 2013

Ubuntu touchpad sensitivity/precision issue

Whenever we tried to click on any button such as closing a window, the mouse pointer changes its position. This is very frustrating sometimes. To fix this issue we need to synaptics driver options.

$ synclient | grep FingerLow
    FingerLow      = 30 
$ synclient | grep FingerHigh
    FingerHigh     = 30  
$ synclient FingerLow=14 
$ synclient FingerHigh=15 

This worked like a charm !

unix top to see specific command details

Using pgrep to get pid's of matching command lines:
 
$> top -c -p $(pgrep -d',' -f string_to_match_in_cmd_line)
 
top -p expects a comma separated list of pids so we use -d',' in pgrep. 
The -f flag in pgrep makes it match the command line instead of program name. 

Friday, June 14, 2013

usb modeswitch 3g/cdma devices

1ST STEP: prepare the system
The usb-modeswitch needs the libusb and libudev package to run, and the system must not have another usb-modeswitch installed.
$ sudo apt-get install libusb-dev
$ libusb-config –version

(it is needed at least the version 0.1.12)

$ sudo apt-get remove usb-modeswitch
$ sudo apt-get install libudev0 libudev-dev

2ND STEP: download and compile the sources
The program source, device database and device references can be downloaded from the page of the project, from these links:
Then, they must be extracted from their archives and installed with the make command (build by the Makefile present in every folder).
Note that these installations need the tcl package already installed in the system. (otherwise see other methods in README file)

$ sudo apt-get install tcl
$ bunzip2 usb-modeswitch-1.2.5.tar.bz2 && tar xvfp usb-modeswitch-1.2.5.tar
$ bunzip2 usb-modeswitch-data-20121109.tar.bz2 && tar xvfp usb-modeswitch-data-20121109.tar

$ su
# cd usb-modeswitch-1.2.5
# make install
# cd ../usb-modeswitch-data-20121109
# make install

3TH STEP: configure the system

Now, the system still doesn’t recognize the device as a modem.
Then, the configure file usb_modeswitch.conf must be modified, with changing EnableLogging=1 (default value is 0) to enable the log of the device.
Then to automate the execution of usb_modeswitch, we need to add a command at the end of the file rc.local.
$ sudo nano /etc/rc.local
sudo modprobe usbserial vendor=0x2357 product=0x0201


original credit : http://fcastagnotto.wordpress.com/2013/04/29/usb_modeswitch-ubuntu-systems/