Skip to content

Instantly share code, notes, and snippets.

@johnelliott
johnelliott / wifi.yaml
Last active March 12, 2016 16:40
pi wifi
---
- name: 'Configure WIFI'
copy: src=./wpa_supplicant.conf dest=/etc/wpa_supplicant/wpa_supplicant.conf mode=0600
# https://github.com/motdotla/ansible-pi/blob/master/roles/pi/tasks/main.yml
@johnelliott
johnelliott / gist:60b44e0cafb247abf59e
Last active March 19, 2019 14:00
Remove Docker contrainers with grep
Example: want to remove all things with ubuntu 14.04..
remove docker contrainers with grep:
```~/dev/practice/docker
$ docker ps -a |grep 14.04|cut -d" " -f 1|xargs -n 3 docker rm
ffefde7fe6ac
74f390d831e4
3c9750561f25
e34ab210baff
114af06a2e33
@johnelliott
johnelliott / gist:7631fd23312b2916a11d
Last active March 25, 2016 19:24
docker tips on OSX
# run these to clear up virtualbox space
$ docker rm -f $(docker ps -a -q)
$ docker rmi -f $(docker images -af "dangling=true" -q)
# export a docker machine ip
```bash
export DOCKER_MACHINE_IP=$(docker-machine ip $DOCKER_MACHINE_NAME)
```
@johnelliott
johnelliott / colors.sh
Last active December 1, 2018 03:52
terminal colors test
#!/bin/bash
# tput_colors - Demonstrate color combinations. http://linuxcommand.org/lc3_adv_tput.php
for fg_color in {0..7}; do
set_foreground=$(tput setaf $fg_color)
for bg_color in {0..7}; do
set_background=$(tput setab $bg_color)
echo -n $set_background$set_foreground
printf ' F:%02s B:%02s ' $fg_color $bg_color
@johnelliott
johnelliott / server.js
Last active April 10, 2016 20:42
pedestrian
var http = require('http');
var dup = require('./ped-duplex-stream.js');
var staticServer = require('ecstatic')({ root: __dirname + '/public' });
// Set up application data server
var server = http.createServer(function(req, res) {
if (req.url == '/api') {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('This is API data');
# convert comes form graphicsmagick
# https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/
# http://www.cyberciti.biz/faq/linux-unix-bsd-xargs-construct-argument-lists-utility/
# For Google / webmanifest
echo 144 192 256 384 512 |xargs -n1 -I% convert ../wb-logo-base.png -resize % public/images/icon-%x%.png
# favicon
convert ../wb-logo-base.png -resize 16 public/images/favicon.ico
#!/bin/bash
ffmpeg -safe 0 -f concat -i <(printf "file '$PWD/%s'\n" ./*.wav) -c copy output.wav
@johnelliott
johnelliott / get-vimrc.sh
Last active April 26, 2018 00:18
get vimrc
#!/bin/sh
curl -XGET https://raw.githubusercontent.com/johnelliott/master/.vimrc > ~/.vimrc
PS1='\[\033[01;33m\]\u@\h\[\033[00m\] \[\033[00m\]\W \$ ';
export PS1;
PS2="\[\033[01;33m\]→ \\[\033[00m\]";
export PS2;
@johnelliott
johnelliott / .bash_profile
Created November 12, 2016 23:09
mobile dotfiles
source ~/.bash_prompt;
# Make NVM available
export NVM_DIR="/Users/john/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob;
# Append to the Bash history file, rather than overwriting it