Skip to content

Instantly share code, notes, and snippets.

View 42wim's full-sized avatar
🦄
\ʕ◔ϖ◔ʔ/ P͎͚̟͚l͓͍͔̬̻͙͓u̴͚͔̙̼͈̙̗g̪̰͇̹͈͔̖g҉͍̖͉̝͖̱̟ḛ̫̝̳̤ͅḓ̶ ̵̠̰̦̹i̶n͈̳̳̰̻͕͙ 🅾🅽🅻🅸🅽🅴

Wim 42wim

🦄
\ʕ◔ϖ◔ʔ/ P͎͚̟͚l͓͍͔̬̻͙͓u̴͚͔̙̼͈̙̗g̪̰͇̹͈͔̖g҉͍̖͉̝͖̱̟ḛ̫̝̳̤ͅḓ̶ ̵̠̰̦̹i̶n͈̳̳̰̻͕͙ 🅾🅽🅻🅸🅽🅴
View GitHub Profile
@42wim
42wim / key.md
Created February 4, 2023 21:32
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@42wim
42wim / cpustat.sh
Created October 20, 2022 20:27
cpu stats docker bash
#!/bin/bash
id=$(docker inspect $1|jq ".[]|.Id" -r)
mhz=$(cat /proc/cpuinfo |grep MHz|awk '{print $4}'|paste -d "+" -s|bc -l)
while true;do
allpre=$(cat /proc/stat |head -n 1|cut -d " " -f 3-9|sed s#" "#+#g|awk '{print "("$1")*1000000000/100"}'|bc)
acctpre=$(cat /sys/fs/cgroup/cpu,cpuacct/system.slice/docker-$id.scope/cpuacct.usage)
sleep 1
all=$(cat /proc/stat |head -n 1|cut -d " " -f 3-9|sed s#" "#+#g|awk '{print "("$1")*1000000000/100"}'|bc)
acct=$(cat /sys/fs/cgroup/cpu,cpuacct/system.slice/docker-$id.scope/cpuacct.usage)
echo "($acct-$acctpre)/($all-$allpre)*$mhz"|bc -l
@42wim
42wim / learn.txt
Created February 4, 2021 23:15
learning go
- go language spec: https://golang.org/ref/spec
- effective go: https://golang.org/doc/effective_go.html
- go by example: https://gobyexample.com/
- tour of go: https://tour.golang.org/welcome/1
@42wim
42wim / basicinit.vim
Last active November 18, 2020 19:17
nvim configuration
"leader key is ,
let mapleader = ","
let g:mapleader = ","
set nocompatible
set rtp+=~/.nvim
call plug#begin('~/.nvim/plugged')
Plug 'fatih/vim-go'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neosnippet.vim'
@42wim
42wim / chrome.bat
Last active November 15, 2020 21:43
scoop chrome portable widevine junction workaround
@echo off
cd C:\workdir\myapps\scoop\apps\googlechrome-portable
FOR /F "tokens=*" %%g IN ('dir /AD /B /O-d ^| find /V "current" ^|findstr/n . ^|findstr "^1:"') do (SET VAR=%%g)
set VAR=%VAR:1:=%
start %VAR%\chrome %*
@42wim
42wim / .golangci.yml
Last active January 6, 2020 20:45
golangci-lint usage
# options for analysis running
run:
deadline: 2m
issues-exit-code: 1
tests: true
# modules-download-mode: vendor
skip-files:
- rice-box.go
# output configuration options
[[gateway]]
name="gw1"
enable=true
[[gateway.inout]]
account="discord.account"
channel="channel1"
[[gateway.inout]]
account="irc.account"
@42wim
42wim / transittest.sh
Created July 9, 2019 21:02
vault transit verify signature offline
$ vault write -f transit/keys/akey type=rsa-4096
Success! Data written to: transit/keys/akey
$ vault read -field=keys -format=json transit/keys/akey | jq -r '.[]|.public_key' > pub.pem
$ cat pub.pem
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyKC+YwNfucFi0qadwnjw
s3yPvGNbYN/RvTMokeFBSP+k1H5wdrC27SNYpiqhCfXqR5D0jvUUG/KUqLYQ8oLu
anQSH9RgUUKQn6YUuJfAYXTuNtoVaez+ONIqXJkyCuwa5s+z0PvGxKMOwl+mr+hw
1f1nP53kM0momAqMSlMiJCMpcPWu1RJEbhlTc/EE/rlghzU2dTKFwd3gMUFlEbzL
@42wim
42wim / dnsdist.lua
Last active November 6, 2020 10:02
dnsdist
function maintenance()
res = blockingGetAddrInfo(newDNSName('mydns.service.consul'))
active = getPoolServers("apool")
local match = {}
local match2 = {}
for k,v in pairs(res) do
match[v:toString()]=false
end
for a,b in pairs(active) do
match2[a]=false
@42wim
42wim / test.toml
Created October 23, 2018 20:24
test.toml
[[trigger]]
file="t/audit_db.log"
record-delimiter="^#"
[trigger.pwdlock]
match-regex="uwe regex"
actions.showmatch.type="local"
actions.showmatch.runtemplate="logger -t INFO {{ .dn }} {{ .datetime }}"
actions.remoteserver1.type="rest"
actions.remoteserver1.urltemplate="blah"