Skip to content

Instantly share code, notes, and snippets.

View gpchelkin's full-sized avatar
🐝
just a human beein'

George Pchelkin gpchelkin

🐝
just a human beein'
View GitHub Profile
@jmassardo
jmassardo / Invoke-WebRequest_Ignore_SSL.ps1
Created February 26, 2019 15:19
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;
}
}
@kmcquade
kmcquade / README.md
Created November 6, 2018 19:02 — forked from joelthompson/README.md
Vault Auth
@soloradish
soloradish / vault_logrotate
Created September 12, 2018 02:25
logrotate setting file for HashiCorp's Vault audit file
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
daily
# Do not execute rotate if the log file is empty.
notifempty
missingok
compress
# Set compress on next rotate cycl to prevent entry loss when performing compression.
delaycompress
@gpchelkin
gpchelkin / dante_setup.sh
Last active August 22, 2023 06:45
How to Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04 / 20.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build5_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@unpluggedcoder
unpluggedcoder / config.py
Last active February 11, 2024 19:01
[Python Config Parser Compatible With Environment Var] Get config from config file or environment variables. The priority order of config is: Config file > Environment > default_value. #python #configparser #env
import os
import configparser
class Config:
""" Get config from config file or environment variables.
The priority order of config is: Config file > Environment > default_value.
The env var is composed by: [SECTION]_[OPTION]
For example:
get_or_else('smtp', 'BIND_ADDRESS', '127.0.0.1')
@apolloclark
apolloclark / lock_down_public_s3_buckets.md
Last active January 27, 2023 08:10
Bash one-liner to find public facing AWS S3 buckets, and make them private

Command

aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'if [[ $(aws s3api get-bucket-acl --bucket {} --query '"'"'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` && Permission==`READ`]'"'"' --output text) ]]; then aws s3api put-bucket-acl --acl "private" --bucket {} ; fi'



1. List all of the user's buckets, and output the name, as text.

@gpchelkin
gpchelkin / bluez_lag_off.sh
Last active February 16, 2024 22:54
PulseAudio: switch Bluez card A2DP Audio Profile off and on and set it as default sink to disable lags.
#!/bin/bash
# Tested on Linux Mint 18.3 / Ubuntu 16.04 with PulseAudio 8.0.
# No need for superuser.
# You can map it to keyboard shortcut and press when bluetooth audio starts lagging.
# Reference:
# https://askubuntu.com/a/171165/373130
# https://askubuntu.com/a/72076/373130
BLUEZCARD=`pactl list cards short | grep bluez | awk '{print $1}'`
@pkern
pkern / Makefile
Last active December 4, 2023 15:58
OpenWRT package for sniproxy
include $(TOPDIR)/rules.mk
PKG_NAME:=sniproxy
PKG_VERSION:=0.6.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/dlundquist/sniproxy/archive/
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_MD5SUM:=bcfb5d1efe045b8b356a4229f2339f02
@Te-k
Te-k / sslyze_cert_info.py
Created June 26, 2017 20:11
How to use sslyze as a library to get certificate information (python 3)
from sslyze.server_connectivity import ServerConnectivityInfo, ServerConnectivityError
from sslyze.ssl_settings import HttpConnectTunnelingSettings, TlsWrappedProtocolEnum
from sslyze.plugins.certificate_info_plugin import CertificateInfoScanCommand
from sslyze.synchronous_scanner import SynchronousScanner
from cryptography.hazmat.backends.openssl import x509
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.x509 import DNSName, ExtensionNotFound, ExtensionOID, NameOID
from enum import Enum
import os
import json
@jamesmacwhite
jamesmacwhite / Netflix WPAD bypass rules.md
Last active August 9, 2023 13:24
Bypass rules for Netflix when using a WPAD based proxy deployment

Netflix and direct bypass rules using WPAD

If your like me you might already use a VPN to route your traffic through. The problem is some sites just don't like VPN services and will actively block you from using them without disabling or bypassing it.

Netflix is a prime example of a website that does not like VPN services, because they are seen as a way to circumvent the geo-restrictions imposed on the content library offered.

Below are WPAD rules I use to essentially send Netflix traffic directly and avoid any VPN errors/dreaded unknown error network messages. Error messages that Netflix throws back at you related to VPN usage when streaming might include:

  • "You seem to be using an unblocker or proxy"
  • VPN/proxy error M7111-1331-5059