Skip to content

Instantly share code, notes, and snippets.

@htggit
htggit / asymmetric.go
Created January 2, 2019 13:08 — forked from cryptix/LICENSE
example of using JWT for http authentication in go
package main
// using asymmetric crypto/RSA keys
import (
"crypto/rsa"
"fmt"
"io/ioutil"
"log"
"net/http"

Actally.. doing

sed -i -e "s/blah/blah/" files

doesn't do what you expect in OS X either.. instead it creates backup files with "-e" extension.

The proper for OS is

@htggit
htggit / gist:ffb49ac30faf68ff50670d89638e1bce
Created April 15, 2018 21:17 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@htggit
htggit / disable-vagrant-time-sync.sh
Created August 22, 2017 13:14 — forked from X0nic/disable-vagrant-time-sync.sh
Disable vagrant time sync
#List vms
VBoxManage list vms
#get status of time sync
VBoxManage getextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled
#NOTE: Make sure to restart the VM after changing these settings.
#disable time sync
VBoxManage setextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1
@htggit
htggit / docker-machine.md
Last active July 4, 2017 11:18
docker-machine

docker-machine

Add remote CentOS to docker-machine

This tutorial shows how to add a remote CentOS to your local docker-machine.

Conditions

docker-machine installed CentOS 7 running on server Preparation

@htggit
htggit / git_branch.md
Last active July 16, 2017 11:58 — forked from stuart11n/gist:9628955
rename git branch locally and remotely

stash | working area | index | repository

git stash  --include-untracked
git stash apply
git stash clear
git stash list
git stash pop
git cat-file -p hash

commands that move branch

@htggit
htggit / vagrant.md
Last active July 4, 2017 11:21
vagrant

Accessing Vagrant Machine Globally

Mac/Linux

function homestead() {
    ( cd ~/Homestead && vagrant $* )
}
@htggit
htggit / configure-winrm.md
Last active June 22, 2017 01:44 — forked from sneal/configure-winrm.ps1
Configure WinRM for Vagrant
netsh advfirewall firewall set rule group="remote administration" new enable=yes
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985

winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'