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
docker images|grep none|awk '{print $3 }'|xargs docker rmi |
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
tail -f log.log | grep --line-buffer -E "keywords" | |
grep 同时满足多个关键字和满足任意关键字 | |
① grep -E "word1|word2|word3" file.txt | |
满足任意条件(word1、word2和word3之一)将匹配。 | |
② grep word1 file.txt | grep word2 |grep word3 | |
必须同时满足三个条件(word1、word2和word3)才匹配 |
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 | |
yum install -y libxml2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libxslt-devel | |
mkdir -p /servers/php | |
./configure --prefix=/servers/php --with-curl --enable-mbstring --with-mcrypt=/usr/local --with-mysql=/servers/mysql --with-mysqli=/servers/mysql/bin/mysql_config --with-pdo-mysql=/servers/mysql --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-libxml --with-xsl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-zlib-dir --enable-opcache --with-openssl |
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
yum -y install cmake gcc-c++ ncurses-devel perl-Data-Dumper | |
groupadd mysql | |
useradd -g mysql -M -s /sbin/nologin mysql | |
mkdir -p /data/mysql | |
mkdir -p /servers/mysql | |
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX=/servers/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci | |
make | |
make install | |
cp /servers/mysql/support-files/my-default.cnf /etc/my.cnf | |
/servers/mysql/scripts/mysql_install_db --user=mysql --basedir=/servers/mysql --datadir=/data/mysql --no-defaults |
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
yum -y install pcre pcre-devel openssl openssl-devel | |
groupadd nginx | |
useradd -M -s /bin/false -g nginx nginx | |
./configure --prefix=/servers/nginx --user=nginx --group=nginx --with-http_ssl_module | |
make | |
make install |
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
#按name分组取最大的两个(N个)val | |
select a.* from tb a where 2 > (select count(*) from tb where name = a.name and val > a.val ) order by a.name,a.val |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Index</title> | |
<link rel="stylesheet" href="http://cdn.staticfile.org/twitter-bootstrap/3.2.0/css/bootstrap.min.css"> | |
<style> | |
body{ | |
background: url('bg.jpg') no-repeat bottom right fixed; |
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
FILE *fin, *fout; | |
char *buf; | |
size_t len; | |
if (fopen_s(&fin, "1.jpg", "rb") != 0) { | |
printf("Error occured while opening 1.jpg.\n"); | |
return 0; | |
} | |
fseek(fin, 0, SEEK_END); | |
len = ftell(fin); |
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
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' | |
alias ltree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' | less" |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder