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 fish | |
while true | |
read -P "" input | |
if test $status -ne 0 | |
break | |
end | |
echo $input | |
end | $argv | |
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 RecipientEmailFixerRoundcube | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function on_mutation() { | |
document.querySelectorAll("body.action-compose li.recipient").forEach(recipient => { | |
if (!recipient.fixed) { | |
const [name, email] = recipient.children |
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 fish | |
set packages (paclist core | cut -f1 -d' ') | |
set --erase IFS | |
set parallel 10 | |
set mirror 'http:\/\/ftp.snt.utwente.nl\/pub\/os\/linux\/archlinux\/$repo\/os\/$arch' | |
# setup the config | |
set config (cat pacman.conf | sed \ | |
-e "s/Include = \/etc\/pacman.d\/mirrorlist/Server = $mirror/" \ | |
-e "s/\#ParallelDownloads = 5/ParallelDownloads = $parallel/" |
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
#include <stdio.h> | |
#define COROUTINE static long ip = 0; if (ip) asm ("jmp *%0" : : "r" (ip + 7)); | |
#define YIELD_32(i) asm volatile("movl %1, %%eax \n pop %%rbp \n call 1f\n 1: pop %0 \n ret" : "=m" (ip) : "r" (i)); | |
int fibonacci() { | |
COROUTINE | |
YIELD_32(0); | |
YIELD_32(1); | |
YIELD_32(1); |
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/sh | |
file=`ls -dt ~/wallpapercycle/* | tail -n1` | |
touch $file | |
echo $file | |
feh --bg-tile $file |
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 fish | |
argparse n/nameserver= d/domain= w/wordlist= o/output= -- $argv | |
or exit | |
if test -z $_flag_n; or test -z $_flag_d; or test -z $_flag_w | |
echo "Required arguments: nameserver, domain, wordlist" | |
echo "You can find the nameserver with nslookup and querytype=soa" | |
exit | |
end |
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/fish | |
# Tunnel a wireguard interface | |
set dev $argv[1] | |
set peer $argv[2] | |
if test -z $dev | |
echo "No device specified" | |
exit | |
end |
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
File.write 'hn.csv', Nokogiri(Net::HTTP.get(URI('https://news.ycombinator.com'))).css('.titleline > a', '.subline').each_slice(30).to_a.transpose.map {|a,l|[a.text, a.attr('href'), l.css('.score').first.text.chomp(' points').to_i, l.css('.hnuser').first.text, l.css('.age').first.attr('title')].to_csv}.join |
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
require "httparty" | |
require "colorize" | |
# Possible values: ca1 usa10 usa11 usa13 usa14 uk3 uk5 germany4 germany5 germany6 france3 | |
SERVER = "germany4" | |
PKGBUILD = File.read("PKGBUILD") | |
old_version = PKGBUILD.split(/\n/).find{|l| l.start_with? "pkgver="}.split("=").last | |
abort "Version detected as #{old_version.inspect.red} which does not match the format, quitting" if !/\d+\.\d+\.\d+/.match? old_version |
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 ruby | |
FILENAME = ARGV[0] | |
abort "No filename given" if !FILENAME | |
clog = "" | |
STARTTIME = Time.now | |
File.write FILENAME, `date`, mode: 'a' |
NewerOlder