Thanks to antville.org
Friday, 17. May 2013
remove all files
If you have problems to delete many files in a folder using rm * because you get the error that the argument list is to long you can use the combination of ls and xargs to get rid of the files.

Instead of
rm *

Solution:
ls | xargs rm -f

... Link (0 comments) ... Comment


Monday, 13. May 2013
Check for table corruption quick and fast
#!/bin/sh

for dbname in `mysqlshow | awk '{print $2}'`
do
mysqlcheck $dbname ticket -Fq
done

# call this shell script and find the errors
time sh check.sh | grep error

... Link (0 comments) ... Comment


mysql analysis
When there is an issue, We should gather some preliminary data to analyze first.

tee 'output.txt';
SHOW GLOBAL STATUS;
SHOW ENGINE INNODB STATUS;
SHOW FULL PROCESSLIST;
SELECT SLEEP(60);
SHOW GLOBAL STATUS;
SHOW ENGINE INNODB STATUS;
SHOW FULL PROCESSLIST;

SHOW GLOBAL VARIABLES;
notee;

Study the 'output.txt' file. Also the my.cnf and slow query log
From the OS;

free -m
ps aux
df -h

iostat -x 1 5
vmstat 1 5
top -b -n 3
mysql> show global status;

... Link (0 comments) ... Comment


Tuesday, 7. May 2013
Know more about your server
You can get information about the make, model and serial number of the equipment as shown below:
# dmidecode -t system

What is the maximum RAM supported by the system?
# dmidecode -t 16

Currently installed RAM
# cat /proc/meminfo | grep -i memtotal

Memory slots occupied
# /usr/sbin/dmidecode -t 17 | grep -i size

// know more about running processes
# dstat

... Link (0 comments) ... Comment


Sunday, 21. April 2013
Git Alias
Consider setting up a simple Git alias for common but complex Git command that you type frequently.

git config --global alias.show-graph 'log --graph --abbrev-commit --pretty=oneline'

... Link (0 comments) ... Comment


Saturday, 20. April 2013
mysql to postgresql
It is incredibly easy to migrate from MySQL to PostgreSQL. Just migrate your schema first (leaving foreign keys out until after restore) and then the mysqldump files are almost perfectly compatible with PostgreSQL when using:

mysqldump --compatible=postgresql --no-create-db --no-create-info --add-locks=false --quote-names=false --complete-insert=true

I just had to convert \' to two single quotes and fix MySQL's infamous null dates (0000-00-00 00:00:00) to be true nulls and was able to pipe the backup right into psql.

sed -e "s/\\\'/\'\'/g" -e "s/\'0000-00-00 00:00:00\'/null/g" backup.sql > output.sql

... Link (0 comments) ... Comment


Sunday, 14. April 2013
import data faster
Following my.cnf parameter is highly recommended on high configuration machine. This will make importing myisam only data much faster.

#datadir=/var/lib/mysql
datadir=/mnt/data/mysql/
user=root
skip-innodb
default-storage-engine=myisam
key-buffer=1G
bulk_insert_buffer_size=1G
myisam_max_sort_file_size=20G

tmpdir=/mnt/data/mysql

... Link (0 comments) ... Comment


Wednesday, 3. April 2013
git alias
Add the following to the .gitconfig file in your $HOME directory.

[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p

... Link (0 comments) ... Comment


Tuesday, 12. March 2013
Sending file attachments
Here is a quick way to send files from any server where mutt is installed.

echo "Attaching a file " | mutt -s "file attachment" -a /root/somefile.txt -- your.name@gmail.com

... Link (0 comments) ... Comment


Wednesday, 27. February 2013
MySQL on Ubuntu
If you are using Ubuntu and can not change the data directory, you need to edit the file

/etc/apparmor.d/usr.sbin.mysqld

Disable firewall (ufw disable) and check the ownership and directory permissions.

ufw disable

... Link (0 comments) ... Comment


Online for 3921 days
Last modified: 5/17/13 5:42 PM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
May 2013
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031
April
Recent updates
remove all files If you have problems to delete many files in a folder using...
by shantanuo (5/17/13 5:42 PM)
Improve InnoDB performance innodb_flush_method=O_DIRECT innodb_file_per_table innodb-flush-log-at-trx-commit = 2 # number of cpus * number of...
by shantanuo (5/17/13 5:01 PM)
correcting date A few packages are dependent upon the server time. If the date is...
by shantanuo (5/14/13 5:07 PM)
Check for table corruption quick and fast #!/bin/sh for dbname in `mysqlshow | awk '{print...
by shantanuo (5/13/13 9:09 PM)
Know more about your server You can get information about the make, model and serial...
by shantanuo (5/13/13 5:33 PM)
mysql analysis When there is an issue, We should gather some preliminary data to analyze...
by shantanuo (5/13/13 10:37 AM)
Git Alias Consider setting up a simple Git alias for common but complex Git command...
by shantanuo (4/21/13 11:46 AM)
mysql to postgresql It is incredibly easy to migrate from MySQL to PostgreSQL. Just migrate...
by shantanuo (4/20/13 6:26 PM)
import data faster Following my.cnf parameter is highly recommended on high configuration machine. This will...
by shantanuo (4/14/13 7:51 PM)
git alias Add the following to the .gitconfig file in your $HOME directory. [alias] co...
by shantanuo (4/3/13 11:16 AM)
Install latest mysql Set up git: yum install git-core cd ~/.ssh ssh-keygen -t rsa -C...
by shantanuo (3/12/13 1:49 PM)
Sending file attachments Here is a quick way to send files from any server where...
by shantanuo (3/12/13 1:43 PM)
MySQL on Ubuntu If you are using Ubuntu and can not change the data directory,...
by shantanuo (2/27/13 8:17 AM)
php variables It is highly recommended to increase the following limits in /etc/php.ini so that...
by shantanuo (2/19/13 2:50 PM)
php cookies The global array $_COOKIE is used to retrieve the cookie value for subsequent...
by shantanuo (7/26/12 6:00 PM)
managing crons We can use logger command in a crontab. 59 23 * * *...
by shantanuo (7/24/12 10:57 AM)
innodb metadata Innodb tables queries based on information_schema may be slower. In order to improve...
by shantanuo (7/19/12 5:37 PM)
scrolling in screen We can not scroll up or down while working in screen mode....
by shantanuo (6/28/12 10:37 AM)
Gmail search for superstars by name Enabling superstars in gmail Settings gives you 11 more...
by shantanuo (6/26/12 10:22 AM)
SSH Tunneling Tunneling an ssh connection through an ssh connection is completely lawful, but you...
by shantanu oak (4/23/12 11:57 AM)
happy swapping # sysctl vm.swappiness vm.swappiness = 60 With that setting the Linux kernel feels...
by shantanuo (4/4/12 1:54 PM)
Changing document root We need to change DocumentRoot variable in the configuration file. vi /etc/httpd/conf/httpd.conf...
by shantanuo (3/23/12 12:10 PM)
setting cron from a file To upload the cron job from a file to another...
by shantanu oak (12/15/11 6:47 PM)
innodb_buffer_pool_instances Divides the buffer pool into a user-specified number of separate regions, each with its...
by shantanuo (11/30/11 5:05 PM)
log output as well as show on screen log a command to console and to...
by shantanuo (11/7/11 5:04 PM)

RSS feed

Made with Antville
Helma Object Publisher