Skip to content

Instantly share code, notes, and snippets.

View truthadjustr's full-sized avatar
☠️
rebirth

truthadjustr

☠️
rebirth
  • Cebu, Philippines
View GitHub Profile
@truthadjustr
truthadjustr / printalign.awk
Created August 21, 2018 18:43
awk print align
awk '$4 != "?" && NR > 1 { split($4,arr,"/");p = arr[2];if (p<50) {L[$1]=p;}} END{for (k in L) {printf("%-30s %-10s\n",k,L[k]) }}' coverage_report.csv
@truthadjustr
truthadjustr / thinkfan.nix
Last active October 26, 2019 10:36
nixos: thinkfan configuration in /etc/nixos/configuration.nix
# Thinkpad T440
# postconditions:
# 1) status should be enabled:
# cat /proc/acpi/ibm/fan
# 2) No errors in systemd logs:
# journalctl -u thinkfan.service -f
services = {
thinkfan = {
@truthadjustr
truthadjustr / 4
Created January 30, 2019 09:05
/
https://gist.github.com/f198e4889c5727f2bc6d9efda689b302
https://gist.github.com/8079bcef27a01181f2c0f27fef34cf3a
https://gist.github.com/6960b7436c092efd7022af94e760e5fd
https://gist.github.com/63d98b821d73093f8e9f266ee3cc43b8
https://gist.github.com/463eb5c8a9c0ac31df020195869d33ed
https://gist.github.com/4f85e0ea43cffb55db3101fc61d9a8d5
https://gist.github.com/90fd10ddb847ef958ebbcd7aad65b1ee
https://gist.github.com/b5e21edf5c313623d891d15a8c2c430d
https://gist.github.com/d56e7339c98b958e0c50cea5f5522fab
https://gist.github.com/09e21c01f385428775a39f27dca3d728
@truthadjustr
truthadjustr / headers
Last active January 30, 2019 09:03
c/c++ include headers
include:
c:
memcpy,memset: string.h
lseek: [sys/types.h,unistd.h]
printf: stdio.h
realloc: stdlib.h
assert: assert.h
exit: stdlib.h
c++:
cout: iostream
@truthadjustr
truthadjustr / protobuf.js
Created January 29, 2019 13:05
js object
var EXAMPLE = {
foo: 'hello',
hello: 42,
payload: new Buffer('a'),
meh: {
b: {
tmp: {
baz: 1000
}
@truthadjustr
truthadjustr / protobuf.proto
Created January 29, 2019 09:43
protobuf schema
message SearchRequest {
required string query = 1;
optional int32 page_number = 2;
optional int32 result_per_page = 3 [default = 10];
enum Corpus {
UNIVERSAL = 0;
WEB = 1;
IMAGES = 2;
LOCAL = 3;
NEWS = 4;
openssl x509 -text -noout -in cert.txt
@truthadjustr
truthadjustr / gist:63d98b821d73093f8e9f266ee3cc43b8
Created January 24, 2019 12:26
inotify watch a folder for changes
inotifywait -mr --exclude '.git' -e create somefolder/
@truthadjustr
truthadjustr / yml.tip
Created January 24, 2019 10:40
yml tip
pip install pyyml
python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < docker-compose.yml > /tmp/docker-compose.json
ncpa.cpl