Skip to content

Instantly share code, notes, and snippets.

@tsuchm
tsuchm / sshuttle.service
Last active July 8, 2022 02:08
Systemd unit file to establish VPN with sshuttle command
# (0) Replace the gateway server name and the subnet address with your own values.
# (1) Put this file into ~/.config/systemd/user/sshuttle.service
# (2) Invoke `systemctl --user daemon-reload`
# (3) Invoke `systemctl --user start sshuttle.service`
[Unit]
Description=sshuttle
Requires=gpg-agent-ssh.socket
After=gpg-agent-ssh.socket
@qguv
qguv / get_stickers.py
Last active January 6, 2024 14:01
Extract the most commonly used stickers from your Telegram chat history.
#!/usr/bin/env python3
'''
Extract the most commonly used stickers from your Telegram chat history as:
- a JSON obj mapping sticker paths to the number of times sent; or
- the above in text; or
- a simple webpage showing all the stickers.
'''
_epilog = '''\
To get your Telegram chat history:
@ARHEIO
ARHEIO / Makefile
Last active August 28, 2022 04:51
Makefile with a builtin help
# -----------------------------------
# MAKEFILE VARS
# -----------------------------------
.DEFAULT_GOAL := help
.PHONY: test
# -----------------------------------
# MAKE TARGETS
# Copyright (c) 2021, Roman Miroshnychenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@rosco-pc
rosco-pc / unifi.md
Last active April 4, 2025 17:39
Unifi commands.md

Unifi AP useful commands

using SSH:

  • log in to AP: $ ssh ubnt@<IP>
  • default username & password: ubnt & ubnt

Generic

Command Example Function
@emadpres
emadpres / TextFormatter.py
Last active June 3, 2022 02:56
Python Text Formatter for colorizing log
from enum import Enum
from typing import Final
class TextFormatter:
"""
Info Point
- How to colorize "text"? FORMATTING_SEQ+"text"+RESET_SEQ
- What's FORMATTING_SEQ? "\033[1;44m"
- "\033": The 033 (octal) or \x1b (hexadecimal) are equivalents for 27 that is the escape character code.
@ktwrd
ktwrd / quake3_cdgen.py
Created June 1, 2022 10:43
Quake 3 Arena CD Keygen
import random
global keygen, intmap
keygen = ""
intmap = [
"2",
"3",
"7",
"a",
"b",
# Copyright Andy Chu
class switch(object):
"""A ContextManager that translates to a C switch statement."""
def __init__(self, value):
# type: (int) -> None
self.value = value
def __enter__(self):
# type: () -> switch
@pr1ncess-emily
pr1ncess-emily / avkeys.js
Last active July 30, 2022 15:21
Deobfuscated exalphadev keygen
// Deobfuscated code for https://github.com/exalpha-dev/exalpha-dev.github.io
// Commit ae838c4
// useless func that does nothing
// (function (shiyu, jennielee) {
// var sherece = mohmmad, chumani = shiyu();
// while (true) {
// try {
// var lorette = parseInt('527166rkeZox') / 1 +
// parseInt(sherece(370)) / 2 * (-parseInt(sherece(371)) / 3) +
@ChatchaiJ
ChatchaiJ / build-python-deb-package.sh
Last active July 4, 2022 23:50
Create python 3.10.4 debian package from source
#!/bin/bash
# ----- work space config -----
WORKDIR="$(pwd)"
SRCDIR="${WORKDIR}/src"
BUILDDIR="${WORKDIR}/build"
LOGDIR="${WORKDIR}/log"
# ----- package config -----
NAME="python"