Skip to content

Instantly share code, notes, and snippets.

View mjarkk's full-sized avatar
🗿

Mark Kopenga mjarkk

🗿
View GitHub Profile
@mjarkk
mjarkk / My void linux install - Dell XPS 15 9560 (4k).md
Last active April 1, 2023 00:22
How i've installed voidl inux on my laptop

void linux - dell xps 15 9560 (4k)

How i've installed void inux (xfce) on my laptop

Image and flash

The install iso i've used: void-live-x86_64-{version_here}-xfce.iso from: https://a-hel-fi.m.voidlinux.org/live/current/
To flash the iso i've used rufus with it's default settings.

before installing

I like to start with a clean disk so i'll start

@mjarkk
mjarkk / a_struct_to_json.go
Created May 17, 2019 05:45
Confert a golang struct into usable type data
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Test2 struct {
B string
@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"]
@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 / 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 / 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 / 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 \
#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 / 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