Skip to content

Instantly share code, notes, and snippets.

View seisvelas's full-sized avatar
🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');

Xandre V seisvelas

🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');
View GitHub Profile
@seisvelas
seisvelas / reverse_walrus_shell.py
Created September 30, 2020 03:16
gain shell with walrus operator!
import requests
cant_put_in_public_gist = "URL"
while (command := input("$ ")) != 'exit':
x = requests.post(cant_put_in_public_gist, json={ "command" : command })
json = x.json()
try:
print(json['result'])
except KeyError:
@seisvelas
seisvelas / chrome_command.sh
Last active October 3, 2020 07:46
How to view my epiphany.pub post
chromium --ignore-certificate-errors "https://epiphany.pub/@seisvelas/Github-Gists-as-a-(free)-Headless-CMS"
@seisvelas
seisvelas / fake_email_cvs.sh
Created September 14, 2020 16:39
The spirit of Perl one-liners lives!
python -c 'print("\n".join(["fakeuser" + str(i) + "@fake.test," + "Mister " + str(i) for i in range(1000)]))' > fakeusers.csv
@seisvelas
seisvelas / sleeping_beauty_halfer_proof.py
Last active October 26, 2020 05:47
Proof of the halfer interpretation of the sleeping beauty problem
import random
from collections import OrderedDict
def experiment_result(coin, day):
return OrderedDict({
'coin': coin,
'day': day
})
@seisvelas
seisvelas / evil_prob.py
Created May 19, 2020 02:31
Hackerrank problem Fati got stuck on
def generate_pairs(until):
pairs = []
for i in range(1, int(until / 2)+1):
pairs.append([i, until - i])
return pairs
def nonDivisibleSubset(k, s):
@seisvelas
seisvelas / golden.py
Created May 12, 2020 16:48
Solution to rend. with cassid. newsletter
from math import sqrt
def golden(a, b):
a, b = max(a, b), min(a, b)
return a / b == (a + b) / a
print(
golden(1 + sqrt(5), 2)
)
@seisvelas
seisvelas / twoSums.js
Created April 20, 2020 05:38
TPP code challenge solution
const twoSums = (list, sum) => list.some(
(e, i) => list.slice(i+1).some(
n => sum === e + n
)
)
console.log(
twoSums([10, 15, 3, 7], 10), // true because 3 + 7 = 10
twoSums([10, 15, 3, 7], 8), // false
)
@seisvelas
seisvelas / build_parens.py
Last active April 13, 2020 22:23
Code challenge from Rendezvouz with Cassidoo newsletter 04/13/2020
def build_parens(depth, current='('):
if len(current) == depth * 2:
yield current
else:
opening = current.count('(')
closing = current.count(')')
if opening < depth:
yield from build_parens(depth, current + '(')
if closing < opening:
yield from build_parens(depth, current + ')')
@seisvelas
seisvelas / tbb_build.txt
Created April 8, 2020 13:17
GeKo's technique for Tor Browser Bundle dev builds, from irc.oftc.net #tor-dev
[07:40] <+GeKo> so what i do when doing dev work is the following:
[07:41] <+GeKo> i take the latest tor browser, say, an alpha version (or have it already on my computer)
[07:41] <+GeKo> and extract it
[07:42] <+GeKo> then i copy over the things from obj-x86_64-pc-linux-gnu/dist/firefox/*
[07:42] <+GeKo> to your extracted tor-browser_en-US/Browser/ dir
[07:43] <+GeKo> (assuming you use the en-US version)
[07:43] <+GeKo> that gives you the changes you made in the tor-browser repository and compiled for testing
[07:44] <+GeKo> then you can see whether they work
@seisvelas
seisvelas / scary-warning.err
Created April 8, 2020 12:40
Warning from mach stage-build
alex@alex-ksquare:~/tor-browser$ ./mach build stage-package
/home/alex/tor-browser/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py:266: UserWarning: psutil failed to run: not sure how to interpret line ' 8 0 sda 381637 231217 14029637 296876 660191 2383224 84937712 1010416 0 456088 906520 35705 0 73009000 42258\n'
warnings.warn('psutil failed to run: %s' % e)
0:00.25 /usr/bin/make -j8 -s stage-package
0:02.37 ../../dist/firefox/libplc4.so: No gain. Skipping
0:02.37 ../../dist/firefox/libplds4.so: Couldn't find .bss. Skipping
0:02.37 ../../dist/firefox/libmozgtk.so: Couldn't find .bss. Skipping
0:02.38 ../../dist/firefox/gtk2/libmozgtk.so: Couldn't find .bss. Skipping
0:02.38 ../../dist/firefox/libmozwayland.so: No gain. Skipping
0:02.39 ../../dist/firefox/liblgpllibs.so: Couldn't find .bss. Skipping