Skip to content

Instantly share code, notes, and snippets.

View KristianLyng's full-sized avatar

Kristian Lyngstøl KristianLyng

  • Amedia
  • Oslo
View GitHub Profile
kristian@luke:~$ dig ns2.ccnp.no AAAA @z.nic.no
; <<>> DiG 9.7.1-P2 <<>> ns2.ccnp.no AAAA @z.nic.no
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63124
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 4
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
#!/bin/bash
#set -e
set -x
for a in `seq 1 12`; do
virsh destroy training$a;
sleep 0.1;
done
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/luke-usr 8.3G 3.7G 4.2G 47% /usr
/dev/mapper/luke-var 2.8G 1.2G 1.5G 44% /var
/dev/mapper/luke-tmp 368M 11M 339M 3% /tmp
/dev/mapper/luke-root 322M 157M 149M 52% /
kristian@luke:~$ cat /usr/lib/nagios/plugins/check_mount.sh
#!/bin/bash
# CHEF
gawk '
$3 ~ "(ext[0-9]|btrfs)" {
if ($4 !~ "^rw") {
ret=2
ret_status+= " $1 ($2) not mounted RW"
}
iface eth0 inet6 static
address 2a02:20c8:1150:1100::a
netmask 64
up ip route add 2a02:20c8:1150::1/128 dev eth0
up ip -family inet6 route add default via 2a02:20c8:1150::1 dev eth0
(gdb) print *vef
$1 = {magic = 4043617567, vgz = 0x2aaaad2140c0,
bufp = 0x54c8f74d "<!--\ncomponentView: normal\ntemplateName: multifix\npageType: front\npublication.id: 41\nsection.id: 71\nsection.uniqueName: ece_frontpage\n-->TF-8&lang=nb_NO_www.ba.no-->\n</div>\n<div class=\"apiB flowobelix"..., tot = 31991, error = 0, pending = '\000' <repeats 19 times>, npend = 0}
SOURCE:
; CHEF updated: <%= node[:bind][:timestamp_human] %>
$TTL 14400
@ IN SOA exile.kly.no. kristian.kly.no. (
<%= node[:bind][:timestamp] %> ; Serial
14400 ; Refresh
86400 ; Retry
2419200 ; Expire
3600 ) ; Negative Cache TTL
top - 20:57:15 up 19 days, 7:31, 1 user, load average: 2.10, 1.85, 1.58
Tasks: 449 total, 2 running, 447 sleeping, 0 stopped, 0 zombie
Cpu0 : 5.3%us, 2.3%sy, 0.0%ni, 91.1%id, 1.3%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 1.6%us, 2.2%sy, 0.0%ni, 96.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 2.5%us, 5.6%sy, 0.0%ni, 91.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.7%us, 1.4%sy, 0.0%ni, 97.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 1.3%us, 3.1%sy, 0.0%ni, 95.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 0.7%us, 0.3%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 4.3%us, 1.6%sy, 0.0%ni, 91.8%id, 2.3%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 1.0%us, 2.6%sy, 0.0%ni, 96.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
root@luke:~# time ./virt-new.sh
Name: jarjar
Memory: 1024
Disk: 10
Starting install...
Retrieving file MANIFEST... | 3.3 kB 00:00 ...
Retrieving file linux... | 4.6 MB 00:00 ...
Retrieving file initrd.gz... | 13 MB 00:00 ...
Testing grace
=============
1. Set up two web servers (already done)
2. Normally, Varnish should balance between both
3. For /cgi-bin/, make Varnish always use Apache
4. Test the test.cgi script wit the sleep-statement
5. Make test.cgi cache, either by editing the script or forcing it in
Varnish
6. Make both /grace/test.cgi and /nograce/test.cgi rewrite to