Skip to content

Instantly share code, notes, and snippets.

View marcransome's full-sized avatar

Marc Ransome marcransome

View GitHub Profile
@marcransome
marcransome / git-obj-walk.sh
Last active March 8, 2024 17:03
git-obj-walk.sh
#!/bin/bash
set +o pipefail
if (( $# != 1 )); then
echo "usage: $0 <ref>" >&2
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
@marcransome
marcransome / get_concourse_bearer_token.sh
Last active February 6, 2024 15:00
Concourse OAuth bearer token retrieval
#!/bin/bash
required_env_vars=(
CONCOURSE_ENDPOINT
CONCOURSE_USERNAME
CONCOURSE_PASSWORD
)
for env_var in "${required_env_vars[@]}"; do
if [[ -z "$(printenv ${env_var})" ]]; then
@marcransome
marcransome / .Xresources
Last active June 17, 2022 16:25
xterm settings for XQuartz
! Font face and size
XTerm*faceName: mononoki
XTerm*faceSize: 12
! Window settings
XTerm.vt100.geometry: 112x40
! General colours
XTerm*highlightReverse: false
XTerm*highlightColor: #C1DDFF
@marcransome
marcransome / clippy.cow
Last active June 17, 2022 16:07
sure.fish
$the_cow = <<EOC;
|
v
__
/ \
| |
@ @
|| ||
|| ||
\___/
@marcransome
marcransome / git-vim-fix.md
Last active July 24, 2017 22:21
git commit error using vim 8.0.740+

Error:

$ git commit
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

Fix:

server {
listen 80;
server_name test.dev;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8080;
}
}
function proxy {
for env_var in http_proxy HTTP_PROXY https_proxy HTTPS_PROXY; do
export $env_var=''
done
export no_proxy="localhost,127.0.0.1"
}
proxy
function noproxy {
for env_var in http_proxy HTTP_PROXY https_proxy HTTPS_PROXY; do

Keybase proof

I hereby claim:

  • I am marcransome on github.
  • I am marcransome (https://keybase.io/marcransome) on keybase.
  • I have a public key ASBZWoIk_280bRa6txmK8vHF-LY5gdvGG24M18V52d7qQAo

To claim this, I am signing this object:

set DESIRED_JDK "1.8"
if set JDK (/usr/libexec/java_home -F -v $DESIRED_JDK ^ /dev/null)
set -x JAVA_HOME $JDK
else
echo "Desired JDK version not found ($DESIRED_JDK)"
end
@marcransome
marcransome / pack
Last active October 29, 2015 19:42
Box packing script for Vagrant VMWare plugin.
#!/bin/bash
#
# Copyright (c) 2015 Marc Ransome <marc.ransome@fidgetbox.co.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: