Skip to content

Instantly share code, notes, and snippets.

View dillera's full-sized avatar

Andrew Diller dillera

View GitHub Profile
@dillera
dillera / bootstrap-ruby.sh
Created February 10, 2012 20:44
Install Ruby with rbenv/ruby-build on Centos6 with openssl
#!/bin/bash
set -e # exit on error
### README
# * installs your desired ruby versions using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
# * put ssh-keys in place
@dillera
dillera / boss_me.sh
Last active October 2, 2015 15:28 — forked from erikh/hack.sh
OSX like a boss
#!/usr/bin/env sh
# Note- most of this is lifed from http://mths.be/osx - dotfiles
# 2013
###########################################################################
# Ask for the administrator password upfront
sudo -v
@dillera
dillera / bash
Created May 19, 2012 17:30 — forked from haf/bash
Installing graphite Ubuntu 11.10
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade

Setup a swap file in the stateful partition

Run these commands as root to create a 512 megabyte swap.

fallocate -l 512m /media/state/512MiB.swap
chmod 600 /media/state/512MiB.swap
mkswap /media/state/512MiB.swap
PROFILE=~/.bash_profile
sudo yum --enablerepo=rpmforge,epel,remi -y install gcc make zlib zlib-devel openssl-devel zsh
cd ~
test -d ~/.rbenv || git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
grep 'rbenv/bin' $PROFILE &>/dev/null || echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $PROFILE
grep 'rbenv init' $PROFILE &>/dev/null || echo 'eval "$(rbenv init -)"' >> $PROFILE
grep 'unset RUBYLIB' $PROFILE &>/dev/null || echo 'unset RUBYLIB' >> $PROFILE
test -d ~/ruby-build || git clone https://github.com/sstephenson/ruby-build.git ~/ruby-build
cd ~/ruby-build && sudo ./install.sh
source $PROFILE
@dillera
dillera / hack.sh
Last active September 25, 2021 22:37 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://gist.github.com/dillera/8108813/raw/ed65b97d3b910cb3536c3e522d4baebd442ff512/hack.sh | sh
#

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@dillera
dillera / ldap-helloWorld.rb
Created June 14, 2016 19:36 — forked from trepidity/ldap-helloWorld.rb
Example of connecting to eDirectory with a Ruby LDAP script
require 'rubygems'
require 'net/ldap' #gem install --no-rdoc --no-ri net-ldap
ldap = Net::LDAP.new :host => "172.16.138.142",
:port => 389,
:auth => {
:method => :simple,
:username => "cn=admin,o=novell",
:password => "n0v3ll"
}
@dillera
dillera / ldap2csv.py
Created June 14, 2016 19:59 — forked from JosefJezek/ldap2csv.py
Export Users from Active Directory / LDAP to CSV file with Python
#!/usr/bin/python
# http://www.packtpub.com/article/python-ldap-applications-ldap-opearations
# sudo apt-get install python-ldap
import ldap
host = 'ldap://example.com:389'
dn = 'ldap@example.com'