Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rtyley on github.
  • I am rtyley (https://keybase.io/rtyley) on keybase.
  • I have a public key ASDNSo21lA7sOLv5YBCLn4tHBBbgRX1UpBHnk2spE92BOwo

To claim this, I am signing this object:

Nov 25 14:11:34 prout-bot app/web.1: [info] l.RepoSnapshot$$anon$1 - 51795214 going to do TravisCI({"script":"sbt ++$TRAVIS_SCALA_VERSION acceptance-test-buy-sub","after_script":"./test_feedback.sh"})
Nov 25 14:11:34 prout-bot app/web.1: [info] l.t.TravisApiClient - requestBuild on guardian/subscriptions-frontend response=Failure(com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'you': was expecting ('true', 'false' or 'null')
Nov 25 14:11:34 prout-bot app/web.1: at [Source: buffer(okio.GzipSource@582745c7).inputStream(); line: 1, column: 5])
@rtyley
rtyley / gist:b97c096ef1895a68570c
Created June 3, 2015 15:01
Running `sbt release` on guardian/content-api-scala-client
$ sbt
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[info] Loading global plugins from /home/rtyley/.sbt/0.13/plugins
[info] Loading project definition from /home/rtyley/development/content-api-scala-client/project/project
[info] Loading project definition from /home/rtyley/development/content-api-scala-client/project
[info] Compiling 1 Scala source to /home/rtyley/development/content-api-scala-client/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to content-api-client (in build file:/home/rtyley/development/content-api-scala-client/)
> release
[info] Starting release process off commit: 618334c0da8ad16e24f774cfe9dd84f0af60c85d
[info] Checking remote [origin] ...
@rtyley
rtyley / getNewishNodeJSOnUbuntu.sh
Last active January 4, 2016 03:29
How to get a reasonably up-to-date Node.js install on Ubuntu
# nodejs packages before Ubuntu 13.10 are currently very out of date:
# http://packages.ubuntu.com/search?keywords=nodejs
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
implicit class TextFieldOps(field: TextField) {
/** Returns a stream of text field values entered in the given text field.
*
* @param field the text field
* @return an observable with a stream of text field updates
*/
def textValues: Observable[String] = Observable {
observer => {
val reaction: Reaction = {
@rtyley
rtyley / verify-pack.txt
Created August 2, 2013 10:25
See http://stackoverflow.com/q/18010820/438886 - my particular object is 7daa9e75f86aa168748aef6c16c76b2acee1acca
This file has been truncated, but you can view the full file.
0614483723ddf336271ebb2440c023d705f18286 commit 247 167 12
4f280637fab0ebe534f29574578948e9a17845af commit 283 198 179
63cea2b1982ca95401f49980328e892638675e28 commit 242 160 377
172ca64bc5ee785745abf1f0ee9d6288cac94093 commit 247 165 537
a498008d08cd4fff61a5ab9f2cd75e00d1e779aa commit 242 164 702
ac14b7f5bcc04e17a2422d78a0d52b261597bb57 commit 242 160 866
88c60531e759371d81fed11a4c82143d65be5fcd commit 247 166 1026
56464bcbf42bb0ff63b7543ffb76ef10ebb5faa7 commit 242 163 1192
c5ddf157ceebdb5cc881ee6c3ed37bffbaf80fd0 commit 249 168 1355
6c40c0e4f697b6af7b35027e9c7be78c0f04b322 commit 250 168 1523
@rtyley
rtyley / gist:5673862
Created May 29, 2013 21:09
Create a bad repo that contains a folder named '.git'
implicit val repo = unpackRepo("/sample-repos/example.git.zip")
implicit val (revWalk, reader) = repo.singleThreadedReaderTuple
val inserter = repo.newObjectInserter()
val badTree = Tree(Seq(Tree.Entry(".git", FileMode.TREE, abbrId("8d28f5"))))
val badTreeId = badTree.formatter.insertTo(inserter)
val treeContainingBadTree = Tree(Seq(Tree.Entry("foo", FileMode.TREE, badTreeId)))
val treeContainingBadTreeId = treeContainingBadTree.formatter.insertTo(inserter)
@rtyley
rtyley / replace-with-sha.sh
Created December 4, 2012 12:18
Accepts a list of 'bad' blob ids, and replaces them with a 'xxx.REMOVED.sha' placeholder
#! /usr/bin/env sh
TREEDATA=$(git ls-tree -r $2 | grep ^.......blob | cut -c13-)
while IFS= read -r line ; do
echo "$TREEDATA" | grep ^$line | cut -c42- | xargs -n1 -iX sh -c "echo $line > 'X.REMOVED.sha' && rm 'X'" &
done < $1
wait
@rtyley
rtyley / get-blob-filenames.sh
Last active October 13, 2015 13:28
Gets a list of all blobs ever contained in your repo, along with their associated filename (quite slow)
git verify-pack -v .git/objects/pack/*.idx | grep tree | cut -c1-40 | xargs -n1 -iX sh -c "git ls-tree X | cut -c8- | grep ^blob | cut -c6-" | sort | uniq
@rtyley
rtyley / get-500-biggest-blobs.sh
Last active September 13, 2022 10:54
Gets the top 500 biggest blobs in your repo, ordered by size they occupy when compressed in the packfile
git verify-pack -v .git/objects/pack/*.idx | grep blob | cut -c1-40,48- | cut -d' ' -f1,3 | sort -n -r --key 2 | head -500 > top-500-biggest-blobs.txt