Skip to content

Instantly share code, notes, and snippets.

@dillera
dillera / make_fusion_box.sh
Created July 20, 2013 19:20
This bash script will create a vagrant box for you from a valid vmware fusion virtual machine directory. Currently, this is a manual process that is begging for any automation.
#!/bin/bash
#
# simple script to create a vagrant.box from a vmware fusion source VM
# andrew_diller@gmail.com July 2013
#
FUSIONTOOL='/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
METADATAFILE=metadata.json
if [ $# -lt 3 ]
@dillera
dillera / gist:6541129
Created September 12, 2013 17:31
Create VMware fusion Vagrant clones for Centos6
# Vagrant VMWare Fusion Centos6
# HOWTO by Andrew Diller, dillera@gmail.com
# July 2013 v.1
#
#
# Vagrant version 1.2.4
# vmrun version 1.12.1 build-1040386
# Fusion - Professional Version 5.0.3 (1040386)
#
#

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 / gist:590b9f62c0b8a9d4d595
Created August 13, 2015 23:44
notes for fedlet on Acer Switch 10
# Power seems to be working
[89065.240448] PM: Preparing system for sleep (freeze)
[89065.240644] Freezing user space processes ... (elapsed 0.150 seconds) done.
[89065.391305] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[89065.392692] PM: Suspending system (freeze)
[89065.392699] Suspending console(s) (use no_console_suspend to debug)
[89067.525590] PM: suspend of devices complete after 2129.860 msecs
[89067.539839] PM: late suspend of devices complete after 14.220 msecs
[89067.551647] PM: noirq suspend of devices complete after 11.776 msecs
@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'