Skip to content

Instantly share code, notes, and snippets.

View devnore's full-sized avatar
🎯
Focusing

Simon Ingelsson devnore

🎯
Focusing
  • Utopia Music Stockholm
  • Stockholm Sweden
View GitHub Profile
version: '3.3'
services:
nginx:
image: mycustom/nginx:latest
build:
context: ./Dockerfiles/nginx
hostname: docker.local
volumes:
- ${HOME}/dockerSites/www:/var/www
- nginxlogs:/var/log/nginx
### Keybase proof
I hereby claim:
* I am devnore on github.
* I am simonispyse (https://keybase.io/simonispyse) on keybase.
* I have a public key ASA8-XAp61MKU2OONEfrya1oV60GYau-3gcPElD5pMyKvgo
To claim this, I am signing this object:
@devnore
devnore / init.lua
Last active August 29, 2015 14:09
Mjolnir - init.lua
--[[
# Install dependencies.
brew update
brew install lua
brew install luarocks
brew install blueutil
wget https://github.com/sdegutis/mjolnir/releases/download/0.4.3/Mjolnir-0.4.3.tgz
mkdir -p ~/.luarocks
mkdir -p ~/.mjolnir/
echo 'rocks_servers = { "http://rocks.moonscript.org" }' > ~/.luarocks/config.lua
if [ $UID -eq 0 ]; then
NCOLOR="red";
else
if [[ $(uname) == "Darwin" ]] ; then
NCOLOR="white";
elif [[ $(uname) == "Linux" ]] ; then
NCOLOR="green"
fi
fi
@devnore
devnore / gist:8062797
Created December 20, 2013 22:41
List all IPs in OSX internal and external
#!/bin/bash
echo -e "\033[1mExternal:\033[0m $(wget -q -t 5 --output-document=- "http://dyndns.ispy.se/")"
Interfaces=`ifconfig -a | grep -o -e "^[a-z][a-z]*[0-9]" | perl -pe "s|^([a-z]*[0-9]*)[ ]|\1|"`
for Interface in $Interfaces; do
INFO=`ifconfig $Interface 2>&1`
if grep -q "status: active" <<<$INFO; then
echo -e "\033[1m$Interface:\033[0m $(ipconfig getifaddr $Interface)"
fi
@devnore
devnore / battery.zsh
Last active December 21, 2015 01:39
Battery indicator for use with RPROMPT in oh-my-zsh. Has a fallback to displaying time if on a Linux-system with no acpi (haven't tested acpi as i don't have a Linux-laptop here atm)
function battery_charge {
if [[ $(uname -s) == 'Darwin' ]]; then
percent_battery=$(pmset -g batt | grep -o "[0-9]*%" )
percent_battery=${percent_battery:0:-1}
charge="%{$fg_bold[green]%}⚡️ "
if [[ -z $(pmset -g batt |grep "AC Power") ]]; then charge="%{$fg_bold[red]%}🔋 " fi
elif [[ $(uname -s) == 'Linux' ]]; then
percent_battery=0
@devnore
devnore / gist:6087683
Last active December 20, 2015 06:39
Wrapper fro dig that deals with chrome adding protocol when copying and cutting text from addressbar
#!/bin/bash
HOST=$(echo $1 | sed 's/http:\/\///;s|\/.*||')
shift
/usr/bin/dig $HOST $@