Skip to content

Instantly share code, notes, and snippets.

@trnila
trnila / cfdns-edit
Created June 2, 2018 07:10
Update cloudflare DNS zone in your editor
#!/bin/sh
history_dir=~/.cloudflare/dns_history
auth_email=$(awk -F = '/email/ {print $2}' ~/.cloudflare/cloudflare.cfg)
auth_key=$(awk -F = '/token/ {print $2}' ~/.cloudflare/cloudflare.cfg )
zone_name=$1
zone_file="$history_dir/$zone_name"
if [ -z "$zone_name" ]; then
echo "Usage: $0 zone.tld"
@trnila
trnila / hard_spaces.sh
Created May 19, 2019 16:40
Fix hardspaces for czech language in LaTeX
#!/bin/sh
awk -i inplace -f - "$1" << 'AWK'
BEGIN {
skip = 0
IGNORECASE=1
}
/\\begin{(minted|lstlisting|tikzpicture)}/ {
skip = 1
}
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <signal.h>
struct termios orig;
void term_cursor_setpos(int row, int col) {