Skip to content

Instantly share code, notes, and snippets.

View piraveen's full-sized avatar

Piraveen Kamalathas piraveen

View GitHub Profile
@piraveen
piraveen / transmission_remove_finished.sh
Last active May 11, 2022 08:51 — forked from pawelszydlo/transmission_remove_finished.sh
Script to clear finished torrents from transmission-daemon
#!/bin/bash
# Clears finished downloads from Transmission.
# Version: 1.1
#
# Newest version can always be found at:
# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a
#
# Server string is resolved in this order:
# 1. TRANSMISSION_SERVER environment variable

Tested only for Debian/Ubuntu

Prerequisites

  • Requires "sudo" or "root" privileges
  • UNRAID_MOUNT_TAG_NAME => defined on the UNRAID VM settings
  • /PATH/TO/MOUNT/FOLDER => should be created on the VM if it doesn't exist

Steps

  1. Add the mount path to the "/etc/fstab"
UNRAID_MOUNT_TAG_NAME	/PATH/TO/MOUNT/FOLDER	9p	trans=virtio,_netdev,rw 0	0
@piraveen
piraveen / German-Zip-Codes.csv
Created January 23, 2019 14:04 — forked from jbspeakr/German-Zip-Codes.csv
list of German zip codes (Postleitzahl), including dialing code, name of the city and federal state.
We can't make this file beautiful and searchable because it's too large.
Ort;Zusatz;Plz;Vorwahl;Bundesland
Aach;b Trier;54298;0651;Rheinland-Pfalz
Aach;, Hegau;78267;07774;Baden-Württemberg
Aachen;;52062;0241;Nordrhein-Westfalen
Aachen;;52064;0241;Nordrhein-Westfalen
Aachen;;52066;0241;Nordrhein-Westfalen
Aachen;;52068;0241;Nordrhein-Westfalen
Aachen;;52070;0241;Nordrhein-Westfalen
Aachen;;52072;0241;Nordrhein-Westfalen
Aachen;;52074;0241;Nordrhein-Westfalen
@piraveen
piraveen / elb-nodejs-ws.md
Created June 23, 2017 15:41 — forked from obolton/elb-nodejs-ws.md
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
@piraveen
piraveen / countries.json
Last active April 15, 2020 10:03 — forked from keeguon/countries.json
A list of countries in JSON
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@piraveen
piraveen / config.js
Last active May 27, 2016 20:22 — forked from vespertilian/config.js
Sample gulp config task for typescript using gulp ng-constant, creates a Angular constant typescript file
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
gulp.task('config', function () {
var config = require('../config.json'),
envConfig = config.development;
[process.env.NODE_ENV === 'production' ? 'production' : 'development']
if(process.env.NODE_ENV === 'production'){
@piraveen
piraveen / ROBOMONGO-MONGDB-REMOTE-CONNECTION.MD
Last active September 4, 2020 12:55
Setting up RoboMongo to connect with remote MongoDB server (VM, External Server)
@piraveen
piraveen / 00-header
Last active March 29, 2016 15:36
Custom Dynamic Motd
#!/bin/sh
#
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
#
# Authors: Nick Charlton <hello@nickcharlton.net>
# Dustin Kirkland <kirkland@canonical.com>
#
# This program is free software; you can redistribute it and/or modify
#!/bin/bash
# APP Install script
sudo apt-get install -y vim
## Apache2
sudo apt-get install -y apache2
sudo apt-get install -y libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-intl php-apc php5-sqlite ruby-compass openjdk-7-jdk php5-mcrypt imagemagick build-essential
sudo apt-get install -y mysql-client mysql-server mysql-common
sudo apt-get install -y phpmyadmin