Skip to content

Instantly share code, notes, and snippets.

@willm
willm / script.sh
Last active January 19, 2017 17:11
bash script prelude
#!/usr/bin/env bash
set -euxo pipefail
#-e stop if a command fails
#-u error and stop if any variable is unset
#-x print each command before running it
#-o pipefail fail as soon as a command within a pipeline fails
@willm
willm / get-domain-controller-ip.md
Created January 13, 2017 11:55
get domain controller ip
  1. Start -> Run -> nslookup
  2. $ set type=all
  3. $ _ldap._tcp.dc._msdcs
@willm
willm / openshift-cheat.md
Created October 20, 2016 12:06
Openshift cheat sheet

Get a resource

oc get bc/your-app -o yaml

Apply a change to a resource

note: openshift will moan at you if your file has the resourceVersion property, remove this before applying your change oc apply -f your-resource.yaml

@willm
willm / get-dns-servers.sh
Last active October 13, 2016 15:04
show which dns nameservers you are currently using
nmcli dev show | grep DNS
@willm
willm / pretty-print.sh
Last active August 10, 2016 11:32
pretty print json
cat file.json | python -m json.tool
@willm
willm / linux.md
Last active June 11, 2020 07:28
Linux cheat sheet

Users

Set home directory

usermod -m -d $path $user

Add to group

usermod -aG $group $user

Network

Which dns servers am I using

@willm
willm / cmus.md
Last active June 26, 2019 06:21
Cmus cheat sheet

File view 5

a - add file/folder

Library view 2

c - play / pause

v - stop

@willm
willm / dynamo cheet sheet.sh
Last active April 12, 2018 23:45
dynamo cheat sheet
#count of items
aws dynamodb scan --table-name baskets --select COUNT
#item by key
aws dynamodb get-item --table-name baskets --key '{"Id":{"S": "195eaf9c-50e6-4524-81e0-22403e46b6df"}}'
@willm
willm / 7digital-api.d.ts
Last active March 19, 2016 08:47
7digital api typescript defs
declare module '7digital-api' {
namespace Responses {
interface ApiResponse {
status: string;
version: string;
}
interface BasketResponse extends ApiResponse {
basket: Basket;
}
interface AmountDue {
@willm
willm / Ionic cheat sheet
Last active March 18, 2016 08:54
Ionic
ionic run --devices (run on your phone)