Skip to content

Instantly share code, notes, and snippets.

View kgust's full-sized avatar

Kevin Gustavson kgust

  • Vanderbilt University Medical Center
  • Nashville, Tennessee USA
View GitHub Profile
@kgust
kgust / README.md
Last active May 29, 2019 13:02 — forked from ralphschindler/README.md
Docker For Mac - De-facto Host Address Alias (10.254.254.254) - "The 10254 Trick".

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254

Installation

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

sudo curl -o /Library/LaunchDaemons/info.kevingustavson.docker_10254_alias.plist https://gist.github.com/kgust/3fe1ae7420e2b35ed3b40eb3feef4efe/raw/info.kevingustavson.docker_10254_alias.plist
@kgust
kgust / docker-info.md
Last active September 12, 2016 22:21
Useful Docker (For Mac) Information

To reduce the Docker.qcow2 size (there is an offical solution pending)

  1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
  2. login as root
  3. dd if=/dev/zero of=/mnt/docker/zero bs=4096 to fill zero bytes into the free space of the ext4 file system under Docker.qcow4, until the disk is full
  4. rm /mnt/docker/zero then all the free space of Docker.qcow2 would be filled with zeros
  5. logout, and detach screen
  6. Finally reduce the the Docker.qcow2 file size, /Applications/Docker.app/Contents/MacOS/qemu-img convert -O qcow2 Docker.qcow2 Docker2.qcow2

Interface alias

sudo ifconfig lo0 alias 10.254.254.254

@kgust
kgust / developer resources.md
Last active September 26, 2016 12:43
Time to create a curated list of developer resources…
@kgust
kgust / client.js
Created November 8, 2016 02:43 — forked from davidgilbertson/client.js
Node http vs net modules
// This makes two connections, one to a tcp server, one to an http server (both in server.js)
// It fires off a bunch of connections and times the response
// Both send strings.
const net = require(`net`);
const http = require(`http`);
function parseIncomingMessage(res) {
return new Promise((resolve) => {
@kgust
kgust / trello-css-guide.md
Created November 9, 2016 21:31 — forked from bobbygrace/trello-css-guide.md
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@kgust
kgust / # lastpass-cli - 2016-12-15_07-44-49.txt
Created December 15, 2016 13:59
lastpass-cli on macOS 10.12.2 - Homebrew build logs
Homebrew build logs for lastpass-cli on macOS 10.12.2
Build date: 2016-12-15 07:44:49
@kgust
kgust / new docker commands.md
Last active January 25, 2017 19:45
New Docker CLI Commands (Introduced with Docker 1.13)
Section Description
checkpoint manage checkpoints
container manage containers
image manage images
network manage networks
node       manage nodes
plugin manage plugins
secret manage docker secrets
service manage services
@kgust
kgust / Docker GUI Apps on macOS.md
Last active March 30, 2017 03:14
How to run a GUI app inside Docker and display on macOS...

A somewhat crude way to do this:

Start socat to expose local xquartz socket on a TCP port
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

Pass the display to container (assuming virtualbox host is available on 192.168.59.3):
docker run -e DISPLAY=192.168.59.3:0 jess/geary
(This is insecure on public networks, add bind, su and range options to socat to limit access.)

From:

@kgust
kgust / apache web socket.md
Last active April 28, 2017 01:18
Use Apache for both http and web service traffic

Of course you can do this.

Firstly you have to check your Apache version. You should have 2.4+ version. I will show you command for my server on Ubuntu 14.4.

Secondly, turn on necessary apache modules:

a2enmod proxy
a2enmod proxy_http
a2enmod proxy_wstunnel
@kgust
kgust / List of libraries, websites, and projects mentioned by the VICTR team.md
Last active July 28, 2017 13:06
Here's a list of libraries, websites, and projects mentioned by the VICTR team...

Javascript

Webpack is a module bundler for modern JavaScript applications.

Frontend Frameworks

[X2node.com] Framework for Node.js

Select element libraries

Selectivity.js Modular and light-weight selection library
Chosen Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly
Select2 The jQuery replacement for select boxes