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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
I moved what I was trying to show here to https://github.com/vrillusions/puppet-resolv and leaving this around for people that still have the link to it.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer