Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
bryanjswift / .rtorrent.rc
Created December 28, 2011 02:42
rtorrent configuration file with description
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
@jedda
jedda / ResumePauseiTunesDownloads.applescript
Created March 24, 2012 01:33
Resume/Pause iTunes Downloads with AppleScript
# Resume/Pause iTunes Downloads with AppleScript
# Jedda Wignall
# http://jedda.me
# jedda@jedda.me
#
# For use with Ration: http://www.rationapp.com
# You will need to edit the row number on line 19 to match your settings in iTunes.
# Row 16 worked for me, but you may not have Podcasts or other lines displayed, so this could break it.
# Play around, and you should get it working. Maybe i'll edit this at some stage to do some more checking
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active June 21, 2024 07:34
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@larsks
larsks / blogger2scriptogram.py
Created November 6, 2012 04:23
Convert Blogger posts to Markdown for use with Scriptogr.am
#!/usr/bin/python
import os
import sys
import argparse
import iso8601
import re
import subprocess
import logging
import json
@jstangroome
jstangroome / ConvertFrom-IISW3CLog.ps1
Created August 8, 2013 23:06
Function to convert lines in an IIS W3C log file to PowerShell objects
function ConvertFrom-IISW3CLog {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('PSPath')]
[string[]]
$Path
)
process {
@hynkle
hynkle / osascript.md
Last active December 17, 2023 11:25
Getting AppleScript to output multiple lines to shell when executed with `osascript` proved challenging.

I wanted to output a list of single-line strings, each item separated by a newline. I couldn't find a way to do that without combining them all into a single string. Fine.

Reasonable attempt:

osascript -e '
set myList to {"foo", "bar", "baz"}
set myString to ""
repeat with myItem in myList
 set myString to myString & myItem & return
@eur0pa
eur0pa / eur0pa-dks_deathtoll.py
Last active October 7, 2022 14:00
Dark Souls Deaths Counter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
def main():
with open('DRAKS0005.sl2', 'rb') as fo:
fo.seek(0x2c0, 0)
for slot in range(0, 10):
fo.seek(0x100, 1)
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

Livestreaming via PS4 to a local RTMP server

Live stream from your PS4 to a local computer running an RTMP server by intercepting the twitch.tv stream.

Requirements

  • DD-WRT enabled Router (or router with iptables compatibility)
  • nix Envirment
  • nginx with the nginx-rtmp-module