Skip to content

Instantly share code, notes, and snippets.

import sys
import os
import re
data = open(sys.argv[1], "rb").read()
offset = sys.argv[2]
if len(sys.argv) > 3:
lines = int(sys.argv[3])
else:
lines = 10
const parser = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const t = require("@babel/types");
const generate = require("@babel/generator").default;
const beautify = require("js-beautify");
const { readFileSync, writeFile } = require("fs");
const vm = require("vm");
const decryptFuncCtx = vm.createContext();
@msm-code
msm-code / cli-adventures.md
Last active November 23, 2022 23:30
Cli adventures

cli adventures

My random notes about CLI tools that I use, have used, want to use, wish I have used before, or never want to use again.

tmux

Awesome terminal mutliplexer.

https://gist.github.com/mloskot/4285396

Karton benchmark notes

Predictibly, most of the time was spent in redis

90k tasks, nothing to collect

[2021-12-29 00:31:53,585][INFO] Tasks: Get all tasks: 4.495668649673462
[2021-12-29 00:31:53,586][INFO] Tasks: Tasks from queue: 0.00021696090698242188
[2021-12-29 00:31:53,675][INFO] Tasks: Big loop: 0.08784604072570801
[2021-12-29 00:31:53,675][INFO] Tasks: Smol loop: 1.0728836059570312e-05
@msm-code
msm-code / karton-bench-notes.md
Created December 28, 2021 23:26
Notes from my karton benchmarking setup

Karton benchmark setup notes

  1. Bought a digitalocean VM
  2. Setup
apt update
apt install docker-compose docker.io python3.8-venv
git clone https://github.com/CERT-Polska/karton-playground.git
sudo docker-compose up

Keybase proof

I hereby claim:

  • I am msm-code on github.
  • I am msm_ (https://keybase.io/msm_) on keybase.
  • I have a public key ASBwI37xQd1-e-7Qf1N3ecGpxbELPtYdjMi-GdsvdLSwdwo

To claim this, I am signing this object:

3 gosia>
3 magda>
3 tarlos_>
3 zu_>
4 ***>
4 janu>
7 bartoszt1>
8 tarlos>
10 przemj>
11 przemj|2>
1 AAAA>
1 adw1n>
1 Althorion>
1 BranDaire_>
1 DAnickname>
1 interpod_>
1 jfabian>
1 Kolano>
1 LuxyLuks>
1 masdir>
╰─$ git pull origin public
From vcs.cert.pl:enisa/trainings-2017
* branch public -> FETCH_HEAD
Auto-merging docker/procmail/examples/example1
CONFLICT (add/add): Merge conflict in docker/procmail/examples/example1
Auto-merging docker/procmail/README.md
CONFLICT (add/add): Merge conflict in docker/procmail/README.md
Auto-merging docker/procmail/ProcmailBuild.sh
CONFLICT (add/add): Merge conflict in docker/procmail/ProcmailBuild.sh
Auto-merging docker/procmail/Dockerfile
def xor_deencrypt(data, key_struct):
key = key_struct["7-key"]
main_key = key_struct["main_key"]
res = ""
for c in data:
it = key_struct["iter"]
key[it % 7] += main_key[it % 128]
key[it % 7] &= 0xFF
res += chr(ord(c) ^ (key[it % 7]))
key_struct["iter"] += 1