Skip to content

Instantly share code, notes, and snippets.

View michenriksen's full-sized avatar

Michael Henriksen michenriksen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am michenriksen on github.
  • I am michenriksen (https://keybase.io/michenriksen) on keybase.
  • I have a public key whose fingerprint is 6E84 2CEC 82F6 9A2E 0AEF D873 669F 1E2A 8DFA 5CA5

To claim this, I am signing this object:

@michenriksen
michenriksen / anti-theft
Created May 27, 2014 09:10
Simple anti-theft script for Debian systems. When the machine enters battery mode while in lockscreen/screensaver, kill KeePassX, Chromium, Firefox, dismount TrueCrypt volumes and shut down.
#!/bin/sh
# Put this file in /etc/pm/power.d/ and make it executable
case $1 in
true)
# Replace <username> with your actual username.
# You might need to use gnome-screensaver-command instead
if DISPLAY=:0.0 XAUTHORITY=/home/<username>/.Xauthority sudo -u <username> cinnamon-screensaver-command -q | egrep -q 'is active'; then
# Kill KeePassX
killall keepassx
@michenriksen
michenriksen / firehose.rb
Last active August 29, 2015 14:07
Script to view Firechat broadcast messages
# Read more about the issue here: http://breizh-entropy.org/~nameless/random/posts/firechat_and_nearby_communication/
require 'socket'
require 'openssl'
require 'json'
require 'cgi'
FIRECHAT_HOST = '209.237.236.194'
FIRECHAT_PORT = 4176
@michenriksen
michenriksen / dnscheck.rb
Created November 2, 2012 15:29 — forked from daniel-marschner/gist:4001503
Loops until given domain is resolvable. Used to check when new domains are live.
require 'resolv'
require 'date'
unless @domain = ARGV.first
puts "DNS Checker\n\n"
puts "Performs a DNS lookup on a domain until it can be resolved.\n\n"
puts "USAGE:"
puts " ruby #{__FILE__} <domain> [<sleep>]\n\n"
@michenriksen
michenriksen / freenodes.sh
Last active December 25, 2015 12:09
The Freenode IRC network supports connections via Tor hidden service URL's which provides solid anonymity and security, but unfortunately the hosts are a little flaky and you will have to regularly switch out the host. This simple shell script makes it easy to figure out which ones are alive. Note: The scripts assumes that Torsocks (https://code…
hosts=( p4fsi4ockecnea7l.onion lgttsalmpw3qo4no.onion 5jebommkgbfl6agc.onion lbkwyb2csfcgoxwa.onion )
for i in "${hosts[@]}"
do
torsocks 2>&1 > /dev/null nc -w5 $i 6667 2>&1 > /dev/null && echo " ✔ $i is alive!" || echo " ✖ $i seems dead."
done
@michenriksen
michenriksen / mailspoof.rb
Created January 16, 2014 12:08
A Ruby script for spoofing mail directly to the destination's SMTP server. This is not my work, got it from https://defuse.ca/email-spoofing-in-ruby.htm
# A Ruby script for spoofing mail directly to the destination's SMTP server.
# https://defuse.ca/email-spoofing-in-ruby.htm
#
# This code is in the public domain. Do whatever you want with it.
#
# Usage: mailspoof.rb <options>
# -t, --to ADDRESS Send mail to this email address
# -f, --from ADDRESS Send mail from this email address
# -s, --subject SUBJECT Mail subject
# -m, --mail FILE File containing email message
@michenriksen
michenriksen / detect-hunchly.html
Created November 14, 2016 13:34
Detecting Hunchly
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Detecting Hunchly</title>
</head>
<body>
<div id="canary">
John Doe johndoe@gmail.com 888444333
@michenriksen
michenriksen / tweeter_feed
Created September 3, 2017 06:40
Quick Ruby script to generate a Twitter search URL combining Tweets from multiple users
#!/usr/bin/env ruby
require "cgi"
BASE_URI = "https://twitter.com/search?f=tweets".freeze
if ARGV.empty?
puts "USAGE: tweeter_feed screenname1 [screenname2] ... [screennameN]"
exit 1
end
@michenriksen
michenriksen / output
Created December 15, 2017 21:17
FCC Wiki edits stats
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
TOP 10 CONTRIBUTORS:
192.104.54.21: 50 (https://en.m.wikipedia.org/wiki/Special:Contributions/192.104.54.21)
192.104.54.79: 49 (https://en.m.wikipedia.org/wiki/Special:Contributions/192.104.54.79)
192.104.54.179: 31 (https://en.m.wikipedia.org/wiki/Special:Contributions/192.104.54.179)
192.104.54.77: 23 (https://en.m.wikipedia.org/wiki/Special:Contributions/192.104.54.77)
192.104.54.166: 11 (https://en.m.wikipedia.org/wiki/Special:Contributions/192.104.54.166)
192.104.54.4: 9 (https://en.m.wikipedia.org/
@michenriksen
michenriksen / dnsdb_crawl.rb
Created April 2, 2017 11:57
Quick Ruby script for extracting domains from dnsdb.org
#!/usr/bin/env ruby
require "net/http"
require "uri"
require "cgi"
require "resolv"
require "optparse"
require "socket"
require "timeout"