Skip to content

Instantly share code, notes, and snippets.

@cckronos
cckronos / adduser.py
Created May 14, 2021 08:06 — forked from plugandplay/adduser.py
Script for creating user accounts (including LDAP)
#!/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
@cckronos
cckronos / client.go
Created May 5, 2021 06:41 — forked from elico/client.go
golang tcp client connection alive check
package main
import (
"fmt"
"io"
"net"
"time"
)
func main() {
@cckronos
cckronos / Invoke-WebRequest_Ignore_SSL.ps1
Created March 9, 2021 12:34 — forked from jmassardo/Invoke-WebRequest_Ignore_SSL.ps1
PowerShell hack to ignore ssl certificates when using Invoke-WebRequest
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;
}
}
// 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')
@cckronos
cckronos / createfirewallrules_restrictive.sh
Created November 24, 2020 02:28 — forked from ryanthegiantlion/createfirewallrules_restrictive.sh
Firewall rules I used on my single node elasticsearch instance
# 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