Skip to content

Instantly share code, notes, and snippets.

@leafnode
leafnode / gist:4441994
Last active December 10, 2015 13:38 — forked from anonymous/gist:4356672
Fetch all books from Wolne Lektury
import simplejson, requests, urllib, re
# -*- encoding: utf-8 -*-
from slughifi import slughifi
### http://trac.django-fr.org/browser/site/trunk/project/links/slughifi.py?rev=47
### with django's slugify hardcoded inside from:
### http://code.activestate.com/recipes/577257/
for z in simplejson.loads(requests.get("http://wolnelektury.pl/api/books/").content.decode('utf8')):
p = simplejson.loads(requests.get(z['href']).content)
@leafnode
leafnode / gist:d1a6b960bf8a65a291967723681ebf6a
Created October 3, 2016 13:30 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@leafnode
leafnode / devkitARMUpdate.pl
Created May 13, 2018 20:13 — forked from xvw/devkitARMUpdate.pl
Install or Update the DevKitARM with `perl devkitARMUpdate.pl`
#!/usr/bin/perl
#-----------------------------------------------------------------------------
#
# Copyright (C) 2011
# Michael Theall (mtheall)
# Dave Murphy (WinterMute)
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any
# damages arising from the use of this software.
@leafnode
leafnode / multihooks.py
Created May 15, 2018 12:15 — forked from carlos-jenkins/multihooks.py
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@leafnode
leafnode / pre-commit
Created May 15, 2018 12:24 — forked from ilyakatz/pre-commit
helpful precommit hooks
#!/bin/bash -l
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
.git/hooks/pre-commit-master-no-no
if [[ $? == 1 ]]
then
@leafnode
leafnode / iterm2-solarized.md
Created March 27, 2019 12:17 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@leafnode
leafnode / syslog_netcat.sh
Created July 15, 2019 10:46 — forked from dwallraff/syslog_netcat.sh
Use netcat to send syslog messages
# Here’s how to create UDP syslog messages via nc, netcat:
echo ‘<14>_sourcehost_ messagetext’ | nc -v -u -w 0 _syslog-host_ 514