Skip to content

Instantly share code, notes, and snippets.

View cstockton's full-sized avatar

Chris Stockton cstockton

View GitHub Profile
# _some_ of my env vars used for the workspace.sh above.
####
# Defaults for all machines
export ONE=/one
export ONE_SEC=/sec
export ONE_ENV="$(hostname)"
# Workspace persistence @ loading
export ONE_WS=/ws
@cstockton
cstockton / partitionlocker.go
Created September 18, 2017 06:17
Another sync.Cond example
package xsync
import (
"fmt"
"sync"
"time"
)
type PartitionLocker struct {
c *sync.Cond
@cstockton
cstockton / limitgroup.go
Last active November 30, 2018 12:27
Another example of sync.cond.
package xsync
import (
"fmt"
"sync"
"time"
)
type LimitGroup struct {
wg sync.WaitGroup
@cstockton
cstockton / cancellation.go
Created September 16, 2017 16:14
Example of cancellation.
package main
import (
"context"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
# Certs are for local testing.
certs := api.test api01.test api02.test api03.test \
server.test server01.test server02.test server03.test \
client.test client1.test client2.test client3.test
.PHONY: all
all: | $(foreach c,$(certs),$(addprefix certs/,$(c)).crt)
# destroy private CA key immediately after make completes so it can be
# trusted for local dev.
test -f ca/ca.key && shred -uz -n 1024 ca/ca.key || true
@cstockton
cstockton / extension.js
Created August 17, 2017 01:28
Malware on google chrome store.
Extension ZCookies - offered by zivisor
-
https://chrome.google.com/webstore/detail/zcookies/edclfanjjbknpolcdinkfeadmajpjpgj/reviews?hl=en
--
Real nice- I love how they try to mask it under the function name "format".. don't mind me! I'm just sending your web sessions to a remove server for formatting! Lol.
@cstockton
cstockton / steps.md
Last active March 5, 2018 19:27
*ubuntu install steps macbook pro 2016

Install the iso

  • press and hold alt right after powering on
  • select EFI BOOT
  • select try ubuntu gnome
  • control + e
  • delete quiet and splash, nomodeset intremap=nosid
  • hit f10 to boot into live cd

luks

package main
// Just for fun in response to: https://aadrake.com/posts/2017-05-29-faster-command-line-tools-with-go.html
import (
"bufio"
"bytes"
"io/ioutil"
"os"
"testing"
@cstockton
cstockton / gows.sh
Created July 20, 2017 23:43
Contributing to Go - Workspace configuration example
#!/bin/bash
####
## Workspace layout
#
# I follow a few conventions to keep managing things simple. My default Go
# workspace where most personal projects are live in /one/ws/go. Then I have
# each major release along with tip in /one/ws/go<{semver}|tip>. i.e.:
#
# The "go" folder contains official tagged release of latest Go version I simply
[Unit]
Description=ServiceName
Documentation=https://example.com/doc.txt
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Restart=on-failure
PermissionsStartOnly=true
User=programusername