Skip to content

Instantly share code, notes, and snippets.

What a mess I've made

Stephen Jennings jennings

What a mess I've made
View GitHub Profile
jennings /
Last active Sep 27, 2015
Miscellaneous Git commands

Rebase the changes branch-base..branch-head onto the master branch

git rebase --onto master branch-base branch-head

Cherry-pick the changes in B since it diverged from A onto the current branch

git checkout base-branch
git cherry-pick A..B
jennings / BatchfileTricks.cmd
Last active Jun 15, 2020
Stupid batch file tricks
View BatchfileTricks.cmd
:: Sleep for N seconds:
ping localhost -n N -w 1
:: Get the date and time (US LOCALE ONLY)
set YEAR=%DATE:~-4,4%
set TWOYEAR=%DATE:~-2,2%
jennings / install-rhodecode.rst
Last active Oct 31, 2018
Step-by-step instructions for installing RhodeCode 1.3.6 on Ubuntu Server 12.04 with Nginx 1.2.1 as the reverse proxy. This was written when these were the latest versions; add a comment if the scripts need to change to accommodate changes in newer versions.The script assumes you want to use a SQLite database. Sorry, you'll need to find another …
View install-rhodecode.rst

Setting up RhodeCode on Ubuntu Server 12.04


  • Everything running on a single Ubuntu Server
  • RhodeCode running in a virtualenv
  • Use SQLite as the database
jennings / UpdateQuery.sql
Created Jul 31, 2012
Composing an update query
View UpdateQuery.sql
--- While composing an update query, it's useful to use
--- a SELECT statement first to make sure you're going to
--- update the correct rows. Formatting the query in
--- this manner lets you alternate between SELECT and UPDATE
--- without commenting and uncommenting parts of the query.
-- UPDATE TableToUpdate --- Use ALT + Drag to highlight this update
jennings /
Last active Dec 9, 2015
Various OS X setup commands
# Lots of these are from
# Allow key repeat instead of pop-up accent selector in OS X 10.8
defaults write -g ApplePressAndHoldEnabled -bool false
# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
# Show the ~/Library folder
chflags nohidden ~/Library
jennings / UpdateSysinternals.cmd
Created Jan 12, 2013
Automatically update a folder full of Sysinternals tools
View UpdateSysinternals.cmd
@echo off
pushd \\\tools
xcopy * %~dp0 /Y /D
jennings /
Created May 22, 2013
Lists all objects in a Git database and lists them in descending order of size.
# From:
git rev-list --objects --all | sort -k 2 > allfileshas.txt
git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r > bigobjects.txt
for SHA in `cut -f 1 -d\ < bigobjects.txt`; do
echo $(grep $SHA bigobjects.txt) $(grep $SHA allfileshas.txt) | awk '{one=$1; three=$3;$1=$2=$3=$4=$5=$6=""; print one,three,$0}' >> bigtosmall.txt
jennings /
Last active Dec 17, 2015
Tools I'm using to join a few unrelated repositories into one
# Combines together unrelated branches into the current commit.
# Usage: <merge-head>+
# repo1/stuff repo2/stuff
NEW_TREE=$(mktemp -t $(basename $0))
jennings /
Last active Dec 31, 2015
Makes the repository selectors in Bitbucket wider so long repository names don't get cut off. Works in Chrome or (hopefully) Firefox with Greasemonkey.

Chrome installation

  1. Click here
  2. Click OK on the warning, the file will be downloaded.
  3. Open chrome://extensions and drag the downloaded file onto the extensions page.

Firefox installation

  1. Install Greasemonkey
  2. Click here and install the script.
jennings / web.config
Created Mar 11, 2014
Enable WCF message logging
View web.config
<source name="System.ServiceModel"
<add name="messages"
initializeData="c:\inetpub\logs\messages.svclog" />
You can’t perform that action at this time.