Skip to content

Instantly share code, notes, and snippets.

View DevoKun's full-sized avatar

Devon Hubner DevoKun

View GitHub Profile
@DevoKun
DevoKun / macosx_compile_bash_shellshock.sh
Created September 30, 2014 15:40
Compile Bash on MacOS X to patch against ShellShock bug
#!/bin/bash
#
# Tested on MacOS X 10.5 for PowerPC (powerpc-apple-darwin9.8.0)
# Using Xcode 3 (powerpc-apple-darwin9-gcc-4.0.1)
# /Developer/usr/bin/xcodebuild -version
# Component versions: DevToolsCore-921.0; DevToolsSupport-893.0
# Compile Bash 4.3
# bash-4.3.tar.gz 26-Feb-2014 09:25
@DevoKun
DevoKun / factorial.rb
Created October 23, 2014 19:57
Ruby for calculating a factorial using recursion.
#!/usr/bin/env ruby
def factorial(i)
if (i > 0) then
print i
return i = i * factorial(i - 1)
end ### if
return 1
end ### def

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@DevoKun
DevoKun / boot2docker.md
Last active August 29, 2015 14:10
Operate Boot2Docker on MacOS X
@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

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 / 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 / ibmi.xml
Created January 10, 2015 14:33
IBM i (as/400, iSeries) CLP Language Syntax Highlighting for NotePad++
<!-- Add to userDefineLang.xml -->
<NotepadPlus>
<UserLang name="CLP" ext="clp clle">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="yes" words2="yes" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&apos;00&apos;00</Keywords>
@DevoKun
DevoKun / mysql_master_slave_container_replication.md
Created November 21, 2014 02:47
MySQL Docker Container Master/Slave Replication
@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"'