Skip to content

Instantly share code, notes, and snippets.

View Apocryphon-X's full-sized avatar
🌙
I'm pursuing something unattainable

Dante Mendoza Apocryphon-X

🌙
I'm pursuing something unattainable
  • National Polytechnic Institute
  • Redmond, WA (Originally from 🇲🇽)
  • 12:45 (UTC -07:00)
View GitHub Profile
@niccokunzmann
niccokunzmann / hanging_threads.py
Last active May 27, 2024 04:49
This module prints all hanging threads that are dead locked. It is for Python 2 and 3. Installable: https://pypi.python.org/pypi/hanging_threads
## The MIT License (MIT)
## ---------------------
##
## Copyright (C) 2014 Nicco Kunzmann
##
## https://gist.github.com/niccokunzmann/6038331
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the "Software"),
@EdwardBetts
EdwardBetts / pprint_color.py
Last active June 13, 2024 05:36
Python pprint with color syntax highlighting for the console
from pprint import pformat
from typing import Any
from pygments import highlight
from pygments.formatters import Terminal256Formatter
from pygments.lexers import PythonLexer
def pprint_color(obj: Any) -> None:
"""Pretty-print in color."""
@joepie91
joepie91 / vpn.md
Last active July 17, 2024 14:15
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@cschwede
cschwede / sample_ssh_server.py
Last active March 27, 2024 02:18
Sample paramiko SSH server to receive commands
#!/usr/bin/env python
import logging
import socket
import sys
import threading
import paramiko
logging.basicConfig()
logger = logging.getLogger()
@lifepillar
lifepillar / 24-bit-color.sh
Created November 20, 2017 11:48
Test 24 bit colors in terminals
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
@fnky
fnky / ANSI.md
Last active July 17, 2024 18:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active July 12, 2024 19:54
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@RitamDey
RitamDey / ssltest3.py
Created May 23, 2020 12:50
Python Heartbleed (CVE-2014-0160) Proof of Concept by Jared Stafford, working on Python 3. OG: https://gist.github.com/sh1n0b1/10100394
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Updated to be used with Python 3 by Ritam Dey (deyritam27031999@gmail.com)
import sys
import struct
import socket
import time
@Apocryphon-X
Apocryphon-X / selenium_disguise.py
Last active January 1, 2024 15:52
Create an instance of Google Chrome (using a Chromedriver) with no infobars and no webdriver console. Works with Python 3 and Selenium == 4.0.0b3.
from subprocess import CREATE_NO_WINDOW
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
service = Service("chromedriver.exe")
service.creationflags = CREATE_NO_WINDOW
chrome_options = webdriver.ChromeOptions()
@Apocryphon-X
Apocryphon-X / chromedriver_without_images.py
Last active January 1, 2024 15:52
Disable image loading for Chromedriver using Python Selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = webdriver.ChromeOptions()
prefs = {"profile.managed_default_content_settings.images": 2}
chrome_options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://google.com/")