Skip to content

Instantly share code, notes, and snippets.

View goodjob1114's full-sized avatar

Randy Chen goodjob1114

View GitHub Profile
@goodjob1114
goodjob1114 / add_milliseconds_to_mysql_and_activerecord_timestamps.md
Created November 6, 2015 08:01 — forked from iamatypeofwalrus/add_milliseconds_to_mysql_and_activerecord_timestamps.md
ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps/Datetimes with Rails / MySQL

ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps with Rails / MySQL

Milliseconds in your Timestamps.

We got 'em, you want 'em.

Why

Shit needs to be PRECISE

LICENSE

MIT

@goodjob1114
goodjob1114 / ansible-gce.sh
Created January 12, 2016 07:52 — forked from samklr/ansible-gce.sh
Ansible GCE setup
#! /bin/sh
### Must have Gcloud sdk installed and configured
###Create a micro instance as ansible master
gcloud compute --project $PROJECT_NAME instances create "ansible" --zone "us-central1-b" --machine-type "f1-micro" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --no-boot-disk-auto-delete
###or a centos like in the tutorial
gcloud compute --project $PROJECT_NAME instances create "ansible-master" --zone "us-central1-b" --machine-type "g1-small" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --image "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20140926" --no-boot-disk-auto-de
@goodjob1114
goodjob1114 / http_get.go
Created January 21, 2016 09:40 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
package main
import (
"fmt"
"http"
"io/ioutil"
"os"
)
func main() {
@goodjob1114
goodjob1114 / client.go
Created February 1, 2016 07:33 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@goodjob1114
goodjob1114 / main.go
Created April 13, 2016 03:47 — forked from manishtpatel/main.go
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@goodjob1114
goodjob1114 / stuns
Created June 8, 2016 09:03 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@goodjob1114
goodjob1114 / README.md
Created October 10, 2017 16:33 — forked from bsodmike/README.md
OC Nvidia GTX1070s in Ubuntu 16.04LTS for Ethereum mining

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards.

First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
@goodjob1114
goodjob1114 / influxdb.conf
Last active January 25, 2019 07:37 — forked from acherunilam/influxdb.conf
Nginx config for InfluxDB HA
worker_processes 5;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
}
http {
client_max_body_size 20M;
@goodjob1114
goodjob1114 / Gemfile
Created May 30, 2019 09:58 — forked from rmosolgo/Gemfile
GraphQL Ruby Subscriptions
source 'https://rubygems.org'
gem "graphql", github: "rmosolgo/graphql-ruby", branch: "subscriptions"
gem "sinatra"
gem "thin"