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
##get public ip from command line | |
wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f2 | cut -d\< -f1 |
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
good site : http://www.easywayserver.com | |
kernel tweak : https://www.kernel.org/doc/Documentation/sysctl/vm.txt | |
Everything under sysclt : https://www.kernel.org/doc/Documentation/sysctl/ |
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
executed as this will change the way I can optimize: | |
FROM clause | |
WHERE clause | |
GROUP BY clause | |
HAVING clause | |
SELECT clause | |
ORDER BY clause | |
This order holds some very | |
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
URL : http://blog.import.io/tech-blog/analysing-elb-elastic-load-balancer-logs-with-logstash-and-kibana |
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
s3cmd ls --recursive s3://mys3.com/bucket1/ | awk '{print $4}' | grep '.gz' | xargs -I@ s3cmd get @ - | zgrep 'request' | wc -l |
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
memset() : This function fills the first n bytes of the memory area pointed to by s with the constant byte c. | |
fopen() : This function opens the file whose name is the string pointed to by its first argument and associates a stream with it. | |
getcwd() : This function return a null-terminated string containing an absolute pathname that is the current working directory of the calling process | |
getuid() : This function returns the real user ID of the calling process | |
snprintf() : This function produces output according to a format and writes the output to a buffer. | |
fwrite() : This function is used to write data to a stream | |
fflush() : This function forces a write of all user space buffered data on to a particular stream | |
fclose() : This function flushes the associated stream and closes the underlying file descriptor. | |
system() : This function executes a command |
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
Here's a quick list of cool examples for the dd tool: | |
Create a backup | |
dd if=/dev/sda of=/opt/backup_sda.img | |
Restore a backup | |
dd if=/opt/backup_sda.img of=/dev/sda | |
Clone a hard disk | |
dd if=/dev/sdb of=/dev/sdc |
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
Things to care about | |
OS configs : | |
ulimit : unlimited | |
increase the max_file handle : cat /proc/sys/fs/file-max | |
remove reserve block count (currently - 1%) | |
noatime | |
[root@ip-192-10-16-125 ~]# cat /proc/sys/net/core/somaxconn |
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
#def 60 | |
net.ipv4.tcp_fin_timeout=20 | |
#def 9 | |
net.ipv4.tcp_keepalive_probes=5 | |
#def 32768 | |
net.ipv4.tcp_max_orphans=32768 | |
#def 10240 | |
net.core.optmem_max=20480 | |
#def 110592 | |
net.core.rmem_default=16777216 |
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
The order is (from first to last): | |
Brace expansion | |
Tilde expansion | |
The following expansions happen at the same time, in a left-to-right fashion on the commandline (see below) | |
Parameter expansion | |
Arithmetic expansion | |
Command substitution | |
Word splitting | |
Pathname expansion |
OlderNewer