Skip to content

Instantly share code, notes, and snippets.

View Killeroid's full-sized avatar

Kwaku Yeboah-Antwi Killeroid

View GitHub Profile
@Killeroid
Killeroid / guide.md
Created October 27, 2018 17:41 — forked from peteryates/guide.md
How to stop adverts appearing on your Samsung TV

I'm getting adverts in my TV's UI, help!

Samsung's otherwise excellent 2016 range of UHD TVs received an update that added advertisements to the UI. This has been complained about at great length on Samsung's forums and repeatedly, Samsung have refused to add an option to remove them.

The ads interrupt the clean UI of the TV and are invasive. Here's an example of how they look:

one two

This guide was originally posted on Samsung's TV forums but unfortunately, that site is a super-slow and barely accessible unusable mess.

@Killeroid
Killeroid / fresh-chrome.sh
Created September 20, 2018 08:12 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@Killeroid
Killeroid / ClasspathTestRunner.java
Created July 9, 2018 10:19 — forked from davehagler/ClasspathTestRunner.java
Custom Classpath JUnit Test Runner
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;
public class ClasspathTestRunner extends BlockJUnit4ClassRunner {
import argparse
import math
import math
from syncclient.client import SyncClient, FxAClient, TOKENSERVER_URL, six, hexlify, sha256
from pprint import pprint
import json
import hmac
import hashlib
import base64
from Crypto.Cipher import AES
@Killeroid
Killeroid / gpg-import-and-export-instructions.md
Created October 18, 2017 11:51
How to export and import gpg keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc

/*
* Copyright (c), MM Weiss
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
@Killeroid
Killeroid / git2dch.sh
Created August 2, 2017 21:41 — forked from nikicat/git2dch.sh
Shell script to regenerate debian changelog from git log
#!/bin/sh
sudo apt-get install -y moreutils git-buildpackage
>debian/changelog
prevtag=initial
pkgname=`cat debian/control | grep '^Package: ' | sed 's/^Package: //'`
git tag -l v* | sort -V | while read tag; do
(echo "$pkgname (${tag#v}) unstable; urgency=low\n"; git log --pretty=format:' * %s' $prevtag..$tag; git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' $tag^..$tag) | cat - debian/changelog | sponge debian/changelog
prevtag=$tag
@Killeroid
Killeroid / type_map.clj
Created April 13, 2012 09:33
A map push instruction. Iterates top item on exec stack all over a collection
(defn type_map
[type]
(fn [state]
(if (or (not (empty? (type state)))
(not (empty? (:exec state)))
(not (empty? (:float state)))
(number? (top-item :float state)))
(let [items (ensure-list (take (top-item :float state) (type state)))
answer (doall (for [item (ensure-list (reverse (take (top-item :float state) (type state))))]
(list item
@Killeroid
Killeroid / gist:2375316
Created April 13, 2012 09:08
Lexicase Parent selection implementation for clojush
(defn lexicase-selection
"Returns an individual that does the best on a randomly selected set of fitness cases"
[pop tournament-size]
(loop [survivors pop
cases (shuffle (range (count (:errors (first pop)))))]
(if (or (empty? cases)
(empty? (rest survivors)))
(first survivors)
(let [min-err-for-case (apply min (map #(nth % (first cases))
(map #(:errors %) survivors)))]