Skip to content

Instantly share code, notes, and snippets.

Ando "David" Roots anroots

Block or report user

Report or block anroots

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pre-push
# Chmod this to executable and put into .git/hooks
xdg-open https://www.youtube.com/watch?v=vCadcBR95oU &
@anroots
anroots / hosts
Created Oct 6, 2018
Estonian DNS names that serve ads
View hosts
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
Example on how to connect to Openshift 3 using username/password for authentication with openshift-restclient-python
View openshift-username-auth.py
# 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 Mar 28, 2018
.bashrc snippet to automatically start ssh-agent and load it with a key from YubiKey PKCS storage
View start_ssh_agent.bashrc
# 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 Aug 1, 2016
Proof that Fleep handles UTF-8 correctly in conversation topics
View fleep-utf8-proof.py
# 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
Give yourself random middle names in Fleep (change display name automatically every X interval)
View change-fleep-name.py
#!/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
Cycle the screen through "locked" and "unlocked" states while leaving user input blocked
View lock-control.sh
#!/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.
#
View keybase.md

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 Oct 16, 2016
Load SSH key into ssh-agent from a veracrypt-encrypted drive when it's plugged in
View 85-veracrypt.rules
ACTION=="add", KERNEL=="sd?", ATTRS{serial}=="SERIAL_NUMBER_OF_USB", RUN+="/usr/local/bin/load-ssh-keys"
@anroots
anroots / chuckify.sh
Last active Apr 1, 2016
Spam random Chuck Norris facts to a list of target e-mails (spammy April Fools joke)
View chuckify.sh
#!/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)
You can’t perform that action at this time.