Skip to content

Instantly share code, notes, and snippets.

View swyngaard's full-sized avatar
🌍
Hello!

Sebastian Wyngaard swyngaard

🌍
Hello!
View GitHub Profile
@swyngaard
swyngaard / docker-compose.yml
Created April 18, 2019 17:29
Private geth node in dev mode
version: "3"
services:
ethereum:
image: ethereum/client-go:v1.8.27
restart: unless-stopped
volumes:
- eth-data-vol:/ethdat
ports:
- "8545:8545"
command: ["--dev", "--rpc", "--rpcaddr", "0.0.0.0", "--datadir", "/ethdat"]
@swyngaard
swyngaard / docker-compose.yml
Last active March 11, 2019 19:42
GoCD docker compose configuration file
version: "3"
services:
gocd_server:
image: gocd/gocd-server:v18.12.0
restart: unless-stopped
environment:
- GOCD_PLUGIN_INSTALL_git-fb-poller=https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases/download/v1.3.5/git-fb-poller-1.3.5.jar
- GOCD_PLUGIN_INSTALL_github-pr-poller=https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases/download/v1.3.5/github-pr-poller-1.3.5.jar
- GOCD_PLUGIN_INSTALL_github-pr-status=https://github.com/gocd-contrib/gocd-build-status-notifier/releases/download/1.4/github-pr-status-1.4.jar
- GOCD_PLUGIN_INSTALL_github-oauth=https://github.com/gocd-contrib/github-oauth-authorization-plugin/releases/download/2.2.0/github-oauth-authorization-plugin-2.2.0-21.jar
@swyngaard
swyngaard / flask_ubuntu.md
Last active August 30, 2018 00:04
Install Flask on Ubuntu 16.04

Install Flask on Ubuntu 16.04

sudo aptitude install --with-recommends python3-pip python3-dev nginx uwsgi uwsgi-plugin-python3 virtualenv
mkdir sensor-logger
cd sensor-logger
virtualenv --python=python3 .venv
source .venv/bin/activate
pip install -r requirements.txt
#start the application
python server.py
@swyngaard
swyngaard / ipfs.md
Last active August 15, 2019 13:51
Install IPFS on Ubuntu 16.04

#Install IPFS on Ubuntu 16.04

Pre-requisites

Ensure your user has sudo access

Install IPFS executable

Download the IPFS go client using wget:

wget https://dist.ipfs.io/go-ipfs/v0.4.13/go-ipfs_v0.4.13_linux-amd64.tar.gz

Uncompress the archive file:

@swyngaard
swyngaard / unix_date.md
Last active November 17, 2017 16:31
Convert between millisecond epoch timestamps and unix date

Convert between millisecond timestamps and unix date

Get current time as millisecond timestamp

date +%s%3N

Convert millisecond timestamp to Unix date

date -d @$[1510935504891 / 1000]
@swyngaard
swyngaard / manual_flash_update.md
Last active October 6, 2017 00:08
Manually download Flash plugin for Firefox

Manually download Flash plugin for Firefox

If the Debian package flashplugin-nonfree is installed but not functioning you can use the attached script to update the plugin from a link to the tarball.

Usage

Run the script with the default link:

./update_flash.sh

Alternatively, execute the script with your own link to the Flash archive

./update_flash.sh https://fpdownload.adobe.com/get/flashplayer/pdc/27.0.0.130/flash_player_npapi_linux.x86_64.tar.gz
@swyngaard
swyngaard / lxc_migrate.md
Last active July 15, 2018 21:06
Migrate unprivileged LXC container to a new host

Migrate unprivileged LXC container to a new host

Shutdown the container

lxc-stop -n $NAME

Archive container rootfs and config

cd $HOME/.local/share/lxc/$NAME
sudo -s
tar --numeric-owner -czvf container_fs.tar.gz ./*
@swyngaard
swyngaard / inotify.md
Created September 22, 2017 20:07
Configure inotify to correctly run watchman on Debian 9 Stretch

Configure inotify to correctly run watchman

Install packages

sudo aptitude install inotify-tools

Configure max user watches

The default maximum user watches is 8192. Double that number by running the command as root:

echo 16384 > /proc/sys/fs/inotify/max_user_watches
@swyngaard
swyngaard / gogs.md
Last active November 6, 2018 10:28
Install Gogs in Debian 9 strech

Install Gogs in Debian 9 Stretch

Install and configure PostgreSQL

sudo aptitude install postgresql postgresql-client
sudo adduser gogsuser
sudo su - postgres
createuser -P gogsuser
createdb -O gogsuser gogs
logout
@swyngaard
swyngaard / neofetch.md
Created September 16, 2017 13:07
Install Neofetch Debian 9 Stretch

Install Neofetch Debian 9 Stretch

Install neofetch on a server to display useful information when a user logs in.

Install package

sudo aptitude install neofetch

Configure output (optional)

Edit the file /usr/share/neofetch/config as superuser root to display desired information.

Disable MOTD SSH login message

Edit or comment out all lines in /etc/update-motd.d/10-uname. Remove all lines from /etc/motd to remove the message of the day notice.