Skip to content

Instantly share code, notes, and snippets.

View Mstaaravin's full-sized avatar

Mstaaravin Mstaaravin

View GitHub Profile
@Mstaaravin
Mstaaravin / gist:ec1b067043af47e5e85e
Created January 26, 2015 15:43
cybermonday headers
cmiranda@marvin:~$ curl -I http://cybermondayarg.com.ar/
HTTP/1.1 200 OK
Server: Apache/2.2
Content-Type: text/html; charset=UTF-8
Date: Mon, 02 Dec 2013 22:25:20 GMT
Accept-Ranges: bytes
Connection: Keep-Alive
Set-Cookie: X-Mapping-pindfigh=A0570588EDFA4906B8EBB80CFE5F7FDD; path=/
Last-Modified: Mon, 02 Dec 2013 22:16:42 GMT
Content-Length: 37199
@Mstaaravin
Mstaaravin / gist:75acbd31c135fc7a4ab7
Last active August 29, 2015 14:14
post: Cybermonday Analisis del fiasco - image header
cmiranda@marvin:~$ curl -I http://blog.ngen.com.ar/wp-content/uploads/2013/09/virsh_list.png
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 03 Dec 2013 00:00:19 GMT
Content-Type: image/png
Content-Length: 7421
Last-Modified: Mon, 02 Sep 2013 00:38:38 GMT
Connection: keep-alive
ETag: "5223de0e-1cfd"
Expires: Tue, 10 Dec 2013 00:00:19 GMT
@Mstaaravin
Mstaaravin / nginx.conf
Last active August 29, 2015 14:14
post: Cybermonday Argentina análisis del fiasco - nginx code block
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 7d;
add_header Cache-Control public;
}
@Mstaaravin
Mstaaravin / rsyncd.conf
Created January 26, 2015 18:20
post: KVM: Full backups de virtual disks (qcow2) con virsh + rsync
#motd file=/etc/motd
#log file=/var/log/rsyncd
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
# pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=
use chroot = yes
max connections = 10
lock file = /var/lock/rsyncd
@Mstaaravin
Mstaaravin / ssh-key
Last active August 29, 2015 14:14
post: KVM: Full backups de virtual disks (qcow2) con virsh + rsync
root@ardenas:~# cat .ssh/authorized_keys
from="172.16.10.234" ssh-rsa AAAAB3NzaC1yc2EAAAADA................... root@bkpserver
@Mstaaravin
Mstaaravin / virsh-snapshot.sh
Created January 26, 2015 18:25
post: KVM: Full backups de virtual disks (qcow2) con virsh + rsync
#! /bin/bash
# Usage suspendCopyResume IP VM
function suspendCopyResume {
virsh -c qemu+ssh://root@$1/system suspend $2
rsync -avrp --partial --progress rsync://$1/libvirt/images/$2.img /var/lib/bulk/libvirt/images/
virsh -c qemu+ssh://root@$1/system resume $2
}
suspendCopyResume "172.16.10.200" "ADServer"
suspendCopyResume "172.16.10.200" "Bejerman"
@Mstaaravin
Mstaaravin / sshd_config
Created January 26, 2015 18:26
post: KVM: Full backups de virtual disks (qcow2) con virsh + rsync
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
@Mstaaravin
Mstaaravin / crontab
Created January 26, 2015 18:30
post: KVM: Full backups de virtual disks (qcow2) con virsh + rsync
MAILTO=""
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
25 23 * * 5 /bin/rm /var/lib/bulk/libvirt/images/*.img
30 23 * * 5 /bin/bash /usr/bin/ssh-agent;/usr/bin/ssh-add;/usr/local/bin/virsh-snapshot.sh
@Mstaaravin
Mstaaravin / apt.conf
Created February 13, 2015 15:38
post: Configurar apt.conf para no instalar paquetes recomendados/sugeridos en Debian
APT::Install-Recommends "0";
APT::Install-Suggests "0";
@Mstaaravin
Mstaaravin / aptitude_1.sh
Last active August 29, 2015 14:15
post: Configurar apt.conf para no instalar paquetes recomendados/sugeridos en Debian
root@wheezy:~# aptitude install ssh screen rsync sysv-rc-conf less telnet dnsutils whois mc mlocate sudo vim iperf iftop iptraf zip unzip bzip2
The following NEW packages will be installed:
iftop iperf iptraf libcurses-perl{a} libcurses-ui-perl{a} libffi5{a} libglib2.0-0{a}
libglib2.0-data{a} libpcap0.8{a} libterm-readkey-perl{a} mc mc-data{a} rsync screen
shared-mime-info{a} sudo sysv-rc-conf unzip vim vim-runtime{a} zip
0 packages upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.3 MB of archives. After unpacking 54.2 MB will be used.
Do you want to continue? [Y/n/?]