Skip to content

Instantly share code, notes, and snippets.

View kingbin's full-sized avatar
🎯
Focusing

kingbin

🎯
Focusing
View GitHub Profile
@kingbin
kingbin / gist:9435292
Last active May 4, 2024 12:17
Manually Start/Stop PostgresSQL on Mac
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
Password:
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
@kingbin
kingbin / vcvarsall.bat
Created April 17, 2013 19:16
vcvarsall.bat
@echo off
if "%1" == "" goto x86
if not "%2" == "" goto usage
@set IE_BIN=%ProgramFiles%\Internet Explorer\iexplore.exe
@set PHANTOMJS_BIN=%APPDATA%\npm\node_modules\phantomjs\lib\phantom\phantomjs.exe
@doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $*
if /i %1 == x86 goto x86
@kingbin
kingbin / GitLab-CE on Windows 10
Last active May 22, 2020 20:15
Using Docker toolbox to create a persistent Gitlab-CE install in Windows 10
$ docker create --name gitlab-data --volume /d/docker/gitlab:/etc/gitlab gitlab/gitlab-ce:latest
# Make sure Bridging is set on the VM in VirtualBox
$ docker run --publish 8080:80 --publish 2222:22 --publish 4443:443 --name gitlab --restart always --volumes-from gitlab-data gitlab/gitlab-ce:latest
Using docker 1.13.1
@kingbin
kingbin / gist:c6a1473d8c8ce2f70762bca4a4d2bf8c
Created November 15, 2019 19:51
Docker API exposed from Mac Docker Desktop w TLS
export FILENAME=server
openssl genrsa -out $FILENAME.key 2048
openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt
cat $FILENAME.key $FILENAME.crt >$FILENAME.pem
chmod 600 $FILENAME.key $FILENAME.pem
export FILENAME=client
openssl genrsa -out $FILENAME.key 2048
openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt
cat $FILENAME.key $FILENAME.crt >$FILENAME.pem
chmod 600 $FILENAME.key $FILENAME.pem
@kingbin
kingbin / polldaddy_v2.rb
Created January 29, 2012 16:33
automate testing a web project :)
# Using the web automation driver (watir-webdriver) through the tor network
# Automates webpage actions & bypasses the voting limit on polldaddy
# Casts a vote every 3 seconds for a total of 1000 votes
require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :http => '127.0.0.1:8118'
b = Watir::Browser.new :firefox, :profile => profile
#b = Watir::Browser.new :firefox
b.goto 'speakimge.wordpress.com/2012/01/25/under-the-covers/'

Keybase proof

I hereby claim:

  • I am kingbin on github.
  • I am kingbin (https://keybase.io/kingbin) on keybase.
  • I have a public key ASCnYtP-gLSh2UJHoD-2qxxA_KKt6n_gxr6SIZ-lxcy-kwo

To claim this, I am signing this object:

@kingbin
kingbin / gist:6efac2c171616be9974e7b1644e178ff
Created September 24, 2018 21:17
React-Native 0.55.4 w iOS 12 & XCode 10
GLog resolve w libfishhook dependency
```
$ cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
$ cd node_modules/react-native/third-party/glog-0.3.4/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
$ cp ~/Library/Developer/Xcode/DerivedData/XXX/Build/Products/Release-iphonesimulator/libfishhook.a ./node_modules/react-native/Libraries/WebSocket/
```
@kingbin
kingbin / file-svg-export.py
Created March 2, 2018 20:31 — forked from thorsummoner/file-svg-export.py
GIMP Plug-in for Simple SVG Exports
#!/usr/bin/env python
# GIMP Plug-in for Simple SVG Exports
# Copyright (C) 2016 by Dylan Grafmyre <thorsummoner@live.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
@kingbin
kingbin / docker_descendants.py
Created February 2, 2018 20:34 — forked from altaurog/docker_descendants.py
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)
@kingbin
kingbin / gist:a62d7684d803aae1de1dc7ffef79aa7a
Created January 18, 2018 17:32
IIS for SSL Perfect Forward Secrecy and TLS 1.2
# Copyright 2017, Alexander Hass
# http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# Version 1.8
# - Windows 2016 powershell 5.1.14393.1532 requires 'else' statements in the same line after to the closing 'if' curly quote.
# Version 1.7
# - Windows Version compare failed. Get-CimInstance requires Windows 2012 or later.
# Version 1.6
# - OS version detection for cipher suites order.
# Version 1.5