Skip to content

Instantly share code, notes, and snippets.

Klaus Alexander Seistrup kseistrup

Block or report user

Report or block kseistrup

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kseistrup
kseistrup / syslogtail.sh
Created Jan 19, 2020
journalctl doesn't have an --exclude switch, so let's make out own
View syslogtail.sh
#!/bin/bash
exec 0</dev/null
exec 2>&1
clear
exec journalctl --utc --lines=2048 --follow > \
>(exec stdbuf --output=L awk '$5 !~ "^(kernel|audit|CROND|crond)" {print}' > \
>(exec stdbuf --output=L ccze --raw-ansi --plugin syslog --options nolookups))
View readit.sh
# run this script with a shell other than fish (bash, ksh, yash, …)
printf 'A B\tC D\t\tE \tF\t G \t \t H I\n' \
| while read A B C D E F G REST
do
printf 'A="%s"\n' "$A"
printf 'B="%s"\n' "$B"
printf 'C="%s"\n' "$C"
printf 'D="%s"\n' "$D"
printf 'E="%s"\n' "$E"
View readit.fish
# run this script with fish
printf 'A B\tC D\t\tE \tF\t G \t \t H I\n' \
| while read A B C D E F G REST
printf 'A="%s"\n' "$A"
printf 'B="%s"\n' "$B"
printf 'C="%s"\n' "$C"
printf 'D="%s"\n' "$D"
printf 'E="%s"\n' "$E"
printf 'F="%s"\n' "$F"
@kseistrup
kseistrup / gris.txt
Created Apr 18, 2018
Gris er det nye svin
View gris.txt
angrebgriskel.
bacongris.
butikgrisdue.
bægergrisger.
dannebroggrisdue.
engrisklet adj., engrisklede.
fedegris.
forsatgrisdue.
forgrisde, forsvandt, forsvundet (forsvunden, forsvundne, jf. § 31-34).
forgrisding -en, -er, i sms. forgrisdings-, fx forgrisdingsnummer.
View blockstack.txt
Verifying that "kseistrup.id" is my Blockstack ID. https://onename.com/kseistrup
@kseistrup
kseistrup / zeronet.service
Last active Mar 30, 2016
Service file for Zeronet
View zeronet.service
[Unit]
Description=Decentralized websites using Bitcoin crypto and the BitTorrent network
[Service]
User=zeronet
Group=zeronet
WorkingDirectory=/opt/zeronet
LimitNOFILE=8192
ExecStart=/opt/zeronet/zeronet --config_file /etc/zeronet.conf
Restart=on-failure
@kseistrup
kseistrup / selenium-screenshotting.md
Created Mar 25, 2016 — forked from dannguyen/selenium-screenshotting.md
Using Selenium and Python to screenshot a javascript-heavy page
View selenium-screenshotting.md

Using Selenium and Python to screenshot a javascript-heavy page

As websites become more JavaScript heavy, it's harder to automate things like screenshotting for archival purposes. I've seen examples and suggestions to use PhantomJS for visual testing/archiving of websites, but have run into issues such as the non-rendering of webfonts. I've never tried out Selenium until today...and while I'm not thinking about performance implications yet, Selenium seems far more accurate than PhantomJS...which makes sense since it actually opens a real browser. And it's not too hard to script to do complex interactions: here's an [example of how to log in to Twitter, write a tweet, upload an image, and send a tweet via Selenium and DOM element selection](https://gist.github.com/dannguyen/8a6fa49253c1d6a0eb92

View musickiller-d.json
{
"info": "id/musickiller",
"zeronet": {
"": "1MKXRXyrPPZWdgw7HLuNGojAUFFirCfdPE",
"blog": "1MKBZ94qaYjane2ixERDbBEazjUg2N9A9T",
"chat": "1MKCZy4C7B7DHKxBvh3zCWYFvCSsXNsWVm"
}
}
View musickiller-id.json
{
"country": "RU",
"locality": "MOCKBA",
"name": {
"formatted": "Music Killer"
}
}
@kseistrup
kseistrup / twtxt-forever.sh
Last active Feb 25, 2016
Bash loop to post twtxt ‘tweets’ forever
View twtxt-forever.sh
#!/bin/bash
MY_PROMPT='twtxt> '
my_ruler () {
local ruler=''
local length=8
local ten='----+----|'
local maxlen="${COLUMNS:-140}"
[[ ${maxlen} -gt 140 ]] && maxlen=140
You can’t perform that action at this time.