Skip to content

Instantly share code, notes, and snippets.

@strayge
strayge / python_email_parse.py
Last active April 7, 2023 15:54
email parse pop3 python
import poplib
import email
from base64 import b64decode
pop3_server = 'pop.gmail.com'
pop3_port = '995'
username = '[email protected]'
password = 'XXXXXXXXXXXXXX'
M = poplib.POP3_SSL(pop3_server, pop3_port)
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@soderlind
soderlind / Install.txt
Last active September 7, 2024 05:45
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
@mrtns
mrtns / README.md
Last active July 11, 2024 11:13
Docker Host and Container User Mapping
import QtQuick 2.9
import QtQuick.Controls 2.2
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
ListView {
@nghiaht
nghiaht / generate_rsa_keypair.sh
Created September 13, 2018 03:30
Generate RSA keypair (public, private + pkcs8) using openssl command
# Private key
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
# Public key
openssl rsa -pubout -in private.pem -out public_key.pem
# Private key in pkcs8 format (for Java maybe :D)
openssl pkcs8 -topk8 -in private.pem -out private_key.pem
## nocrypt (Private key does have no password)
@sau-lanvy
sau-lanvy / kubernetes-cluster-using-kubespray.md
Last active March 21, 2025 14:12
Deploy a Production Ready Kubernetes Cluster using Kubespray with Ansible

Deployment Architecture

deployment architecture

System Configuration

  1. All kubernetes nodes: set SELINUX to permissive mode
$ vi /etc/selinux/config
SELINUX=permissive

$ setenforce 0
@bmaupin
bmaupin / extract-java-exceptions-in-graylog.md
Created November 2, 2018 15:38
Extract Java exceptions in Graylog

Get exceptions in search results

Regular expressions used in searches seem to search the extracted search "terms," which you can see by clicking on any particular message, then click the down arrow > Show terms of .... For this reason, "exception" needs to be lower-case:

message:/([a-z0-9\.]+exception)/

Extract exceptions as a field

  1. Create a new rule
@superbrothers
superbrothers / kubectl-delete_all
Last active October 1, 2024 05:27
Kubernetes: Delete all objects in the namespace
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
@holgi
holgi / asyncio-mock-example.py
Created January 30, 2019 13:31
Example for mocking async context managers
import pytest
import aiohttp
import asyncio
from asynctest import CoroutineMock, MagicMock, patch
# Example Code
async def fetch(session, url):