Skip to content

Instantly share code, notes, and snippets.

@wolfg1969
wolfg1969 / git_find_big.sh
Created December 28, 2014 01:37
Shows you the largest objects in your repo's pack file.
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences
@wolfg1969
wolfg1969 / mysql2mongo.py
Created October 1, 2014 03:40
import mysql tables into mongodb
#!/bin/env python
import sys
from decimal import Decimal
from optparse import OptionParser
from pymongo import MongoClient
from pymongo.son_manipulator import SONManipulator
import MySQLdb
import MySQLdb.cursors
@wolfg1969
wolfg1969 / create_eb_env.sh
Created August 4, 2014 01:45
create a eb environment
#!/usr/bin/env bash
set -e
EB_CLI_HOME=$1
APP_NAME=$2
CONFIG_NAME=$3
export AWS_CREDENTIAL_FILE=/var/lib/jenkins/.elasticbeanstalk/aws_credential_file
export PATH=$PATH:$EB_CLI_HOME/api/bin/
@wolfg1969
wolfg1969 / const.py
Created July 28, 2014 11:42
Constants in Python
# http://code.activestate.com/recipes/65207-constants-in-python/?in=user-97991
class _const(object):
class ConstError(TypeError):
pass
class ConstCaseError(ConstError):
pass
@wolfg1969
wolfg1969 / public_ip.config
Created April 7, 2014 01:05
set public ip for elastic beanstalk
Resources:
AWSEBAutoScalingLaunchConfiguration:
Type: "AWS::AutoScaling::LaunchConfiguration"
Properties:
"AssociatePublicIpAddress" : "true"
module.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on('click', function () {
this.select();
});
}
};
});
@wolfg1969
wolfg1969 / adduser.sh
Created November 28, 2013 12:14
Run adduser non-interactively
#!/bin/bash
adduser --home /home/user --disabled-password --gecos "" --quiet user
@wolfg1969
wolfg1969 / install-jdk-non-interactively.sh
Last active December 29, 2015 15:29
Install jdk on Debian/Ubuntu non-interactively
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
add-apt-repository -y ppa:webupd8team/java
apt-get update && apt-get upgrade -y
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
apt-get install -y oracle-java7-installer oracle-java7-set-default
@wolfg1969
wolfg1969 / pypiserver.conf
Last active February 26, 2022 03:02
pypiserver.wsgi
<VirtualHost *:80>
ServerAdmin foo@bar.com
ServerName pypi.dev.example.com
ErrorLog logs/pypiserver-error_log
CustomLog logs/pypiserver-access_log common
DocumentRoot /var/www/html
<Directory /var/www/html>
Order allow,deny
Allow from all