Skip to content

Instantly share code, notes, and snippets.

View jontsai's full-sized avatar
😎
h4x0ring

Jonathan Tsai jontsai

😎
h4x0ring
View GitHub Profile
@zoliky
zoliky / installing-emacs-from-source-on-debian.txt
Last active April 29, 2024 09:42
Installing Emacs 29.1 from source on Debian 12
Installation
------------
1. Install the build dependencies for Emacs:
$ sudo apt build-dep emacs
$ sudo apt install libtree-sitter-dev
2. Download and unpack the Emacs archive:
@acip
acip / install-percona5.7.sh
Last active August 13, 2022 21:17
Install Percona 5.7 (drop in MysqSql 5.7 replacement) on Ubuntu 22.04 Jammy
wget https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.38-41/binary/debian/focal/x86_64/libperconaserverclient20_5.7.38-41-1.focal_amd64.deb
wget https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.38-41/binary/debian/focal/x86_64/percona-server-client-5.7_5.7.38-41-1.focal_amd64.deb
wget https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.38-41/binary/debian/focal/x86_64/percona-server-common-5.7_5.7.38-41-1.focal_amd64.deb
wget https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.38-41/binary/debian/focal/x86_64/percona-server-server-5.7_5.7.38-41-1.focal_amd64.deb
apt purge mysql-server* -y
apt autoremove -y
apt install mysql-common debsums libmecab2
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
dpkg -i libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
@darconeous
darconeous / rect-starlink-cable-hack.md
Last active March 22, 2024 14:45
Hacking the Rectangular Starlink Dishy Cable
@jontsai
jontsai / tmux-protocol-fix.txt
Last active May 5, 2020 23:07 — forked from eculver/protocol-fix.txt
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@camh-
camh- / eol-at-eof.md
Created March 7, 2020 04:41
Please add newlines at end of files

See https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

A newline in a text file is a terminator, not a separator. This means each line should have a newline at the end of it, including the last line of the file.

Many editors automatically add the newline at the end of the file. Some do not. If you can configure your editor to ensure there is always a newline at the end of every line, please do so.

Because many editors do add this newline, if you commit a text file without it, when someone else edits the file, their editor will (correctly) add the newline. This causes a spurious diff in the file. Spurious

@jontsai
jontsai / django_wsgi_utf8_handler.py
Created February 18, 2020 04:51
Subclasses and extends WSGIRequest and WSGIHandler from django.core.handlers.wsgi
# Python Standard Library Imports
import re
# Django Imports
from django.core.handlers import base
from django.core.handlers.wsgi import LimitedStream
from django.core.handlers.wsgi import WSGIHandler
from django.core.handlers.wsgi import WSGIRequest
from django.core.handlers.wsgi import get_script_name
from django.utils.encoding import repercent_broken_unicode
import random
class TemperamentalClass(type):
@classmethod
def __instancecheck__(cls, other):
return random.choice([True, False])
class MyClass(metaclass=TemperamentalClass):
pass
#!/bin/sh
# Source: https://help.github.com/en/articles/changing-author-info
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"

Keybase proof

I hereby claim:

  • I am jontsai on github.
  • I am jontsai (https://keybase.io/jontsai) on keybase.
  • I have a public key ASDmxSpRRSFT5vSN-pL7vjineIuQHhDQZKkXDBIwj_v-_Ao

To claim this, I am signing this object:

@GAS85
GAS85 / apache_ssl.md
Last active March 14, 2024 16:40
Apache 2.4.18+ with Letsencrypt on Ubuntu 20.04 - SSL config for A+ on SSLLabs.com

Prerequisites

  • Ubuntu 20.04 (18.04, 16.04 works the same)
  • Apache 2.4.18 or higher
  • OpenSSL 1.0.2g-1ubuntu4.10 or higher
  • e.g. LetsEncrypt certificate
OS: Ubuntu 20.04 Apache/2.4.18 1.0.2g-1ubuntu4.10 +