This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
################## | |
# Author: Bin Wu # | |
################## | |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import csv | |
import re | |
filein = open('lcshtopics-synonymlinkage.tsv', 'r') | |
#filein = open('abc.tsv', 'r') | |
fileout = open('out', 'w') | |
try: | |
i = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab settings | |
# 0 3 * * * <path to file>/homedir_bak.sh | |
rsync -acz /home/wubin /data/backup/wubin_home > /dev/null 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in ${BATCH_DIR}/batch-*.json | |
do | |
echo "aboutto index $f" | |
curl --silent --show-error --request POST \ | |
--data-binary @$f localhost:9200/_bulk > /dev/null 2>&1 | |
echo | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'%' IDENTIFIED BY 'password'; | |
FLUSH PRIVILEGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME | |
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
where | |
REFERENCED_TABLE_NAME = '<table>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APACHE_USER=$(ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}') | |
echo $APACHE_USER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
# find zombie pid | |
# ps aux | awk '{ print $8 " " $2 }' | grep -w Z | |
# kill -9 PID | |
# All in one cmd does all | |
kill -HUP `ps -A -ostat,ppid | grep -e '^[Zz]' | awk '{print $2}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mongod=/usr/local/mongodb/bin/mongod | |
mongod_data=/Users/michito/work/mongodb_data | |
mongod_log=/Users/michito/work/mongodb_log/mongodb.log | |
prog=mongod.sh | |
RETVAL=0 | |
stop() { | |
grep_mongo=`ps aux | grep -v grep | grep "${mongod}"` |
OlderNewer