Skip to content

Instantly share code, notes, and snippets.

View Inquizarus's full-sized avatar
💭
How much for the gun?

Inquizarus

💭
How much for the gun?
View GitHub Profile
@Inquizarus
Inquizarus / etcdcips
Created February 7, 2019 07:02
Script for getting etcd client ip's
#!/bin/bash
echo $(curl --silent "https://discovery.etcd.io/$1" | \
jq '.node.nodes | map(.value)' | \
grep -oE '([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\:[[:digit:]]{4})' | \
sed -e 's/2380/2379/g; 1!s/^/,/g') | \
sed -e 's/\(\s\)//g'
@Inquizarus
Inquizarus / etcdips
Last active February 5, 2019 06:39
Small bash script to retrieve etcd node ip's
#!/bin/bash
curl --silent "https://discovery.etcd.io/$1" | \
jq '.node.nodes | map(.value)' | \
grep -oE '([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})'
@Inquizarus
Inquizarus / golang-makefile
Last active June 26, 2018 10:07
boilerplate golang makefile
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME={{binary_name}}
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
#!/bin/bash -e
# IMPORTANT. This will install phpstorm to the shared application space in /usr
# IMPORTANT. Run with sudo!
echo -n "Please enter the PhpStorm download url (eg http://download.jetbrains.com/webide/PhpStorm-EAP-141.690.tar.gz): "
read url
# Download file from url
echo "Downloading PhpStorm to /tmp"
cd /tmp
@Inquizarus
Inquizarus / jetbrains-phpstorm.desktop
Created February 1, 2017 08:55
Simple phpstorm desktop entry for linux
[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/usr/share/applications/phpstorm/bin/webide.png
Exec="/usr/share/applications/phpstorm/bin/phpstorm.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm
@Inquizarus
Inquizarus / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console