This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\n | |
============= HOST: ==========\n | |
\n | |
local_ip: %{local_ip}\n | |
local_port: %{local_port}\n | |
remote_ip: %{remote_ip}\n | |
remote_port: %{remote_port}\n | |
\n | |
======= CONNECTION: ==========\n | |
\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to gather the list of additionally installed packages on OpenWRT | |
# Author non7top@gmail.com | |
# Dec 2011 | |
#Read all destinations from opkg config | |
DESTINATIONS=`awk '/dest/ {print $3}' /etc/opkg.conf` | |
while read DEST | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error_page 400 404 405 =200 @40*_json; | |
location @40*_json { | |
default_type application/json; | |
return 200 '{"code":"1", "message": "Not Found"}'; | |
} | |
error_page 500 502 503 504 =200 @50*_json; | |
location @50*_json { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SITE=${1} | |
openssl s_client -connect ${SITE}:443 -servername $SITE </dev/null 2>/dev/null | openssl x509 -outform PEM > $SITE.pem | |
echo saved as $SITE.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iroute 192.168.2.0 255.255.255.0 | |
ifconfig-push 192.168.5.3 192.168.5.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec 2>&1 | |
[ -d /dev/shm -a -w /dev/shm ] && export TMPDIR=/dev/shm | |
# Parsing Input Parameters {{{ | |
##################################################################### | |
allparams=$* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# seen on SO | |
__older="$(( $(date +%s) - $(stat -L --format %Y ${file} ) > (${__age}*60*60) ))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
cat /dev/null > /var/log/anaconda.ifcfg.log | |
cat /dev/null > /var/log/anaconda.log | |
cat /dev/null > /var/log/anaconda.program.log | |
cat /dev/null > /var/log/anaconda.storage.log | |
cat /dev/null > /var/log/anaconda.syslog | |
cat /dev/null > /var/log/anaconda.xlog | |
cat /dev/null > /var/log/anaconda.yum.log | |
cat /dev/null > /var/log/audit/audit.log | |
cat /dev/null > /var/log/boot.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Formats any *.tf files according to the hashicorp convention | |
files=$(git diff --cached --name-only) | |
for f in $files | |
do | |
if [ -e "$f" ] && [[ $f == *.tf ]]; then | |
#terraform validate `dirname $f` | |
terraform fmt $f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Principal": { | |
"Service": "ec2.amazonaws.com" | |
}, | |
"Effect": "Allow", | |
"Sid": "" |