Skip to content

Instantly share code, notes, and snippets.

@vrillusions
vrillusions / gist:446491
Created June 21, 2010 06:31
Reminder to self on converting svn repos
# Permanently move a subversion repos to git
# If you have tags and branch but never used them you can do this:
git svn clone -s --no-metadata --authors-file ~/git_resources/authors https://example.com/svn/repos
git remote add origin [email protected]:username/repo.git
git push -u origin master
# Don't forget to add a README.markdown file.
#
# optionally use git clone on the repository again, this will remove all the svn stuff from
# .git/config file. If you push to github all you need to do is do the initial push and then
@vrillusions
vrillusions / Post_github_tasks.sh
Created February 23, 2011 18:37
Additional git configuration that needs to be done after the initial setup on github
#!/bin/bash
#
# The "getting started" when creating a new project doesn't cover how to setup git so
# you can do operations like `git push` without having to specify the branch each time.
# This fixes that.
#
git config branch.master.remote origin
git config branch.master.merge 'refs/heads/master'
@vrillusions
vrillusions / gist:1216854
Created September 14, 2011 15:20
gtk+ 2.4.26 compile error in homebrew - 2011-09-14
teddy@teddy:~ $ brew doctor
Your system is raring to brew.
teddy@teddy:~ $ brew update
Already up-to-date.
teddy@teddy:~ $ brew info gtk+
gtk+ 2.24.6
http://www.gtk.org/
Depends on: pkg-config, glib, jpeg, libtiff, gdk-pixbuf, pango, jasper, atk
@vrillusions
vrillusions / README
Created January 6, 2012 20:34 — forked from jfretin/README
Use bitbucket as a private offsite code backup (edited)
Now that bitbucket supports git, it's easy to use their service as a free, private, offsite code backup. Just create an empty repo for your project on bitbucket, add it as a remote to your development repo:
username@host:~/project$ git remote add bitbucket [email protected]:username/project.git
Edit: I had to change in the config file the url value to set the complete https url: https://[email protected]/username/project.git
and use this post-commit hook to silently and automatically push your changes up after each commit.
@vrillusions
vrillusions / README.mkd
Created January 9, 2012 16:27
Generate a list of commands with a date parameter

At one point at work I needed to run a script several times. As a quick and dirty hack I made this python file that just gives me a list. I then ran it several times changing the month. It's quick, it's messy, but it worked.

@vrillusions
vrillusions / resque.py
Created June 1, 2012 00:29 — forked from defunkt/resque.py
Resque client in Python
from redis import Redis
import simplejson
class Resque(object):
"""Dirt simple Resque client in Python. Can be used to create jobs."""
redis_server = 'localhost:6379'
def __init__(self):
host, port = self.redis_server.split(':')
self.redis = Redis(host=host, port=int(port))
@vrillusions
vrillusions / SEE_GITHUB_REPO.mkd
Last active December 9, 2015 23:49
Moved this to a project on my github page
@vrillusions
vrillusions / README.mkd
Created April 29, 2013 20:15
Generate gpg key via batch file

Introduction

This is how to create a gpg key without any user interaction or password. This can be used in cases where the primary goal is to secure the data in transit but the gpg key can/must be stored locally without a password. An example of this is the hiera-gpg plugin which doesn't support passwords.

The below genkey-batch file will use the default which currently are RSA/RSA and 2048 bit length. See the reference link to set this to something else.

References

@vrillusions
vrillusions / ldap-ssha.php
Created May 3, 2013 14:22
Sample function that creates an SSHA has for ldap - haven't fully tested
<?php
function hash_password($password) {
if (@is_readable('/dev/urandom')) {
$f=fopen('/dev/urandom', 'rb');
$salt=fread($f, 4);
fclose($f);
} else {
die('Could not query /dev/urandom');
}
return '{SSHA}' . base64_encode(sha1( $password.$salt, TRUE ). $salt);
@vrillusions
vrillusions / shell.sh
Last active October 29, 2018 20:51
workflow to filter out several folders from a git repo.
git clone example.com:/url/to/project.git
cd project
# these next few commands show how to rename branch "mybranch" to master
git checkout mybranch
git branch -d master
git checkout -b master
git branch -d mybranch
# remove orgin to make sure we don't accidentally do anything there
git remote rm origin
# none of the tags apply to mybranch