Skip to content

Instantly share code, notes, and snippets.

View anroots's full-sized avatar

Ando David Roots anroots

View GitHub Profile
# Chmod this to executable and put into .git/hooks
xdg-open https://www.youtube.com/watch?v=vCadcBR95oU &
@anroots
anroots / hosts
Created October 6, 2018 16:53
Estonian DNS names that serve ads
reklaam.trigger.ee
adserving.budsinc.com
ad.media-servers.net
spe.atdmt.com
adserving.cpxinteractive.com
banner.sportnet.ee
servedby.advertising.com
ad.firstadsolution.com
ad.bannerconnect.net
ads.city24.ee
@anroots
anroots / openshift-username-auth.py
Created May 31, 2018 07:40
Example on how to connect to Openshift 3 using username/password for authentication with openshift-restclient-python
# Example on how to use openshift-restclient-python
# (https://github.com/openshift/openshift-restclient-python)
# without having a local ~/.kube/config file - all params
# are in Python code.
#
# We needed a way to connect to an Openshift3 cluster from Python,
# without external dependencies (config file), but couldn't find
# a way to do this (to get a token using username/password) from the library documentation.
#
# Note #1: Logout is not implemented, the token stays valid
@anroots
anroots / start_ssh_agent.bashrc
Last active March 28, 2018 13:19
.bashrc snippet to automatically start ssh-agent and load it with a key from YubiKey PKCS storage
# Tested on Ubuntu 17.10
# Put this into your .bashrc or similar file
# It will ensure each new terminal window has ssh-agent accessible
# and loaded with YubiKey SSH key
# Built upon work from https://stackoverflow.com/a/18915067/401554
SSH_ENV=$HOME/.ssh/environment
PKCS_PATH=/usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so
function start_agent {
@anroots
anroots / fleep-utf8-proof.py
Created August 1, 2016 06:50
Proof that Fleep handles UTF-8 correctly in conversation topics
# Proof that Fleep handles UTF-8 strings correctly
# and does not sanitize input into ASCII-only strings
#
# You'll need to create a conversation with UTF-8 characters
# in the topic, then filter this conversation out
# in the code below.
import requests
import json
@anroots
anroots / change-fleep-name.py
Created May 25, 2016 08:02
Give yourself random middle names in Fleep (change display name automatically every X interval)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Randomly assign oneself middle names in Fleep
Based on https://github.com/anroots/spotify-fleep-nowplaying
Author: ando@sqroot.eu 2016-05-25
Licence: MIT
Usage example (change Fleep display name every 30 seconds):
@anroots
anroots / lock-control.sh
Created May 3, 2016 11:12
Cycle the screen through "locked" and "unlocked" states while leaving user input blocked
#!/bin/bash
# Script to control screen lock
#
# Dependencies: xtrlock, xscreensaver and xscreensaver-command
#
# Use case: you want the cycle the screen between ON (all windows visible)
# and OFF (blank screen saver, password needed to unlock) states while disabling user input
# when screen is ON. Great for kiosk PC-s to turn the screen off during the night.
#

Keybase proof

I hereby claim:

  • I am anroots on github.
  • I am anroots (https://keybase.io/anroots) on keybase.
  • I have a public key whose fingerprint is CAF6 B111 74C8 316B B3DA F97E 9074 1680 9B91 A011

To claim this, I am signing this object:

@anroots
anroots / 85-veracrypt.rules
Last active September 14, 2022 14:06
Load SSH key into ssh-agent from a veracrypt-encrypted drive when it's plugged in
ACTION=="add", KERNEL=="sd?", ATTRS{serial}=="SERIAL_NUMBER_OF_USB", RUN+="/usr/local/bin/load-ssh-keys"
@anroots
anroots / chuckify.sh
Last active April 1, 2016 14:18
Spam random Chuck Norris facts to a list of target e-mails (spammy April Fools joke)
#!/bin/bash
# Generate a random Chuck Norris fact and e-mail it to the target
# Requires the 'cowsay' and 'cn' (https://www.npmjs.com/package/cn) programs to be installed
# Requires Mailgun API key
#
# Usage: ./chuckify.sh NUM EMAIL
# ...where NUM is an integer of how many e-mails to send and EMAIL is the target's e-mail
#
# Replace placeholders (Mailgun API key and domain)