Skip to content

Instantly share code, notes, and snippets.

@hitthemoney
hitthemoney / Krunker WebSockets Explained.md
Last active July 28, 2023 17:24
This markdown file explains Krunker.io's social websockets and how to connect, get data from them, captchas, and more.

Krunker WebSockets Explained

WebSocket

WebSocket is a protocol over http. You should read: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API for more info on WebSocket.

Encoding/Decoding

Krunker uses msgpack for decoding and encoding packets. Msgpack is also smaller and sometimes faster depending on the implementation you use/make.

Packets

Like I said earlier, Krunker uses msgpack for decoding and encoding packets. A ping packet would like this: ["po"] which you send when you get a ["pi"] packet, and the ping result packet you receive is ["pir", ]. For fetching a profile, you can use ["r", "profile", , null]. The result packet would be like ["0", "profile", , , , , ...etc]. For finding packets, you can download https://krunker.io/social.html using a command like cURL, formatting the file and lo

@g-a-d
g-a-d / get_api_token.py
Created April 22, 2022 16:02
Get Github API token for a Github app (python)
def get_github_token(app_id, pem_file, organization_slug, repository, private_key_file):
jwt = get_jwt_token(app_id, private_key_file)
installation = requests.get(f'https://api.github.com/orgs/{organization_slug}/installation', headers={'Authorization': f'Bearer {jwt}'})
access_tokens_url = installation.json()['access_tokens_url']
# values for the permissions are documented here: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
data = {'repository': repository, 'permission': {'contents': 'write'}}
token_request = requests.post(access_tokens_url, headers={'Authorization': f'Bearer {jwt}'}, json=data)
token = token_request.json()['token']
return token
@gabe565
gabe565 / change-arc-icon.md
Last active May 1, 2024 07:56
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@orimanabu
orimanabu / install_podman_on_amazon_linux_2023.sh
Last active May 1, 2024 07:54
Install Podman on Amazon Linux 2023
#!/bin/bash
# To build podman, you have enough resource on the instance.
# I tested this script on t2.xlarge.
topdir=${HOME}/work
mkdir -p ${topdir}
# Install prereq rpms
sudo dnf install -y git golang libseccomp-devel gpgme-devel autoconf automake libtool yajl yajl-devel libcap-devel systemd-devel cni-plugins iptables-nft rpm-build meson golang-github-cpuguy83-md2man.x86_64
@do-nat
do-nat / install-firefox.sh
Last active May 1, 2024 07:51
Install Firefox Developer edition or Firefox Beta on Ubuntu or another Debian-based Linux
#!/usr/bin/env bash
# Create directory for keyrings if it does not exist
sudo install -d -m 0755 /etc/apt/keyrings
# Download and save keyring
wget -q "https://packages.mozilla.org/apt/repo-signing-key.gpg" -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
# The fingerprint should be 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3
gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); print "\n"$0"\n"}'
@engineervix
engineervix / ubuntu_desktop_setup.sh
Last active May 1, 2024 07:51
Ubuntu Desktop Setup
#!/usr/bin/env bash
# =============================================================================
# description: Ubuntu 22.04 Desktop Setup Script
# author: Victor Miti <https://github.com/engineervix>
# note: In its current state, this won't run unattended without issues.
# There are some manual interventions in between certain steps.
# The script primarily serves as documentation of the setup process
# for future reference.
# TODO: make this run unattended.
@wojteklu
wojteklu / clean_code.md
Last active May 1, 2024 07:50
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@eramdam
eramdam / .skhdrc
Created November 17, 2020 15:38
yabai/skhd config
#!/usr/bin/env sh
:: default : yabai -m config active_window_opacity 1; yabai -m config normal_window_opacity 1;
# Focus
shift + alt - home : yabai -m window --focus north
shift + alt - j : yabai -m window --focus north
shift + alt - end : yabai -m window --focus south
shift + alt - k : yabai -m window --focus south
shift + alt - delete : yabai -m window --focus west