Skip to content

Instantly share code, notes, and snippets.

View alexclifford's full-sized avatar

Alex Clifford alexclifford

  • Melbourne, Australia
View GitHub Profile
@alexclifford
alexclifford / s3_set_object_public.sh
Created July 24, 2015 01:59
Make S3 object public and private via s3cmd command line
s3cmd setacl s3://bucket/path/to/file --acl-public
s3cmd info s3://bucket/path/to/file
s3cmd setacl s3://bucket/path/to/file --acl-private
@alexclifford
alexclifford / get_esxi_guest_ip_address.sh
Last active October 31, 2023 09:08
ESXi: get the IP address of a host running VMware tools
#!/bin/bash
vim-cmd vmsvc/getallvms | grep -i hostname | cut -d ' ' -f 1 | xargs vim-cmd vmsvc/get.guest | grep ipAddress | sed -n 1p | cut -d '"' -f 2
# or
ssh esxi.example.com /bin/vim-cmd vmsvc/get.guest $(ssh esxi.example.com /bin/vim-cmd vmsvc/getallvms | grep -i hostname | cut -d ' ' -f 1) | grep ipAddress | sed -n 1p | cut -d '"' -f 2
@alexclifford
alexclifford / sources.list
Created June 24, 2014 00:21
Ubuntu sources.list mirrors
# Automagically works out which mirror is the fastest and uses that
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
@alexclifford
alexclifford / .vimrc
Last active March 18, 2020 15:41
My old .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set noexpandtab
set copyindent
set preserveindent
set softtabstop=0
set shiftwidth=8
set tabstop=8
set hlsearch
// Launch Options
// -high -novid -dxlevel 81 -lv -nojoy -noaafonts -threads 4 +exec autoexec.cfg
con_enable "1"
cl_autowepswitch "0"
cl_use_opens_buy_menu "0"
closeonbuy "1"
// Mouse
sensitivity "0.9"
@alexclifford
alexclifford / add_sftp_user.sh
Last active May 25, 2018 15:26
Quick script for adding a new SFTP user/directory to an existing SFTP setup on Ubuntu.
#!/bin/sh
######################################################
# Create a new SFTP user and configure their chroot
######################################################
if [ $# -ne 2 ]; then
echo "Usage: add_sftp_user.sh username password"
exit 0
fi
// Buy Binds
// Hold down Alt to activate weapon buy binds on
// 1 2 3
// Q W E
// A S D
// Z X C
bind "alt" "+bs"
bind 1 "1a"
bind 2 "2a"
// Package ddblock provides a...
// TODO:
package ddblock
import (
"errors"
"fmt"
//"runtime"
"strconv"
"sync"
@alexclifford
alexclifford / vim_auto_indent.instructions
Created May 2, 2016 00:29
Enable automatic HTML indenting in VIM
:filetype indent on
:set filetype=html
:set smartindent
gg=G
@alexclifford
alexclifford / export_moin_wiki.sh
Created March 28, 2014 00:43
Export a MoinMoin wiki to HTML
#!/bin/bash
cd /path/to/moinmoin/
moin --config-dir= --wiki-url=wiki.example.com export dump --target-dir=moin_export/
tar -czf moin_export.tar.gz moin_export