Skip to content

Instantly share code, notes, and snippets.

View mkg20001's full-sized avatar
🌟
rinse and repeat, rise and shine

Maciej Krüger mkg20001

🌟
rinse and repeat, rise and shine
View GitHub Profile
@mkg20001
mkg20001 / setup-ubuntu-container.sh
Created June 30, 2021 12:47
Ubuntu LXD container for local development with home folder mounted
#!/usr/bin/env/bash
# launch as "setup-ubuntu-container.sh <container-name>"
# replace "maciej" with your username and you're good to go
# NOTE: this assumes you're UID 1000 on your local system, otherwise this script needs tweaks
set -exuo pipefail
NAME="$1"
@mkg20001
mkg20001 / reticulum-dev-setup.sh
Created April 17, 2021 12:08
Setup a reticulum (hubs) development environment
curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
apt install -y nodejs
apt update
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.deb
apt update
apt install esl-erlang elixir -y
apt install postgresql -y
@mkg20001
mkg20001 / lotus.nix
Created February 14, 2021 17:30
nix derivation to build filecoin lotus
with (import ./. {});
let
lotusSrc = fetchFromGitHub {
owner = "filecoin-project";
repo = "lotus";
# master (nix-prefetch-github filecoin-project lotus --fetch-submodules --nix)
rev = "95e47cf9982c1c3538f4de8037ca5476cbaedab0";
sha256 = "lZmVYqs6wVzT0om8fvpDrP5pFDIYJZnZmQHM+RsP25I=";
fetchSubmodules = true;

A snippet that allows securly modifying the .htaccess file

Remeber to replace your-plugin with the id of your plugin

@mkg20001
mkg20001 / roxn.js
Created June 10, 2020 04:18
Base Conversion Function
// ib = input base
// ob = output base
// n = number to convert
// r = leftover from division
// o = output number
// x = exponent (base ^ position)
function roxn(ib, ob, n) {
let x = 1
let o = 0

build test

git clone https://gist.github.com/mkg20001/6d8a607a28131176fb6ed3b94c282c71 iso-build
cd iso-build
git clone https://github.com/mkg20001/nixpkgs -b rework-boot ../nixpkgs
bash iso.sh
bash boot-iso.sh
'use strict'
const query = "& (= a 'test') (= b 'test')"
const query2 = "and(equals(a, 'test'), equals(b, 'test'))"
function parseTokens1 (tokens) {
let i = 0
let block = 'exprLeft'
let stack = []
@mkg20001
mkg20001 / README.md
Last active September 26, 2019 15:52
new.css

new.css

Tiny "new" badge for your site

preview

Use with

<new/>
@mkg20001
mkg20001 / README.md
Created April 8, 2019 12:13
Tiny htop header for you terminal

htop.js

Tiny htop for your terminal

Simply drop this into your $HOME folder and add the following to your .bashrc:

node "$HOME/.htop.js"
<?php
header('HTTP/1.1 503 SaveTheInternet Blackout', true, 503);
?>
<html>
<head>
<title>#Blackout21</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">