Skip to content

Instantly share code, notes, and snippets.

View owensengoku's full-sized avatar
🎯
Focusing

owensengoku owensengoku

🎯
Focusing
View GitHub Profile
@owensengoku
owensengoku / SqlTableCreator.cs
Created August 12, 2020 13:33 — forked from riyadparvez/SqlTableCreator.cs
Create Sql table based on given DataTable schema
// Copyright (c) 2012-2013, Riyad Parvez
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@owensengoku
owensengoku / setup-azure-ingress-application-gateway-lets-encrypt.ps1
Created June 14, 2020 10:54
Azure kubernetes service (AKS) + Azure application gateway + Letsencrypt ingress setup (production setup) (AGIC) automatic ssl certificate generation.
# prereq:
# 1. aks cluster
# 2. azure gateway V2 (rules setup not important, will be overwritten)
# 3. both of the above in the same Virtual network in azure. (different subnets).
$subscriptionId = '<azure-subscription-guid>';
$resourceGroup = '<resource-group-name>';
$rbac = $true; # on k8s cluster
$aksName = '<azure-kubernetes-cluster-name>';
@owensengoku
owensengoku / Makefile
Created September 15, 2018 09:08 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@owensengoku
owensengoku / Makefile
Created June 6, 2016 02:42
JSON to BSON conversion in C
all: json2bson
clean:
rm -f json2bson
json2bson: json2bson.c
${CC} $(shell pkg-config --cflags json libmongo-client glib-2.0) -Wall -O0 -ggdb3 -std=c99 ${CFLAGS} \
$(shell pkg-config --libs json libmongo-client glib-2.0) -o $@ $^
check: all
./json2bson <test.json >test.bson
@owensengoku
owensengoku / gzipWriter.go
Created June 3, 2016 10:57 — forked from mchirico/gzipWriter.go
Example of writing a gzip file in go (golang). This appends data to the same file every time it is run. It is important to Flush() the data before closing the file.
/*
This is an example of a golang gzip writer program,
which appends data to a file.
*/
package main
@owensengoku
owensengoku / Golang-binary-versioning.md
Created May 27, 2016 05:11 — forked from rafecolton/Golang-binary-versioning.md
Copypasta for easy versioning for your Go binaries

Golang Binary Versioning Trick

To use, place the code in version_trick.go in your project. Don't forget to change the namespace to match yours to the actual name of your package.

In addition to version_trick.go, there's a makefile-snippet, that includes the secret sauce for making this trick work. Be sure to change the package name there as well.

Enjoy!

P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!

mgo.SetDebug(true)
var aLogger *log.Logger
aLogger = log.New(os.Stderr, "", log.LstdFlags)
mgo.SetLogger(aLogger)
@owensengoku
owensengoku / myip.go
Created April 28, 2016 10:37 — forked from jniltinho/myip.go
Get My IP Golang
package main
/*
URL: https://github.com/mccoyst/myip/blob/master/myip.go
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/
*/
import (
"net"
"os"
@owensengoku
owensengoku / Install_tmux
Created March 23, 2016 08:49 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@owensengoku
owensengoku / tmux-cheatsheet.markdown
Created March 23, 2016 08:48 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname