Skip to content

Instantly share code, notes, and snippets.

View d1rtym0nk3y's full-sized avatar

Chris Blackwell d1rtym0nk3y

View GitHub Profile
#!/bin/bash
export GH_PAGER=""
# Check if 4 arguments are passed
if [ "$#" -ne 4 ]; then
echo "Usage: $0 <organisation> <team> <repo pattern> <permission>"
exit 1
fi
@d1rtym0nk3y
d1rtym0nk3y / find_and_tag.sh
Created March 30, 2023 11:48
Find an image in aws ecr by image tag prefix and add new image tag
#!/usr/bin/env bash
set -e
REPO_TO_SEARCH="$1"
TAG_TO_FIND="$2"
NEW_TAG="$3"
FOUND_TAG=$(
aws ecr list-images \
--repository-name "$REPO_TO_SEARCH" \

Keybase proof

I hereby claim:

  • I am d1rtym0nk3y on github.
  • I am d1rtym0nk3y (https://keybase.io/d1rtym0nk3y) on keybase.
  • I have a public key ASDH7TScU9DQwelp74qNoQpR--qkBuWC84UKUQDQKSzKXwo

To claim this, I am signing this object:

<cfscript>
dStart = now().add(1, 'month').startOf('month');
dEnd = dStart.clone().endOf('month');
</cfscript>
<cfscript>
t = 'http://google.co.uk';
c = 100;
//warmup
javaGet(t);
cfmlGet(t);
benchmark('java', function() {
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="magepye" basedir="." default="main">
<property file="tests/properties/${BUILD_HOST}.properties" />
<property file="tests/properties/default.properties" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${test.mxunitdir}/ant/lib/mxunit-ant.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="tests/ant-contrib-1.0b3.jar"/>
//Application.cfc
component extends="fw1" {
// omiting all the usualy fw1 stuff..
function setupRequest() {
// this is just a wrapper around a singleton instance of the java class com.newrelic.api.agent.NewRelic
var nr = getBeanFactory().getBean("NewRelic");
// setup newrelic to track the this request
nr.setTransactionName( nullValue(), "/#getFullyQualifiedAction()#");
// track whatever custom values you need
nr.addCustomParameter( "session_id", session.sessionid );
@d1rtym0nk3y
d1rtym0nk3y / gist:6192227
Last active December 20, 2015 20:39
copy your public key to the authorized_keys file on a remote machine
cat ~/.ssh/id_rsa.pub | ssh root@server "(cat > tmp.pubkey ; mkdir -p .ssh ; touch .ssh/authorized_keys ; sed -i.bak -e '/$(awk '{print $NF}' ~/.ssh/id_rsa.pub)/d' .ssh/authorized_keys; cat tmp.pubkey >> .ssh/authorized_keys; rm tmp.pubkey)"
<cfsetting requesttimeout="999999" enablecfoutputonly="true" />
<cfscript>
progress("Importing data", 0);
recordcount = 100;
for(i=1; i<=recordcount; i++) {
// do something
sleep(250);
progress("Importing data", i, recordcount)
}
@d1rtym0nk3y
d1rtym0nk3y / Application.cfc
Created April 1, 2013 18:08
per application datasource parsed from environemnt variable with Railo 4.1
component {
sysenv = createObject("java", "java.lang.System").getenv();
dbUri = createobject("java", "java.net.URI").init(env("DATABASE_URL"));
this.datasources.default = {
class:'org.gjt.mm.mysql.Driver'
,connectionString:'jdbc:mysql://#dbUri.getHost()##dbUri.getPath()#?#dburi.getQuery()#'
,username: listfirst(dbUri.getUserInfo(), ":")
,password: listlast(dbUri.getUserInfo(), ":")