Skip to content

Instantly share code, notes, and snippets.

View pocoz's full-sized avatar
💭
amor fati

workhorse pocoz

💭
amor fati
  • Marketplace
  • Warsaw
View GitHub Profile
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
@pocoz
pocoz / protobuf
Last active September 13, 2018 10:42
install latest
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
@pocoz
pocoz / export-ble-infos.py
Last active May 2, 2019 07:28 — forked from Mygod/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Export your Windows Bluetooth LE keys into Linux!
Thanks to: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html
Usage:
$ sudo apt install chntpw
$ python3 export-ble-infos.py
$ sudo bash -c 'cp -r ./bluetooth /var/lib && service bluetooth force-reload'
sudo setfacl -m user:$USER:rw /var/run/docker.sock
sudo chmod 777 /var/run/docker.sock
package main
import (
"log"
"os"
"github.com/goreleaser/nfpm"
_ "github.com/goreleaser/nfpm/deb"
)
@pocoz
pocoz / aes_cbc_pkcs5.go
Created April 10, 2019 11:53 — forked from hothero/aes_cbc_pkcs5.go
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install ubuntu-drivers-common
sudo apt install nvidia-driver-{last-driver}
sudo reboot
nvidia-smi
sudo nano /etc/systemd/system/nvidia-powerlimit.service
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_TERMINAL=console
sudo update-grub
sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target
// Undo
@pocoz
pocoz / update modules
Created January 13, 2022 15:55
update modules to latest version
Just 'go get' at the commit hash you want:
go get github.com/someone/some_module@af044c0995fe
'go get' will correctly update the dependency files (go.mod, go.sum).
More information: https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies
@pocoz
pocoz / prepare-commit-msg
Last active February 2, 2022 11:56
Add branch name to the beginning of the commit message
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"