Skip to content

Instantly share code, notes, and snippets.

@johnxx
johnxx / wider-than.sh
Created May 6, 2016 18:05
Links pictures over a certain width (and ratio) to a new directory
#!/bin/sh
[ $1 != '' ] || exit 1
source=$1
width=$2
IFS='
'
debug=1
mkdir -p $width
for n in $(find $source -type f -regextype posix-egrep \
-regex '.*.(png|jpg|jpeg|gif)') ; do
@johnxx
johnxx / rsyslog.conf.patch
Created May 6, 2016 00:54
Enabling rsyslog remote listening on Debian
--- rsyslog.conf.bak 2015-02-19 09:48:58.829059788 +0000
+++ rsyslog.conf 2015-03-12 00:33:46.052507878 +0000
@@ -20,6 +20,9 @@
#$ModLoad imtcp
#$InputTCPServerRun 514
+$ModLoad imrelp
+$InputRELPServerRun 10514
+
[19:37:34] [Client thread/INFO]: Connecting to kira.ageofikon.com, 25565
[19:37:40] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@5ce44fd8[id=d25a3f8e-36dc-48df-992b-9b2d5658ebc9,name=murdersaur,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:135) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SourceFile:106) [brm.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_77]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unkn
protected function _generate_batch_guid() {
$algorithm = 'sha256';
$curtime = time();
$rand = openssl_random_pseudo_bytes(16);
$hash = hash($algorithm, "$this->to $this->body $curtime $rand");
$version = "1/";
return $version.$hash;
}
@johnxx
johnxx / keybase.md
Created March 22, 2014 01:21
Keybase identity proof

Keybase proof

I hereby claim:

  • I am johnxx on github.
  • I am johnxx (https://keybase.io/johnxx) on keybase.
  • I have a public key whose fingerprint is 74B8 4DC1 0587 2BBE CC6E A111 531D 7C9A C9A8 0056

To claim this, I am signing this object: