Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
lyoshenka / clean-whiteboard-photo.scm
Created January 15, 2015 04:07
GIMP Script-Fu to clean up whiteboard photographs to bring out the writing.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; clean-whiteboard-photo.scm --- Cleans up whiteboard Photographs to bring out the writing.
;; https://github.com/kyleburton/sandbox/blob/master/gimp/clean-whiteboard-photo.scm
;;
;; Copyright (C) 2009 Kyle R. Burton <[email protected]>
;;
;; Author: Kyle R. Burton <[email protected]>
;;
;; Commentary:
;;
@lyoshenka
lyoshenka / RssToTrello.php
Last active August 25, 2016 11:09
Script to pull RSS data and create a Trello card for each post. Useful for Beeminder RSS integration since they don't support it but they do support Trello.
#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';
// FILL IN ALL THESE VALUES. ALL ARE REQUIRED
const TRELLO_KEY = ''; // https://trello.com/1/appKey/generate
const TRELLO_TOKEN = ''; // https://trello.com/1/connect?key=YOUR-KEY-HERE&name=rss2trello&response_type=token&scope=read,write&expiration=never
const TRELLO_BOARD_ID = ''; // the hashs after the /b/ when you're viewing the board. e.g. https://trello.com/b/d5jHzcDp/
const TRELLO_LIST = ''; // name of list where cards will be added
@lyoshenka
lyoshenka / ssl_cipher_test.sh
Created October 30, 2014 14:54
Checks what SSL ciphers a server supports.
#!/usr/bin/env bash
# source: https://superuser.com/questions/109213/is-there-a-tool-that-can-test-what-ssl-tls-cipher-suites-a-particular-website-of
# OpenSSL requires the port number.
SERVER=hostname:443
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
@lyoshenka
lyoshenka / bencode.py
Created October 14, 2014 16:45
Check torrents, change tracker on torrents, print invalid files in torrents
# Written by Petru Paler
# see LICENSE.txt for license information
# http://chris.ill-logic.com/sandbox/browser/python/bencode.py
from types import IntType, LongType, StringType, ListType, TupleType, DictType
import re
from cStringIO import StringIO
int_filter = re.compile('(0|-?[1-9][0-9]*)e')
@lyoshenka
lyoshenka / pre-commit
Last active August 29, 2015 14:06 — forked from Simbul/pre-commit
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]
@lyoshenka
lyoshenka / pre-push.sh
Last active June 14, 2023 06:55 — forked from greglboxer/pre-push.sh
Git pre-push hook to prevent force-pushing or deleting a special branch (e.g. master)
#!/bin/bash
# Requires git 1.8.2 or newer
# Prevents force-pushing or deleting a special branch (e.g. master).
# Based on: https://gist.github.com/pixelhandler/5718585 and https://gist.github.com/stefansundin/d465f1e331fc5c632088
# Install:
# cd path/to/git/repo
# curl -fL -o .git/hooks/pre-push https://gist.githubusercontent.com/lyoshenka/158cfff41d09e1dcf029/raw/pre-push.sh
# chmod +x .git/hooks/pre-push
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@lyoshenka
lyoshenka / wget.sh
Created August 6, 2014 12:24
Archive/mirror a whole site with wget
wget --mirror --page-requisites --continue --convert-links --user-agent="" --execute robots=off --wait 1 URL
@lyoshenka
lyoshenka / aws_s3_public_bucket_policy.json
Last active August 29, 2015 14:04
Make your whole S3 bucket publicly readable
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::BUCKETNAME/*"]
}]
}
@lyoshenka
lyoshenka / safe.md
Last active August 29, 2015 14:04
My summary of SAFE terms

Note: I am not a lawyer. This is my simple understanding in layman's terms.

What is a SAFE?

A SAFE is an agreement between you and a company that lets you buy company stock at a specific price when a specific event occurs.

Price

When the specified event occurs, you get company stock. The amount of stock you get is equal to the price you paid for the SAFE divided by your personal price per share. Your price per share is the same price that everyone else gets, possibly modified by a valuation cap or a discount.