Skip to content

Instantly share code, notes, and snippets.

View groob's full-sized avatar
🌻

Victor Vrantchan groob

🌻
View GitHub Profile
package main
import (
"fmt"
"image"
"image/draw"
"image/jpeg"
"image/png"
"io"
"log"
package main
import (
"fmt"
"log"
"net/http"
)
/*
use
lead, err := readExact(f, 28)
if err != nil {
return fmt.Errorf("error reading RPM lead: %s", err.Error())
}
// fmt.Printf("%x", lead)
// Check file magic
magic := binary.BigEndian.Uint32(lead[0:4])
if magic&0xffffffff != 0x70627a78 {
@groob
groob / homepage.go
Created November 8, 2016 22:50
read safari homepage in go
package main
/*
#cgo LDFLAGS: -framework IOKit -framework ApplicationServices
#include <CoreFoundation/CoreFoundation.h>
#include <stdlib.h>
// cfstring_utf8_length returns the number of characters successfully converted to UTF-8 and
// the bytes required to store them.
static inline CFIndex cfstring_utf8_length(CFStringRef str, CFIndex *need) {
module Main exposing (..)
import Autocomplete
import WebSocket
import Json.Decode.Extra exposing ((|:))
import Json.Decode as Json exposing ((:=), Decoder)
import Json.Encode as JE
import String
import Task
import Dom
@groob
groob / deploy.go
Last active December 21, 2022 03:39
/*
HookHandler - listen for github webhooks, sending updates on channel.
DeploymentMonitor select update type based on channel and call deployment script
*/
package main
import (
"fmt"
"html/template"
"io/ioutil"
@groob
groob / vimrc
Created September 2, 2016 02:42
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
Plug 'SirVer/ultisnips'
Plug 'AndrewRadev/splitjoin.vim' "split go structs...
Plug 'morhetz/gruvbox'
Plug 'tomtom/tcomment_vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'godlygeek/tabular'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
@groob
groob / Caddyfile
Created August 30, 2016 20:58
I have a bunch of projects running on localhost(different ports). Here's a few, and a simple Caddyfile(caddy means automatic free https) proxies requests to those backends. Easy, cheap.
https://elmvids.groob.io:443 {
log stdout
prometheus
proxy / localhost:4001
tls {
max_certs 10
}
}
https://groob.io:443 {
@groob
groob / ca-tls-server.md
Last active March 11, 2017 15:46
quick CA server

create a CA and generate keys

# pull container for https://github.com/rcrowley/certified
docker pull groob/certified:latest
# create CA and intermediary CA; will prompty you for a password
docker run --rm -it --name certified -v $(pwd)/certs:/certified/etc -e GIT_USER=groob -e GIT_EMAIL=groob+github@gmail.com groob/certified certified-ca C="US" ST="NY" L="New York" O="Example" CN="groob-ca"
# create server cert
docker run --rm -it --name certified -v $(pwd)/certs:/certified/etc -e GIT_USER=groob -e GIT_EMAIL=groob+github@gmail.com groob/certified certified CN="servq.groob.io"
# create cert chain as server.crt
cat certs/ssl/certs/servq.groob.io.crt certs/ssl/certs/ca.crt certs/ssl/certs/root-ca.crt > server.crt
@groob
groob / README.md
Created August 1, 2016 03:52
creates puppet-tag pkg