Skip to content

Instantly share code, notes, and snippets.

View mjarkk's full-sized avatar
🗿

Mark Kopenga mjarkk

🗿
View GitHub Profile

NOT UP TO DATE!

Things in this document might not work or be broken nowadays

my laptop:

I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen

Some notes:

Most things after setup are not specific for this laptop
# = run as root

@mjarkk
mjarkk / A chrome maifest.md
Last active May 1, 2019 06:38
Full Chrome maifest with the most json items i could find and a stuct for GOlang

A full chrome json maifest with a golang stuct that matches everyting

I copied most of my installed chrome extensions and put them toghether intro one big manifest.json and stuct.go
Though there might be more fields

@mjarkk
mjarkk / tor-google-chrome-beta
Created October 27, 2018 20:57
Run google chrome with tor inside a incognito window
#!/bin/bash
# NOTE: You need to install tor and enable it to run this script
# NOTE: If you have google chrome replace google-chrome with google-chrome-beta
google-chrome --proxy-server="socks5://localhost:9050" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" --incognito
#include <SPI.h>
#include <Ethernet.h>
#define REDPIN 5
#define GREENPIN 3
#define BLUEPIN 6
#define WHITEPIN 10
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
@mjarkk
mjarkk / chrome-headless-with-gui.sh
Last active October 22, 2023 12:06
lauch chrome headless with gui
#!/bin/bash
# Make sure to change the /tmp/chrome-data to a emptry direcotry
# Make sure to change google-chrome-unstable to youre chrome launch command
# This command is mostly coppied from: https://github.com/GoogleChrome/puppeteer/blob/eb7bd9d7d3a7800e9ed3d77a19aaf4336587026c/lib/Launcher.js
google-chrome-unstable \
--user-data-dir=/tmp/chrome-data \
--disable-background-networking \
--disable-background-timer-throttling \
--disable-backgrounding-occluded-windows \
@mjarkk
mjarkk / docker.sh
Created January 22, 2019 15:33
A quick and dirty way to run a Laravel app in a container
#!/bin/bash
# After running this:
# cd /app
# composer install
# php artisan serve
docker run \
-it \
--net=host \
--mount type=bind,source=/home/mark/Documents/bla/bla/bla/laravelApp,target=/app \
@mjarkk
mjarkk / encrpytAndDecrpyt.go
Created January 28, 2019 09:32
Encrpyt and decrpyt with a public and private key using RSA
func main() {
key, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
log.Fatal(err)
}
// Generate keyFile to memory
keyFile := pem.EncodeToMemory(&pem.Block{Type: "RSA PUBLIC KEY", Bytes: x509.MarshalPKCS1PublicKey(&key.PublicKey)})
// Create a public key from the public keyFile
@mjarkk
mjarkk / decode.go
Created February 22, 2019 12:40
Encode and compress a string to base64 and Decode it back to a string
func main() {
input := "KkktLgEEAAD//w=="
out, err := base64.StdEncoding.DecodeString(input)
if err != nil {
log.Panicln(err)
}
enflated, err := ioutil.ReadAll(flate.NewReader(bytes.NewReader(out)))
if err != nil {
@mjarkk
mjarkk / decode.go
Created February 22, 2019 12:40
Encode and compress a string to base64 and Decode it back to a string
func main() {
input := "KkktLgEEAAD//w=="
out, err := base64.StdEncoding.DecodeString(input)
if err != nil {
log.Panicln(err)
}
enflated, err := ioutil.ReadAll(flate.NewReader(bytes.NewReader(out)))
if err != nil {
@mjarkk
mjarkk / Dockerfile
Created May 1, 2019 12:42
A minimal example of a container with only the docker binary, handy for communicating with docker sock from the host
# Make sure to bind the docker sock as volume when running this in a container
FROM alpine
WORKDIR /usr/bin
RUN apk add docker && \
rm docker-init docker-proxy dockerd containerd containerd-shim containerd-shim-runc-v1 containerd-stress runc ctr
CMD ["docker", "ps"]