Skip to content

Instantly share code, notes, and snippets.

🌭
hotdog

Joseph Chiocchi yyolk

🌭
hotdog
Block or report user

Report or block yyolk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yyolk
yyolk / _rtorrent-pushover.md
Last active Jun 11, 2019
rtorrent + pushover howto & sample
View _rtorrent-pushover.md

#script to use pushover for rtorrent notifications

Used for openelec [unofficial][unofficial] rtorrent addon but can be part of any rtorrent setup.

  1. Buy Pushover for [iOS][ios] or [Android][android]
  2. Create a new app, and upload a custom icon for your notifications.
  3. [Download][rbraw] or copy rtorrent-notification.rb into a new file
  4. Insert your new app's API token in script under token
@yyolk
yyolk / random-psw.py
Created Feb 12, 2019
generates a random psw of 8-16 of length
View random-psw.py
import string
MIN_LEN, MAX_LEN = 8, 16
from random import randint, choice
characters = string.ascii_letters + string.punctuation + string.digits
password = lambda : "".join(choice(characters) for x in range(randint(MIN_LEN, MAX_LEN)))
print(password())
@yyolk
yyolk / RDS-Aurora-CloudFormation-Example.yaml
Created Mar 2, 2017 — forked from sjparkinson/RDS-Aurora-CloudFormation-Example.yaml
A basic CloudFormation template for an RDS Aurora cluster.
View RDS-Aurora-CloudFormation-Example.yaml
---
AWSTemplateFormatVersion: 2010-09-09
Description: A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseInstanceType:
Default: db.r3.large
AllowedValues:
- db.r3.large
- db.r3.xlarge
- db.r3.2xlarge
@yyolk
yyolk / index.js
Last active Sep 29, 2018 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
View index.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
View auto_method_naming_with_inheritance.py
class Base():
def __init__(self, *a, **k):
exec( "self.{} = self._op".format(
kw.get('override_fn_name',
self.__class__.__name__.lower())))
def _op(self, *a, **k):
pass
@yyolk
yyolk / seeyouspacecowboy.sh
Created Aug 6, 2018 — forked from softdetours/seeyouspacecowboy.sh
A shell script to display SEE YOU SPACE COWBOY whenever you logout of your terminal!
View seeyouspacecowboy.sh
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
@yyolk
yyolk / CapsLockCtrlEscape.ahk
Created Aug 5, 2018 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
View CapsLockCtrlEscape.ahk
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@yyolk
yyolk / Threadsafe_iter.py
Created Aug 4, 2018 — forked from platdrag/Threadsafe_iter.py
An example generic wrapper for making any iterator / generator thread-safe compatible with python 3
View Threadsafe_iter.py
import threading
'''
A generic iterator and generator that takes any iterator and wrap it to make it thread safe.
This method was introducted by Anand Chitipothu in http://anandology.com/blog/using-iterators-and-generators/
but was not compatible with python 3. This modified version is now compatible and works both in python 2.8 and 3.0
'''
class threadsafe_iter:
"""Takes an iterator/generator and makes it thread-safe by
serializing call to the `next` method of given iterator/generator.
"""
@yyolk
yyolk / simple-nginx-webdav.sh
Created Jul 14, 2018 — forked from dysinger/simple-nginx-webdav.sh
A simple nginx/webdav setup for use with things like mobile-org
View simple-nginx-webdav.sh
#!/bin/sh
# on ubuntu: need some utils & dev libs
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev
# compile nginx
cd /tmp
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz
cd nginx*
./configure --with-http_ssl_module --with-http_dav_module \
@yyolk
yyolk / index.md
Created Jul 4, 2018 — forked from alexcasalboni/index.md
Bridge Function between Kinesis Streams and Step Functions
View index.md

Bridge Function between Kinesis Streams and Step Functions

For each record read from the Kinesis Stream, a StepFunction state machine will be executed asynchronously.

Required Environment Variables

  • region: the AWS region where your StepFunction state machine is defined.
  • stateMachineArn: the ARN of the StepFunction state machine you want to execute.

Notes

You can’t perform that action at this time.