Skip to content

Instantly share code, notes, and snippets.

@mathrick
mathrick / paramiko_rekey.py
Last active September 30, 2016 23:06
Paramiko rekeying failure
#!/usr/bin/python
import argparse
import paramiko
import sys
import time
DATAFILE = '/tmp/file.txt'
class AcceptPolicy(paramiko.client.MissingHostKeyPolicy):
class Comparable(object):
def __init__(self, name):
self.name = name
self.is_neg = False
def __neg__(self):
self.is_neg = not self.is_neg
return self
def op(self, op, value):
@mathrick
mathrick / deps
Last active December 31, 2015 18:59
scons: *** [buildout\mass-effect.exe] TypeError : Tried to lookup Dir 'code' as a File. scons: building terminated because of errors.
+-.
+-buildout
| +-buildout\mass-effect.exe
| | +-code\mass-effect.asd
| +-buildout\MassEffect.exe
| +-buildout\privkey.dat
| +-buildout\pubkey.dat
| +-buildout\runsilent.exe
| | +-tools\runsilent.o
| | | +-tools\runsilent.c
module BadBehaviour
module DefaultSettings
def strict
false
end
def verbose
false
end
end
@mathrick
mathrick / wrap-region-autoloads.el
Created August 30, 2013 20:44
Problems testing MC on 24.2
mathrick@megumi ~/elisp/dist/git/multiple-cursors $ cask
Contacting host: melpa.milkbox.net:80
Saving file /home/mathrick/elisp/dist/git/multiple-cursors/.cask/24.2.1/elpa/archives/melpa/archive-contents...
Loading vc-bzr...
Loading vc-git...
Wrote /home/mathrick/elisp/dist/git/multiple-cursors/.cask/24.2.1/elpa/archives/melpa/archive-contents
Contacting host: elpa.gnu.org:80
Saving file /home/mathrick/elisp/dist/git/multiple-cursors/.cask/24.2.1/elpa/archives/gnu/archive-contents...
Wrote /home/mathrick/elisp/dist/git/multiple-cursors/.cask/24.2.1/elpa/archives/gnu/archive-contents
Contacting host: elpa.gnu.org:80
@mathrick
mathrick / date-time-mockup.ui
Created July 30, 2013 23:42
Cinnamon date & time settings UI mockup
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<foal>
<object class="GtkExpander" id="expander1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
@mathrick
mathrick / whom-guide.md
Last active December 10, 2015 08:48
Easy guide to using "who" and "whom"

Learn how to use "whom" in 10 seconds flat

"Whom" is the so called oblique case of "who" (which itself is the nominative case). That gives ponies trouble, because pronouns are the only thing left in the English language that still retain the distinction between the two. But the rules are simple: nominative is used for subjects of actions (ie. "who did X?") and oblique is used for objects of actions (ie. "X was done to whom?"). And "who" to "whom" is the same thing as "I" to "me", "he" to "him", "she" to "her", "we" to "us", etc. If in doubt, rewrite with "him" instead for "whom", and see if it works:

  • [✓] Whom should I ask? → I should ask him
  • [✗] Whom goes there?Him goes there
  • [✗] The pony whom directs a film is called a directorHim directs a film
  • [✓] The pony whom I loved the most was my father → I loved him the most
@mathrick
mathrick / extract-gettext.pl
Created November 25, 2012 17:31
Look ma, Imma perl
#!/usr/bin/perl
use warnings;
use strict;
my $PACKAGE = "AdvoWEB";
my $VERSION = "1.0";
use Time::gmtime qw(:FIELDS);
use HTML::Parser;
use Locale::PO;
@mathrick
mathrick / icc2-operation.txt
Created October 15, 2012 21:23
ICC2 structure
1. I want to see pics of Rarishy
2. Fire up querytool.py
3. Input "rarity fluttershy"
4. A list of images (ideally with thumbnails, but it's not needed for conceptual working) comes up
5. Click Save → ICC2/queries/Rarishy/ is created
Rarishy/
01.jpg → ../../c/c8/c85320d9ddb90c13f4a215f1f0a87b531ab33310.jpg
02.png → ../../7/7d/7d97e98f8af710c7e7fe703abc8f639e0ee507c4.png
...