Skip to content

Instantly share code, notes, and snippets.

View virtualadrian's full-sized avatar
🤓
Geek: A knowledgeable and obsessive enthusiast.

VirtualAdrian virtualadrian

🤓
Geek: A knowledgeable and obsessive enthusiast.
View GitHub Profile
@virtualadrian
virtualadrian / 0_reuse_code.js
Created September 20, 2016 07:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@virtualadrian
virtualadrian / postfix-dovecot-ubuntu14.04.sh
Created December 18, 2016 21:53 — forked from haisum/postfix-dovecot-ubuntu14.04.sh
Automated bash script to setup dovecot postfix mysql email server on ubuntu 14.04
#!/usr/bin/env bash
#####
# Script to install postfix
#####
DOMAIN="example.com"
EMAIL="haisum@example.com"
PASSWORD="example.com1*"
@virtualadrian
virtualadrian / installation.sh
Created January 21, 2017 08:52 — forked from arosemena/installation.sh
CentOS 7.0 Installation script (nginx, php-fpm, redis, postgresql), mainly for laravel
#!/bin/bash
#================#
# For CentOS 7.0 #
#================#
######## CONFIG ##########
user="user"
router="index.php"
@virtualadrian
virtualadrian / gen_cf_cidr.py
Created January 22, 2017 05:33 — forked from pahud/gen_cf_cidr.py
generate AWS CloudFront IP/CIDR range
#!/usr/bin/env python
import requests, json
d = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').text
l = json.loads(d)
for ip_range in [x['ip_prefix'] for x in l['prefixes'] if x['service']=='CLOUDFRONT' ]:
print ip_range
@virtualadrian
virtualadrian / hook-dns-01-lets-encrypt-route53.py
Created January 23, 2017 03:03 — forked from naa0yama/hook-dns-01-lets-encrypt-route53.py
Python 3 script to use as a hook for the letsencrypt.sh client
#!/usr/bin/env python3
# How to use:
#
# LE_HOSTED_ZONE=XXXXXX LE_AWS_PROFILE=dns-access ./letsencrypt.sh --cron --domain example.org --challenge dns-01 --hook /tmp/hook-dns-01-lets-encrypt-route53.py
#
# More info about letsencrypt.sh: https://github.com/lukas2511/letsencrypt.sh/wiki/Examples-for-DNS-01-hooks
# Using AWS Profiles: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles
# Obtaining your Hosted Zone ID from Route 53: http://docs.aws.amazon.com/cli/latest/reference/route53/list-hosted-zones-by-name.html
@virtualadrian
virtualadrian / Linux Static IP
Last active December 1, 2018 22:29 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@virtualadrian
virtualadrian / nagios_install.sh
Created February 8, 2017 21:44 — forked from kevinbin/nagios_install.sh
nagios install script
#!/bin/sh
# Any Failing Command Will Cause The Script To Stop
set -e
# Treat Unset Variables As Errors
set -u
NAGIOS_VERSION=3.5.0
PLUGIN_VERSION=1.4.16
@virtualadrian
virtualadrian / nagios_install.sh
Created February 8, 2017 21:44 — forked from kevinbin/nagios_install.sh
nagios install script
#!/bin/sh
# Any Failing Command Will Cause The Script To Stop
set -e
# Treat Unset Variables As Errors
set -u
NAGIOS_VERSION=3.5.0
PLUGIN_VERSION=1.4.16
@virtualadrian
virtualadrian / KVM-QEMU VNC over SOCKS
Created February 25, 2017 17:15 — forked from diginc/KVM-QEMU VNC over SOCKS
How to connect to KVM-QEMU guests over SSH SOCKS Proxy. EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ # EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ cat ~/.ssh/config
# Host Machines
Host host_a.prod.domain.com
User diginc
DynamicForward 127.0.0.1:1080
# Used with VNCViewer (RealVNC) like so (FullColor fixes the immediate disconnect bug)
# `vncviewer --ProxyServer=127.0.0.1:1080 --ProxyType=socks --FullColor 127.0.0.1:5901`