Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<title>Ow! -- hostname.tld</title>
<style>
body{text-align:center;position:absolute;top:50%;margin:0;margin-top:-175px;width:100%}
h2,h3{color:#555;font:bold 200%/100px sans-serif;margin:0margin-top:-375px}
h5{color:#555;font:bold 800%/100px sans-serif;margin:0}
h3,p{color:#777;font:normal 150% sans-serif}
p{font-size: 100%;font-style:italic;margin-top:2em;}
</style>
@broxio
broxio / gist:d9c4fed121c569611ec1
Created August 7, 2015 17:37
Bulk add graph to Cacti.
#--snmp-query-id=1 - SNMP - Interface Statistics
#--snmp-query-type-id=14 64bit counter
for i in {40..96}; do
php cli/add_graphs.php --host-id=${i} --graph-type=cg --graph-template-id=18;
php cli/add_graphs.php --host-id=${i} --graph-type=ds --graph-template-id=2 --snmp-query-id=1 --snmp-query-type-id=14 --snmp-field=ifOperStatus --snmp-value=Up;
done
@broxio
broxio / haproxy.cfg
Created June 2, 2016 09:58 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@broxio
broxio / gist:4a7517834399656ee6871c278e343e32
Created June 4, 2016 07:46
Update gitlab omnibus package and can use git due to MOTD
/etc/pam.d/sshd
#Comment out pam_motd.so to disable MOTD
#session optional pam_motd.so motd=/run/motd.dynamic noupdate
#session optional pam_motd.so # [1]
@broxio
broxio / squid.conf
Last active March 24, 2017 09:27
Minimal configuration for squid 3.3.8
#Recommended minimum configuration:
#acl manager proto cache_object
#acl localhost src 127.0.0.1/32
#acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@broxio
broxio / deploy_swarm_mode.sh
Last active March 31, 2017 08:58 — forked from ajeetraina/deploy_swarm_mode.sh
Scripted Installation of M-node Master Node and N-node worker nodes on Apple macOS Sierra
#!/bin/bash
#Script to setup M-node master node and N-node Worker Node running Docker 1.13.1 on Apple Mac Virtualbox
#echo "--Setting up Docker Machine---"
#curl -L https://github.com/docker/machine/releases/download/v0.9.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
#chmod +x /usr/local/bin/docker-machine
echo "--Verifying Docker Machine Installation--"
docker-machine version
@broxio
broxio / docker-compose.yml
Created March 31, 2017 09:06 — forked from ajeetraina/docker-compose.yml
Docker Compose v3.1 file for Secret Management under Docker 1.13
version: "3.1"
services:
db:
image: "mysql:latest"
networks:
collabnet:
aliases: ["db"]
volumes:
- "db_data:/var/lib/mysql"
secrets:
@broxio
broxio / gist:ce9133b9b7dfff07dd0084e9dbefbdcb
Created April 11, 2017 07:52
Reload nginx service via salt.
mad@max:/srv/pillar$ sudo salt ngx000 nginx.configtest
ngx000:
----------
comment:
Syntax OK
result:
True
stdout:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
<source>
type tail
path /var/log/foo/bar.log
pos_file /var/log/td-agent/foo-bar.log.pos
tag foo.bar
format /^(?<host>[^ ]*) (?<remote>[^ ]*) - (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<body_bytes_sent>[^ ]*) "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" "(?<http_x_forwarded_for>[^\"]*)" (?<request_time>[^ ]*) (?<request_length>[^ ]*):(?<bytes_sent>[^ ]*)/
time_format %d/%b/%Y:%H:%M:%S %z
</source>
sum(rate(junos_interface_receive_bytes{job="junos",description!="",name!~".........0$",target="$router"}[5m])) by (description, name)
sum(rate(junos_interface_transmit_bytes{job="junos",description!="",name!~".........0$",target="$router"}[5m])) by (description, name)