This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZIG ?= zig | |
.PHONY: test | |
test: t-rpath.zig-cc t-rpath.clang-16 t-plain.clang-16 t-plain.zig-cc x/libfoo.so.2 | |
@echo clang-16 rpath: | |
@readelf -d t-rpath.clang-16 | grep -E "runpath|foo|bar" | sort | |
@echo zig cc rpath: | |
@readelf -d t-rpath.zig-cc | grep -E "runpath|foo|bar" | sort | |
@echo clang-16 plain: | |
@readelf -d t-plain.clang-16 | grep -E "runpath|foo|bar" | sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: test | |
test: f read_c read_go | |
bash -c 'while true; do echo yaddda | head -2 >> f; echo written; done' & \ | |
./read_c f; \ | |
./read_go f; \ | |
./read.py f; \ | |
pkill -f "echo yaddda" | |
f: | |
mkfifo f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -u | |
from sys import stdin, stdout | |
from datetime import datetime | |
before, line = datetime.utcnow(), 'foo' | |
while line != '': | |
line = stdin.readline() | |
ret = "[%s] %s" % (datetime.utcnow().strftime("%H:%M:%S.%f"), line) | |
stdout.write(ret) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arc() { | |
if [[ -z "$(which node)" ]]; then d; fi | |
env arc "$@" | |
} | |
. $HOME/.gg.sh | |
export LC_CTYPE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
export PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -n "$1" ]]; then | |
URL=$1 | |
else | |
URL=https://dans.im/gifs/ | |
fi | |
set -euo pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Parses KML file from the google map of http://www.vilnius.lt/darzeliai/info/. | |
Outputs a spreasheet-importable CSV. | |
""" | |
import sys | |
import csv | |
import xmltodict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name preload images on aruodas.lt | |
// @namespace motiejus | |
// @description Preload images on detail pages in aruodas.lt | |
// @include http*://*.aruodas.lt/* | |
// @version 4 | |
// @grant none | |
// @downloadURL https://gist.github.com/raw/063233890c207c0e9dce/aruodas.user.js | |
// | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# Finds objects between two versions, and creates | |
# "aws s3api delete-objects"-compatible json file. | |
# BUG: skips some of the input lines. Should emit the key/val on every line! | |
# Input: | |
# aws s3api --bucket=BUCKET list-object-versions --output text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ERLS=`find src apps -name '*.erl' 2>/dev/null` | |
HRLS=`find include -name '*.hrl' 2>/dev/null` | |
records= | |
for hrl in $HRLS; do | |
records+=$(grep -e '-record(' $hrl | perl -pe 's=-record\(([^,]+).*=\1=') | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Byte calculator. Sums bytes of a given file and displays to screen. | |
* | |
* Compile: | |
* gcc calc.c -o calc -O2 | |
* | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> |
NewerOlder