Skip to content

Instantly share code, notes, and snippets.

View bdossantos's full-sized avatar

Benjamin Dos Santos bdossantos

View GitHub Profile
@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 / 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 / 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 / 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: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: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: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:5354241
Created April 10, 2013 12:37
mon01 sda
ata1.00: exception Emask 0x0 SAct 0xffff SErr 0x0 action 0x0
ata1.00: irq_stat 0x40000008
ata1.00: failed command: READ FPDMA QUEUED
ata1.00: cmd 60/00:00:01:f9:87/01:00:b9:00:00/40 tag 0 ncq 131072 in
res 41/40:00:78:f9:87/00:01:b9:00:00/00 Emask 0x409 (media error) <F>
ata1.00: status: { DRDY ERR }
ata1.00: error: { UNC }
ata1.00: configured for UDMA/133
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0xfffe SErr 0x0 action 0x0
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata1.00: failed command: SMART
ata1.00: cmd b0/d5:01:06:4f:c2/00:00:00:00:00/00 tag 0 pio 512 in
res 40/00:00:88:d7:40/00:00:09:00:00/e9 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1: hard resetting link
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
# Partitionning
fdisk /dev/sda (n p 1, a 1, t 1 fd, w)
sfdisk -d /dev/sda | sfdisk /dev/sdb
# RAID 1
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 --assume-clean
# LVM
pvcreate /dev/md0
vgcreate debian /dev/md0