Skip to content

Instantly share code, notes, and snippets.

View dom111's full-sized avatar
⌨️

Dom Hastings dom111

⌨️
View GitHub Profile
@dom111
dom111 / globalprotect-tay-icon.py
Last active January 26, 2022 16:17
A way to have a GlobalProtect icon in your system tray if it doesn't show up on Ubuntu
#!/usr/bin/python
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk as gtk, AppIndicator3 as appindicator
import subprocess
1 DIM C 20
5 O%=C
10 [OPT 7
15 .SAY
20 LDA #80
30 JSR &FFE3
40 LDA #86
50 JSR &FFE3
60 RTS
70 ]
printf '\e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e[48;5;254m \e
@dom111
dom111 / polyquine.pl.rb.php.js.sh.py
Last active June 9, 2020 08:21
Perl/Ruby/PHP/JavaScript/Bash/Python 2 polyquine
s=1//2;_=r'''<?#/.__id__;s=+0;#';read -d '' q<<'';s=\';Q='echo s=1//2\;_=r$s$s$s\<\?\#/.__id__\;s=+0\;#$s\;read -d $s$s q\<\<$s$s\;s=\\$s\;Q=$s$Q$s\;eval\ \$Q;echo $q';eval $Q
$_='eval("0"?0?"def strtr(s,f,t);s.tr(f,t) end;class String;def chr(n);self+n.chr end;end":"$u=strtr=(s,f,t)=>[...f].reduce((s,a,i)=>s.replace(RegExp(a,`g`),t[i]),s);printf=console.log;(S=String).prototype.chr=function(n){return this+S.fromCharCode(n)}":[]&&"sub strtr{eval q(q(X)=~y/X/X/r)=~s/X/shift/ger}");printf(strtr("%s<?#/.__id__;s=+0;#j;read -d jj q<<jj;s=zj;Q=jecho s=1//2z;_=rksksksz<z?z#/.__id__z;s=+0z;#ksz;read -d ksks qz<z<ksksz;s=zzksz;Q=kskQksz;evalz zkQ;echo kqj;eval kQwk_=j%sj;eval(k_);//;#jjj;f=jjjs=1//2;_=r%%s%%s%%s;f=%%s%%s%%s;q=_[18]*3;print f%%%%(q,_,q,q,f,q)jjj;q=_[18]*3;print f%%(q,_,q,q,f,q)%s","jkwz","".chr(39).chr(36).chr(10).chr(92).chr(92)),[]&&"s=1//2;_=r".chr(39).chr(39).chr(39),$_,$u?"":"".chr(10));';eval($_);//;#''';f='''s=1//2;_=r%s%s%s;f=%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)''';q=_[18]*3;print f%(q,_,q,
echo -n 'for(;$a=$argv[1][$i];$i++){foreach([A=>UHULUNUO,E=>LSUJUP,I=>~';
php -r 'print(~"=IG<");';
echo -n ',O=>~';
php -r 'print(~"===CUG");';
echo -n ',e=>~';
php -r 'print(~"1822313:3K4Z7B8?8V99:::H:I:Q;1;2;E;J=P=S?:?>?Z@4AAC@D9DHF1FQG8G:GEGMH1I?IRIYJ>K;MEN4NCOEOHP=QTRDRGRHRLS7S9S=S>SDSET7TNTVTXUBUDV<VDWHWNX<XO");';
echo -n ',a=>~';
php -r 'print(~"2:2D4R7>7A8G:L;F;H<L=2=L=R>C?A?K?U@6@8@K@WALB;BOBSD@DGE>E@EZFOG>HYJ1KEL=O7NOOCPBQ3Q:QMSJSMTGU6UAV7W6WWWXXS");';
echo -n ',i=>~';
php -r 'print(~"191H1N1Z2Z3<3I4T6J7X9H:9:E;V?EE5E6J<LSQSR;RJV6VNWAX8");';
# a version of __git_ps1 that should show the current branch quickly without many git commands
function __git_ps1() {
local path="$(git rev-parse --show-toplevel)/.git";
local branch="$(cat ${P}HEAD | sed -re 's/.+\///g')";
if [[ -d "$path/rebase-merge/" ]]; then
if [[ -f "$path/rebase-merge/interactive" ]]; then
B="$branch|MERGING-i";
else
@dom111
dom111 / install_tmux_osx_no_brew
Last active October 9, 2018 13:04 — forked from shrayasr/OLD_OLD_OLD_install_tmux_osx_no_brew.html
Install tmux on OSX WITHOUT brew - updated to use github urls
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
curl -OL https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
# Extract them
tar xzf tmux-2.7.tar.gz
@dom111
dom111 / install_tmux_osx_no_brew
Last active October 9, 2018 13:03 — forked from Fi5t/install_tmux_osx_no_brew
Install tmux on OSX WITHOUT brew
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
curl -OL https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
# Extract them
tar xzf tmux-2.7.tar.gz
@dom111
dom111 / polyquine2.pl.rb.php.js.sh.py
Created April 27, 2018 16:17
Alternative Perl/Ruby/PHP/JavaScript/Bash/Python 2 polyquine
s=1//2;_=r'''<?#/.__id__;s=+0;#';read -d '' q<<'';s=\';Q='echo s=1//2\;_=r$s$s$s\<\?\#/.__id__\;s=+0\;#$s\;read -d $s$s q\<\<$s$s\;s=\\$s\;Q=$s$Q$s\;eval\ \$Q;echo $q';eval $Q
$_='$z=0?"$&".next+92 .chr+10 .chr: 0..a||eval("printf=console.log;unescape`$%27%5C%0Ak`");$q=$z[1]?$z[1]:h^O;printf("%s%s%s%s<?#/.__id__;s=+0;#%s;read -d %s%s q<<%s%s;s=%s%s;Q=%secho s=1//2%s;_=r%ss%ss%ss%s<%s?%s#/.__id__%s;s=+0%s;#%ss%s;read -d %ss%ss q%s<%s<%ss%ss%s;s=%s%s%ss%s;Q=%ss%sQ%ss%s;eval%s %s%sQ;echo %sq%s;eval %sQ%s%s_=%s%s%s;eval(%s_);//;#%s%s%s;f=%s%s%ss=1//2;_=r%%s%%s%%s;f=%%s%%s%%s;q=_[18]*3;print f%%%%(q,_,q,q,f,q)%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)%s",[]&&"s=1//2;_=r",$r=[]&&$q,$r,$r,$q,$q,$q,$q,$q,$b=$z[2]?$z[2]:chr(92),$q,$q,$b,$d=$z[0]?$z[0]:h^L,$d,$d,$b,$b,$b,$b,$b,$d,$b,$d,$d,$b,$b,$d,$d,$b,$b,$b,$d,$b,$d,$d,$d,$b,$b,$b,$d,$d,$q,$d,$n=$z[3]?$z[3]:chr(10),$d,$q,$_,$q,$d,$q,$q,$q,$q,$q,$q,$q,$q,$q,$z[4]?"":$n);';eval($_);//;#''';f='''s=1//2;_=r%s%s%s;f=%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)''';q=_[18]*3;print