Mac os x: cmd
Linux: alt
Winows: alt
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
## Oct 08, 2014 | |
## php | |
<?=date_format(date_create($review->created_at), 'M d, Y');?> | |
## knockout js | |
? | |
## angular js | |
{{ review.created_at | date : 'MMM d, y' : 'UTC' }} |
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
## -ctime / -mtime | |
## -print / -ls | |
## -delete | |
find ./ -iname '*.com*' -type f -mtime +30 -print | |
find ./ -iname '*.com*' -type f -mtime +30 -ls | |
find ./ -iname '*.com*' -type f -mtime +30 -delete |
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
psql: | |
1.创建临时表 | |
create table test_view as select * from test where date(to_timestamp(endtime))>='2012-09-02'; | |
2.导出临时表数据为文本 | |
copy test_view to '/home/postgres/test_view.txt' with delimiter as '|'; | |
3.导入文件数据到数据库中指定表 | |
delete from test; | |
copy test from '/home/postgres/test_view.txt' with delimiter as '|'; | |
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
ps aux|grep cron-14|awk '{print $2}'|xargs echo | |
ps aux|grep cron-14|awk '{print $2}'|xargs kill | |
ps aux|grep cron-14|awk '{print $2}'|xargs kill -9 |
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
sed -n '10000000,10000020p' filename | |
# You might be able to speed that up a little like this: | |
sed -n '10000000,10000020p; 10000021q' filename | |
# ref http://serverfault.com/questions/133692/how-to-display-certain-lines-from-a-text-file-in-linux |
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
$ ls /dev/xv* | |
$ df -h | |
$ service solr stop | |
$ mv /var/solr /var/solr-bak | |
$ ls -l /var/solr* | |
$ pvcreate /dev/xvdc | |
$ pvdisplay | |
$ vgcreate vg0 /dev/xvdc | |
$ vgdisplay | |
$ man lvcreate |
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
npm update npm -g |
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 `ENGINE` FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA`='your_database_name' AND `TABLE_NAME`='your_table_name'; |
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
# login to mysql client as root | |
GRANT ALL PRIVILEGES ON *.* TO '[user name]'@'localhost' IDENTIFIED BY '[password]' WITH GRANT OPTION; | |
GRANT ALL PRIVILEGES ON *.* TO '[user name]'@'%' IDENTIFIED BY '[password]' WITH GRANT OPTION; |