Skip to content

Instantly share code, notes, and snippets.

View Apocryphon-X's full-sized avatar
🎉
This time, let's do things the right way.

Dante Mendoza Apocryphon-X

🎉
This time, let's do things the right way.
  • National Polytechnic Institute
  • México
  • 06:20 (UTC -06:00)
View GitHub Profile
@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 ([email protected])
# The author disclaims copyright to this source code.
# Updated to be used with Python 3 by Ritam Dey ([email protected])
import sys
import struct
import socket
import time
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 10, 2025 22:15
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
@fnky
fnky / ANSI.md
Last active May 17, 2025 10:14
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@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()
@cschwede
cschwede / sample_ssh_server.py
Last active October 21, 2024 12:35
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()
@joepie91
joepie91 / vpn.md
Last active May 17, 2025 02:36
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.
@EdwardBetts
EdwardBetts / pprint_color.py
Last active March 28, 2025 10:12
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."""
@niccokunzmann
niccokunzmann / hanging_threads.py
Last active November 4, 2024 14:48
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"),