Skip to content

Instantly share code, notes, and snippets.

View DevoKun's full-sized avatar

Devon Hubner DevoKun

View GitHub Profile
@DevoKun
DevoKun / install_from_epel.sh
Last active January 11, 2019 19:35
Install 7zip and Supervisor on Amazon Linux using the EPEL repo
yum install -y epel-release
yum --enablerepo=epel install -y p7zip
yum --enablerepo=epel install -y supervisor
@DevoKun
DevoKun / urlcheck.sh
Last active November 16, 2018 02:37
Check for Broken Links using wget
wget --spider -r -nd -nv http://0.0.0.0:4000/ 2>&1 | tee urlcheck.log
egrep --color=auto -A5000 'Found [0-9]+ broken links.' urlcheck.log
@DevoKun
DevoKun / basicAuthHandler.js
Created October 29, 2018 01:55
Amazon Lambda HTTP Basic Auth using ClaudiaJS
var ApiBuilder = require('claudia-api-builder'),
api = module.exports = new ApiBuilder(),
renderPage = function (body) {
'use strict';
return body;
};
const authUser = 'user',
authPass = 'pass',
@DevoKun
DevoKun / bash_prompt_command_flip_table.md
Last active October 24, 2018 02:13
Configure bash shell config to flip a table whenever a command fails with a non-zero exit status.
export COLOR_NC='\e[0m'
export COLOR_BLUE='\e[0;34m'
export COLOR_GREEN='\e[0;32m'
export COLOR_CYAN='\e[0;36m'
export COLOR_RED='\e[0;31m'
export COLOR_BROWN='\e[0;33m'
export COLOR_YELLOW='\e[1;33m'

export PROMPT_COMMAND='[ $? -eq 0 ] || printf "${COLOR_CYAN}(${COLOR_GREEN}╯${COLOR_NC}${COLOR_BLUE}°${COLOR_CYAN}□${COLOR_BLUE}°${COLOR_CYAN})${COLOR_GREEN}╯${COLOR_RED}︵ ${COLOR_BROWN}┻━┻${COLOR_NC}\n"'
@DevoKun
DevoKun / remove_management_interface_vmk0_from_pre-existing_distributed_virtual_switch_vds_and_attached_to_port_group_on_new_virtual_switch.md
Last active July 18, 2018 13:53
Remove Management Interface (vmk0) from pre-existing Distributed Virtual Switch (VDS) and attached to Port Group on new Virtual Switch

Remove Management Interface (vmk0) from pre-existing Distributed Virtual Switch (VDS) and attached to Port Group on new Virtual Switch

List existing ports

esxcfg-vswitch -l
esxcli network vswitch dvs vmware list 
esxcfg-vswitch -Q vmnic0 -V ${DVS_ID_FROM_ABOVE} ${DVS_NAME}
@DevoKun
DevoKun / kafka.md
Created July 13, 2018 02:52
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper

@DevoKun
DevoKun / Deploy_go_application_to_Elastic_Beanstalk.md
Created November 25, 2017 03:56
How to deploy GO applications to Elastic Beanstalk without or with Docker

Deploy go application to Elastic Beanstalk

non-Docker Elastic Beanstalk GO

@DevoKun
DevoKun / apache-qliksense-proxy.md
Created March 4, 2016 16:32
Apache2 Proxy Server Recipe for QlikSense to accomodate https and Secure WebSocket (wss) connections

Scenario

-------------       ----------------       ---------
| Browser   |<----->| Apache httpd |<----->| Qlik  |
|           |  SSL  |     2.4.9    |  SSL  | Sense |
-------------       ----------------       ---------

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@DevoKun
DevoKun / install_gosu.sh
Created January 30, 2015 21:48
Install gosu for easy step-down from root
#!/bin/bash
gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu