Skip to content

Instantly share code, notes, and snippets.

View bdossantos's full-sized avatar

Benjamin Dos Santos bdossantos

View GitHub Profile
@bdossantos
bdossantos / gist:5310110
Created April 4, 2013 12:52
db01-slave disk
md: data-check of RAID array md1
md: minimum _guaranteed_ speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
md: using 128k window, over a total of 10238912 blocks.
md: delaying data-check of md2 until md1 has finished (they share one or more physical units)
md: md1: data-check done.
md: data-check of RAID array md2
md: minimum _guaranteed_ speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
md: using 128k window, over a total of 1942746048 blocks.
@bdossantos
bdossantos / gist:5250070
Created March 26, 2013 22:55
/dev/sda wf02
sd 0:0:0:0: [sda] Unhandled sense code
sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
e8 d0 83 41
sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 e8 d0 83 41 00 00 40 00
end_request: I/O error, dev sda, sector 3905979201
Read-error on swap-device (8:0:3905979209)
@bdossantos
bdossantos / gist:5237061
Created March 25, 2013 13:23
php5.4 session clean
$ [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime)
find: AVERTISSEMENT : vous avez spécifié l'option -ignore_readdir_race après un argument qui n'est pas une option -type mais les options sont positionnelles (-ignore_readdir_race affecte les tests spécifiés avant aussi bien qu'après). SVP spécifiez des options avant les autres arguments.
@bdossantos
bdossantos / gist:5039608
Created February 26, 2013 16:04
php5-fpm memory usage
ps -ylC php5-fpm --sort:rss | awk '!/RSS/ { s+=$8 } END { printf "%s\n", "Total memory used by PHP-FPM child processes: "; printf "%dM\n", s/1024 }'
@bdossantos
bdossantos / gist:4730170
Created February 7, 2013 10:37
apc conf
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256M
apc.stat=0
apc.stat_ctime=0
apc.optimization=0
apc.ttl=7200
apc.user_ttl=0
apc.enable_cli=0
apc.include_once_override=0
@bdossantos
bdossantos / check_max_open_files.sh
Last active December 10, 2015 20:28
Check number of opened files
#!/usr/bin/env bash
# Check number of opened files
if [ $# != 2 ]; then
echo "Syntax: check_max_open_files <warn percent> <crit percent>"
echo
echo "Example: check_max_open_files 75 90"
exit 3
fi
@bdossantos
bdossantos / bootstrap.sh
Last active December 10, 2015 07:08
pandoc md => pdf
#!/usr/bin/env bash
# Disable manuals interactions
export DEBIAN_FRONTEND=noninteractive
# FR apt repository
sed -i -e 's/us.archive.ubuntu.com/fr.archive.ubuntu.com/g' /etc/apt/sources.list
# Upgrade
apt-get update
@bdossantos
bdossantos / gist:4336039
Created December 19, 2012 11:24
ping test
bdossantos:~/ $ ping -c 4 91.121.149.132
PING 91.121.149.132 (91.121.149.132): 56 data bytes
64 bytes from 91.121.149.132: icmp_seq=0 ttl=54 time=87.858 ms
64 bytes from 91.121.149.132: icmp_seq=1 ttl=54 time=77.375 ms
64 bytes from 91.121.149.132: icmp_seq=2 ttl=54 time=76.998 ms
64 bytes from 91.121.149.132: icmp_seq=3 ttl=54 time=75.763 ms
--- 91.121.149.132 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
@bdossantos
bdossantos / gist:4285967
Created December 14, 2012 14:50
Nginx lb + CouchDB
# client body
client_header_timeout 3600;
client_body_timeout 3600;
client_max_body_size 128m;
# proxy options
proxy_read_timeout 3600;
proxy_connect_timeout 3600;
#ignore_invalid_headers on;
@bdossantos
bdossantos / gist:4258785
Created December 11, 2012 14:03
check_load
time 5 min 10 min 15 min
warning: 90% 70% 60%
critical: 100% 80% 70%