Skip to content

Instantly share code, notes, and snippets.

View richardjennings's full-sized avatar

Richard Jennings richardjennings

View GitHub Profile
docker run -v $PWD:/app --rm -it -w /app node:10.16-slim npm install semantic-ui
docker run -v $PWD:/app --rm -it -w /app/semantic node:10.16-slim /app/node_modules/gulp/bin/gulp.js build
docker run --rm -v $PWD:/usr/share/nginx/html -p 8080:80 nginx
@richardjennings
richardjennings / vm.go
Last active March 22, 2019 16:39
virtual machine in go with recursive Fibonacci call fib(35)
package main
import (
"fmt"
"io"
"os"
)
// Operations
type opcode uint8
-o Acquire::ForceIPv4=true
@richardjennings
richardjennings / gist:2dc24d274e7fb5340e1f39292cb37974
Created October 26, 2016 08:59
To get a list of packages installed locally
dpkg --get-selections | grep -v deinstall
#for docker
docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
#for docker-compose
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
@richardjennings
richardjennings / gist:77e7f5683f8cc6221f71da8f11524abc
Created October 11, 2016 12:51
copy file into paste buffer the easier way
cat file | xclip
$ echo "\\"
\
$ echo '\\'
\\
@richardjennings
richardjennings / gist:e74665231ace2a8ec50e40eda14a9f85
Created October 3, 2016 11:45
faster laptop boot with ubuntu server iface allow-hotplug
/etc/network/interfaces change eg. auto eth0 to eg. allow-hotplug eth0
@richardjennings
richardjennings / gist:9a727576829dcd507d6fb3ff5e04251b
Created September 14, 2016 13:50
php monolog stderr handler example
new \Monolog\Handler\StreamHandler("php://stderr", \Monolog\Logger::WARNING)