This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # encoding: utf-8 | |
| ############################################################################### | |
| # Copyright 2011 Jakub Jirutka. All rights reserved. | |
| # | |
| # "THE KOFOLA-WARE LICENSE" (Revision 1): | |
| # Jakub Jirutka originally wrote this file. As long as you retain this notice you | |
| # can do whatever you want with this stuff. If we meet some day, and you think | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net" | |
| "time" | |
| ) | |
| func main() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | add-type @" | |
| using System.Net; | |
| using System.Security.Cryptography.X509Certificates; | |
| public class TrustAllCertsPolicy : ICertificatePolicy { | |
| public bool CheckValidationResult( | |
| ServicePoint srvPoint, X509Certificate certificate, | |
| WebRequest request, int certificateProblem) { | |
| return true; | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // setup | |
| 1. if you want the worker to be in a separate project and separately deployed: heroku create <projectname> | |
| 2. if separate project created in step 1: heroku addons:attach <addonname> | |
| // subscriber | |
| var redis = require('redis'); | |
| var RedisChannels = require('./constants/redisChannels') | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # flush existing rules | |
| iptables -F | |
| ip6tables -F | |
| # ssh rule. always add this first ! | |
| # TODO: Consider rate limiting? (e.g http://www.digitalsanctuary.com/tech-blog/debian/using-iptables-to-prevent-ssh-brute-force-attacks.html) | |
| # Still need to read up on implications... | |
| iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
| iptables -A OUTPUT -p tcp --sport ssh -j ACCEPT |