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/ruby | |
require 'net/http' | |
body = Net::HTTP.get(URI("https://www.thesaurus.com/e/synonym-of-the-day/")) | |
r = /<a.*href="https:\/\/www\.thesaurus\.com\/browse\/.+".*>(\S+)<\/a>\s*is another word for\s*<a.*href="https:\/\/www\.thesaurus\.com\/browse\/.+".*>\s*(\S+)\s*<\/a>\s*<\/h2>/ | |
firstword, secondword = r.match(body).captures | |
system("{ |
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
[Unit] | |
Description=Sync directory %i with unison | |
[Service] | |
ExecStart=bash -c 'unison -sshargs "-i $HOME/.ssh/xlab18" -auto -batch $HOME/%i ssh://x-lab18.local.boem/unison/%i' | |
Restart=no |
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' |
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
import Data.Char (ord) | |
import Data.Bits (xor) | |
-- Complete the incantation... | |
flag = "HTB{4_m0n4d_15_ju57_4_m0n01d_1n_7h3_c47360ry_0f_3nd0func70r5!!}" | |
extractFlag :: String -> String | |
extractFlag (s:rest) | |
| s == 'H' || s == 'T' || s == 'B' | |
= extractFlag rest |
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 | |
set -e | |
lastport=`cat ~/.lastport || echo 4000` | |
newport=$(($lastport+1)) | |
docker run -d -e "CTF_KEY=juicelympicsgobrrrrr" -e "NODE_ENV=ctf" -p $newport:3000 bkimminich/juice-shop |
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/ruby | |
puts <<-"EOF" | |
____ _____ _____ __ _ _____ | |
/ __ \\ / ____|/ ____| \\ \\ /\\ | | / ____| /\\ | |
| | | | (___ | | _____\\ \\ / \\ | | | (___ / \\ | |
| | | |\\___ \\| | |______> > / /\\ \\ | | \\___ \\ / /\\ \\ | |
| |__| |____) | |____ / / / ____ \\| |____ ____) / ____ \\ | |
\\____/|_____/ \\_____| /_/ /_/ \\_\\______|_____/_/ \\_\\ |
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/ruby | |
puts <<-"EOF" | |
____ _____ _____ __ __ __ _____ _____ | |
/ __ \\ / ____|/ ____| \\ \\ | \\/ | __ \\| __ \\ | |
| | | | (___ | | _____\\ \\ | \\ / | |__) | | | | | |
| | | |\\___ \\| | |______> > | |\\/| | ___/| | | | | |
| |__| |____) | |____ / / | | | | | | |__| | | |
\\____/|_____/ \\_____| /_/ |_| |_|_| |_____/ | |
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 | |
set -e | |
DSTDIR="/tmp" | |
if [[ -z $1 ]]; then | |
echo No package specified >&2 | |
exit 1 | |
fi |