Sunday, October 13, 2013

create debian usb install stick, on a mac machine

sudo dd if=~/Desktop/debian-live-7.0.0-i386-gnome-desktop.iso of=/dev/rdisk1 bs=1m

Tuesday, August 13, 2013

Wednesday, July 31, 2013

debian firefox java plugin install

download the library, extract them, then
 
ln -s jdk/jdk1.6.0_26/jre/lib/i386/libnpjp2.so  ~/.mozilla/plugins/
 
 

Tuesday, May 14, 2013

Migrate mysql users to another server

ERROR 1577 (HY000) at line 1: Cannot proceed because system tables used by Event Scheduler were found damaged at server start ERROR 1547 (HY000) at line 1: Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted


solution:
sudo mysql_upgrade -uroot -p --force

Rsync and sudo over SSH

backup_user ALL=(root)NOPASSWD:/usr/bin/rsync

rsync --rsync-path="sudo rsync" backup_user@myhosttobackup.net:/root /backup_directory

debian Add a second hard disk

fdisk -l

cfdisk /dev/sdb

mkfs.ext3 /dev/sdb1

mkdir /disk2
mount -t ext3 /dev/sdb1 /disk2

/etc/fstab
/dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1 

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

in my case
my solution is simply comment out skip-bdb
Berkeley DB is no longer in 5.1x, so the option doesn't apply any more

Sunday, April 21, 2013

debian no sound

lsof /dev/snd/*

to find out what program are using sound device, some program might be hanging causing sound not to function

Wednesday, April 10, 2013

linux grep and sed to find through files and replace a string

grep -rl oldstring path | xargs sed -i 's/oldstring/newstring/g

find /path -type f -exec sed -i 's/oldstring/newstring/g' {} \;

Friday, April 5, 2013

Saturday, March 23, 2013

“No such file or directory” error when executing a binary

problem:
when try to execute a binary it shows error No such file or directory

reason:
your platform is 64 bit, and try to execute a 32 bit binary

confirm:
uname -m
file [your binary path]


solution:
apt-get install ia32-libs ia32-libs-gtk

Friday, March 22, 2013

apt-get install debian vnc viewer

sudo apt-get install ssvnc

How to Install Remote Desktop on Debian Server

su
apt-get update
apt-get upgrade
apt-get install gnome-desktop-environment
apt-get install tightvncserver
tightvncserver :1
tightvncserver -kill :1
vim ~/.vnc/xstartup
save the following to ~/.vnc/xstartup #!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
gnome-session &
restart vncserver tightvncserver -geometry 1280x960 :1

Tuesday, January 8, 2013

debian screen command

You start screen as "screen -r" ^A ? show a help screen (display key bindings) ^A c create a new window and switch to it ^A n go to next window ^A p go to previous window ^A 0 go to window number 0 ^A 1 go to window number 1 ^A w show a list of windows ^A a send a Ctrl-A to current window as keyboard input ^A h write a hardcopy of current window to file ^A H begin/end logging current window to file ^A ^X lock the terminal (password protected) ^A d detach screen session from the terminal ^A DD detach screen session and log out

Monday, January 7, 2013

ImportError: No module named MySQLdb

apt-get install python-mysqldb (Linux Ubuntu, Debian)
yum install MySQL-python (Linux Fedora, CentOS)

Tuesday, January 1, 2013

jQuery comma in selector?

The second argument in the selector is a context for search. $(a,b) is the same as $(b).find(a)