Skip to content

Instantly share code, notes, and snippets.

View shirkey's full-sized avatar

shirkey shirkey

View GitHub Profile
@shirkey
shirkey / gist:4238621
Created December 8, 2012 04:28
Copy local IP addresses from shell to X clipboard buffer (requires xsel package)
alias pbcopy='xsel --clipboard --input'
function ip {
IP=$(ifconfig | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | cut -c 6-)
echo $IP
echo $IP | pbcopy
}
@shirkey
shirkey / install_graphite_statsd_ubuntu_precise.sh
Last active December 10, 2015 02:29 — forked from bhang/install_graphite_statsd_ubuntu_precise.sh
Added support for Ubuntu 12.10, default aptitude installs to accept (-y)
#!/bin/bash
# node.js using PPA (for statsd)
# if < Ubuntu 12.10
sudo apt-get install -y python-software-properties
# if >= Ubuntu 12.10
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:chris-lea/node.js
sudo apt-get update
@shirkey
shirkey / install_dokku_to_debian_wheezy
Created February 21, 2014 17:54
Installation of Dokku to Debian Wheezy -- fixes some repository pointers that would otherwise fail during the standard installation script for Dokku v0.2.1
#######################################################################################################################
#
# Purpose: Bash script to fix a few elements of the default Dokku script with running correctly on Debian Wheezy
# Author: Shirkey <dev@shirkey.me>
# License: MIT
# Tested with:
# * Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
# * v0.2.1 of Dokku installer script
#
#######################################################################################################################
@shirkey
shirkey / .bashrc-dovecot-helper
Last active August 29, 2015 13:56
dovecot-password_generator_shell_functions
function password () {
echo "$(< /dev/urandom tr -dc "A-Za-z0-9" | head -c${1:-16};echo;)"
}
function dovecot-hash(){
if [ -z "${1}" ]
then
echo "requires password to be hashed -- exiting"
return 1
else
echo $(doveadm pw -p ${1} -s sha512 -r 100)
@shirkey
shirkey / disable-isc.ps1
Created July 23, 2017 10:22
disable IE Enhanced Security Configuration (IE ISC) via PowerShell
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073S}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
Stop-Process -Name Explorer
@shirkey
shirkey / install-ad-tools.ps1
Created July 23, 2017 10:23
install AD tools on Windows Server (via PowerShell)
Import-Module ServerManager
Add-WindowsFeature RSAT-ADDS-Tools
@shirkey
shirkey / disable-ipv6.sh
Created August 7, 2017 13:31 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf