Skip to content

Instantly share code, notes, and snippets.

View leto's full-sized avatar
🐉
The Blocks Must Flow

Duke Leto leto

🐉
The Blocks Must Flow
View GitHub Profile
@leto
leto / angry-at-ack.txt
Created March 20, 2015 18:26
The nightmare of ack removing the -a feature
(foobar)(~/git/dingdong/api master $% )$ ack --version
ack 2.14
Running under Perl 5.16.2 at /usr/bin/perl
Copyright 2005-2014 Andy Lester.
This program is free software. You may modify or distribute it
under the terms of the Artistic License v2.0.
(foobar)(~/git/dingdong/api master $% )$ grep -r api_key config/nginx/ | wc -l
5
(kali)root@localhost:~# halt
WARNING: could not determine runlevel - doing soft halt
(it's better to use shutdown instead of halt from the command line)
shutdown: /run/initctl: No such file or directory
init: /run/initctl: No such file or directory
(kali)root@localhost:~#
@leto
leto / keybase.md
Created April 28, 2015 20:51
Keybase verification

Keybase proof

I hereby claim:

  • I am leto on github.
  • I am dukeleto (https://keybase.io/dukeleto) on keybase.
  • I have a public key whose fingerprint is F162 19F4 C23F 9111 2E9C 734A 8DFC BF8E 5A4D 8019

To claim this, I am signing this object:

from sqlalchemy import schema, types
metadata = schema.MetaData()
page_table = schema.Table('page', metadata,
schema.Column('id', types.Integer, primary_key=True),
schema.Column('name', types.Unicode(255), default=u''),
schema.Column('title', types.Unicode(255), default=u'Untitled Page'),
schema.Column('content', types.Text(), default=u''),
)
@leto
leto / gist:76541d4b0d34ffeb906b
Created June 16, 2015 14:05
Convenience python function to save to a DB with proper error checking
def save_to_db(item, msg):
"""Convenience function to wrap a proper DB save"""
try:
log_debug(msg)
db_session.add(item)
log_debug('added to session')
db_session.commit()
return True
except Exception, e:
log_error('DB Exception! %s' % e )
@leto
leto / a248.e.akamai.net_trojan.pem
Created June 29, 2015 20:45
Is this a #trojancert for a248.e.akamai.net ?
-----BEGIN CERTIFICATE-----
MIIFvDCCBKSgAwIBAgIUA7867y+ifJa4yo+5Wc0zLJ1QETgwDQYJKoZIhvcNAQEF
BQAwgY0xCzAJBgNVBAYTAk5MMRIwEAYDVQQHEwlBbXN0ZXJkYW0xJTAjBgNVBAoT
HFZlcml6b24gRW50ZXJwcmlzZSBTb2x1dGlvbnMxEzARBgNVBAsTCkN5YmVydHJ1
c3QxLjAsBgNVBAMTJVZlcml6b24gQWthbWFpIFN1cmVTZXJ2ZXIgQ0EgRzE0LVNI
QTEwHhcNMTUwNjE5MTY1MjA3WhcNMTYwNjE5MTY1MjA1WjBtMQswCQYDVQQGEwJV
UzELMAkGA1UECBMCTUExEjAQBgNVBAcTCUNhbWJyaWRnZTEhMB8GA1UEChMYQWth
bWFpIFRlY2hub2xvZ2llcyBJbmMuMRowGAYDVQQDExFhMjQ4LmUuYWthbWFpLm5l
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANmixJDgkMZBNJ3z1ZX6
2sOBu+TuCRHkpUVtcyoZ+Togno0UTxe4WtOCPNDV86SwP7c6bLV6OurTFImyrBy2
I believe that banking institutions are more dangerous to our
liberties than standing armies. If the American people ever allow
private banks to control the issue of their currency, first by inflation,
then by deflation, the banks and corporations that will grow up around
[the banks] will deprive the people of all property until their children
####### git aliases
alias grc="git rebase --continue"
alias glp="git log -p"
alias githist="git log -p"
alias undo="git reset HEAD^"
alias gd="git diff --cached -a --diff-filter=ACDTMR |colordiff|less -R"
alias gdc="git diff -a --diff-filter=ACDTMR |colordiff|less -R"
alias gca="git commit -a"
alias gsa="git status -a"
alias gco="git checkout"
(kadath)(~/git/Math-Primality funky )$ perl -d t/is_strong_lucas_pseudoprime.t
Loading DB routines from perl5db.pl version 1.3
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
1..4
main::(t/is_strong_lucas_pseudoprime.t:11):
11: local $TODO = "is_strong_lucas_psuedoprime is being worked on";
(kadath)(~/git/Math-Primality funky )$ perl -d t/is_strong_lucas_pseudoprime.t
Loading DB routines from perl5db.pl version 1.3
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
1..12
main::(t/is_strong_lucas_pseudoprime.t:10):
10: ok(is_strong_lucas_pseudoprime(2), "is_strong_lucas_pseudoprime should return true for 2");