Skip to content

Instantly share code, notes, and snippets.


Minhaz Mahmud minhaz1

View GitHub Profile
beachandbytes / rtorrent.rc
Created Mar 28, 2015
rTorrent config. Currently moves completed downloads to folders based on label (But only if label is applied before download finishes)
View rtorrent.rc
# rtorrent config file ß
directory = /home/hd4/accountname/torrents/data
session = /home/hd4/accountname/.config/rtorrent/sessP5,5,load_start="~/torrents/watch/*.torrent"
port_range = 57657-57657
encryption = allow_incoming,enable_retry,try_outgoing
dht = off
peer_exchange = no
check_hash = no
execute = {sh,-c,rm -f /home/hd4/accountname/.config/rtorrent/session/rpc.socket}
scgi_local = /home/hd4/accountname/.config/rtorrent/session/rpc.socket
# Some things taken from here
# Set the colours you can use
kwlzn /
Last active Jun 13, 2018
uWSGI + pex

Building a test pex

yakuza:src kw$ cat testapp/
#!/usr/bin/env python

from distutils.core import setup
scy /
Last active Mar 1, 2021
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost
supairish / gist:2951524
Created Jun 18, 2012
Nginx - how to limit requests by User Agent
View gist:2951524
http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot) $binary_remote_addr;
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {