Skip to content

Instantly share code, notes, and snippets.

View imme-emosol's full-sized avatar
😱
sto der skjælvende av angst – og følte et stort uendelig skrik gjennom naturen

immeëmosol imme-emosol

😱
sto der skjælvende av angst – og følte et stort uendelig skrik gjennom naturen
View GitHub Profile
@imme-emosol
imme-emosol / qvm-portfwd-iptables
Last active November 27, 2023 09:25 — forked from neowutran/qvm-portfwd-iptables
Qubes-os port forwarding to allow external connections
#!/usr/bin/env sh
# Adapted from previous work:
# - https://gist.github.com/neowutran/e93ce542ba1e94a5ecbf1a38eef85485
# Adapted previous work to support QubesOS v4.2
# - https://gist.github.com/fepitre/941d7161ae1150d90e15f778027e3248
# - https://gist.github.com/daktak/f887352d564b54f9e529404cc0eb60d5
# - https://gist.github.com/jpouellet/d8cd0eb8589a5b9bf0c53a28fc530369
# - https://gist.github.com/Joeviocoe/6c4dc0c283f6d6c5b1a3f5af8793292b
#!/usr/bin/env sh
(
download_git_clone_idempotent_to() {
# Download file to BIN_PATH
# default BIN_PATH to the first entry of the PATH environment variable that ends on 'local/bin'.
BIN_PATH="${1:-$(
BIN_PATH="${PATH%${PATH#*local/bin}}"
printf "${BIN_PATH##*:}/git-clone-idempotent"
)}"
<html><head><title>Colors</title>
<style type="text/css"><!--
html{border:0;}
body{padding:0px;margin:0px;color:#110011;font-weight:900;font-family:comic-sans,arial,sans-serif;font-stretch:ultra-expanded;}
#clr216 td{color:#DDDDDD;padding:0 5 5 0;margin:40px;letter-spacing:-0.5px;text-align:right;}
#clr216 td h6{display:none/*inline-block*/;width:4px;height:4px;position:relative;top:-7px;left:-7px;color:#CCCCCC;letter-spacing:-1px;text-align:left;margin:0px;padding:0px;}
#clr4096 td{color:#DDDDDD;padding:0 0 5 0;letter-spacing:-1px;text-align:right;}
#clr4096 td h6{display:none/*inline-block*/;width:4px;height:4px;position:relative;top:-1px;left:0px;color:#CCCCCC;letter-spacing:-1px;text-align:left;margin:0px;padding:0px;}
--></style></head><body>
<script language="JavaScript" type="text/javascript"><!--
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB-oxendict" xml:lang="en-GB-oxendict">
<head>
<title> Deterministic ISO 8601 </title>
<meta charset="UTF-8" />
<style type="text/css">
/*<![CDATA[*/
body
, input
@imme-emosol
imme-emosol / path_parsing_pcre.php
Last active July 3, 2020 07:38
parsing paths with vars ~ pcre
<?php
$value = <<<'TXT'
~usrnm/$var/ha${var0}else/this_${var1:-default1}/this_${var2:-default2}_is/*/hi/
~/$this_${var0:-default0}this_${var1:-default1}_is/*/hi/
~us_rnm/$var0/${var1}else/a/this_${var2:-default2}/*/hi
~/ghehe/so/right
/root/file/fs
wrong
/.
../
@imme-emosol
imme-emosol / dump.php
Last active March 20, 2020 00:15
dump line.
<?php
###
$var = 'var' ;\var_dump(basename(__FILE__,'php').__LINE__);\var_dump(\is_string($var)?${$var}:$var);\exit();
$var = &$this ;\var_dump(basename(__FILE__,'php').__LINE__);\var_dump(\is_string($var)?${$var}:$var);\exit();
# TODO ; automatically fetch first variable occuring before $var .
@imme-emosol
imme-emosol / TrueColour.md
Created January 14, 2019 14:44 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@imme-emosol
imme-emosol / home_bin_totp
Created July 10, 2018 13:04
oathtool wrapper
#!/usr/bin/env sh
BASEDIR="${HOME}"
SECRET_FILE="${BASEDIR}/.totp_secret"
if test ! -e "${SECRET_FILE}"
then
touch -a "${SECRET_FILE}"
fi
#!/bin/sh
#!/bin/sh -e
# The -e option for /bin/sh (dash) at the she-bang,
# makes this process immediately exit
# if some condition fails, see `man sh`.
evil_eval_check=$( set | grep '^shells_.*=' | cut -f 1 -d '=' )
if test "x" != "x${evil_eval_check}"
then
echo 'Been injected with a posion.'
@imme-emosol
imme-emosol / bestellen.php
Created December 18, 2011 00:38
bestelling doen
<?php
/** Deze 3 regels in een algemeen stuk code ( bijv. index.php ) : **
session_start();
if ( !isset( $_SESSION[ 'bestellingen' ] ) )
$_SESSION[ 'bestellingen' ] = array();
/**/
/** Dit ook in een algemeen deel: **
$db = new MySQLi( 'localhost' , 'root' , '' , 'webwinkel' );
/**/