Skip to content

Instantly share code, notes, and snippets.

@s1037989
s1037989 / dropbox.conf
Created June 20, 2022 01:43
organize files dropped into a single dropbox folder based on their validated tags
{
dropbox => {
'cpa file' => '^sdk/SDKv\d+\.\d+\+\d{8}\.\d+\.tar(\.gz)?$',
'cpa file' => '^tk/TK-\d+\.\d+\+\d{8}\.\d+\.tar(\.gz)?$',
'cpa release file' => '^rc_bundles/XX\d_\d{4}\.\d{2}(\.\d+)?_rc\d+/.*?\.tar(\.gz)?$',
}
}
carmel carton Module::Build ExtUtis::MakeMaker
$ sudo apt install libpq-dev libssl-dev
$ \curl -L https://install.perlbrew.pl | bash
$ perlbrew use perl-5.36.0
$ perlbrew install-cpanm
# mojo.js vscode-mojo vscode-mojo.js nodejs16
$ cpanm Mojolicious Mojo::Pg Minion Mojo::SQLite Minion::Backend::SQLite Future::AsyncAwait Role::Tiny Cpanel::JSON::XS EV IO::Socket::SSL IO::Socket::Socks Net::DNS::Native Mojolicious::Plugin::Status JSON::Validator | grep ^Fetching | sed 's/Fetching \(.*\) ... OK/\1/'
http://www.cpan.org/authors/id/S/SR/SRI/Mojolicious-9.27.tar.gz
http://www.cpan.org/authors/id/S/SR/SRI/Mojo-Pg-4.27.tar.gz
$ function sloc { local author="$1" from="$2" to="$3" path="$4"; while read hash; do git diff-tree --numstat --no-commit-id $hash | grep -P '^\d+\s+\d+\s+'$path; done < <(git log --author='^('$author').*$' --perl-regexp --format='%H' $from..$to) | perl -pE 'END { say "$a\t$b" } @_=split/\s+/;$a+=$_[0]; $b+=$_[1]'; }
$ sloc Sebastian 18f95d36c c87e5244d4 lib
1 1 lib/Mojolicious.pm
1 1 lib/Mojo/Headers.pm
8 4 lib/Mojo/Asset/Memory.pm
1 1 lib/Mojolicious.pm
2 2 lib/Mojolicious.pm
1 1 lib/Mojolicious/resources/templates/mojo/debug.html.ep
1 1 lib/Mojolicious/Guides/Rendering.pod
https://duckduckgo.com/?q=error+response+from+daemon+createcomputesystem+is+not+supported&ia=web
https://download.docker.com/win/static/stable/x86_64/
https://blog.carlesmateo.com/2022/02/14/using-docker-in-windows-10-without-windows-desktop-with-docker-engine-and-without-wsl/
https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
https://dev.to/_nicolas_louis_/how-to-run-docker-on-windows-without-docker-desktop-hik
https://github.com/microsoft/dotnet-framework-docker/issues/660
https://duckduckgo.com/?q=firewalld+is+not+running&ia=web
https://duckduckgo.com/?q=firewall-cmd+failed+to+connect+to+socket&ia=web
https://github.com/docker/for-linux/issues/1105
https://simplernerd.com/wsl2-uncompressed/
@s1037989
s1037989 / gist:83006e40f0cdf482c06bf850f0ba8c7a
Last active March 25, 2022 09:30
security log for sudo use
function sudo { local sudo=$(which sudo) what; sudo -v || return; whatis $1 &>/dev/null && what=$(whatis $1 | perl -pE 's/^.*?- //') || while :; do what=$(zenity --entry --title "Sudo Log" --text "What are you doing with \$($*)") && [ ${#what} -ge 5 ] && break; done; echo "Security Log: $what | sudo $*" | logger; $sudo -E $*; }
@s1037989
s1037989 / jp
Last active July 10, 2022 04:39
#!/usr/bin/env perl
use Mojo::Base -strict, -signatures;
use Mojo::JSON::Pointer;
use ojo;
use Scalar::Util qw(blessed);
use constant DEBUG => $ENV{JP_DEBUG} // 0;
use constant TRAVERSE => !!(eval { require Data::Traverse; Data::Traverse::ignore_unsupported_refs(1); 1 });
Data::Traverse->import('traverse') if TRAVERSE;
Did It Execute? | Mandiant https://www.mandiant.com/resources/execute
How to list all installed Perl modules https://www.linuxquestions.org/questions/linux-general-1/how-to-list-all-installed-perl-modules-216603/
How to check DLL version in PowerShell – Technical Notes https://technotes.khitrenovich.com/check-dll-version-powershell/
https://lucasg.github.io/2018/04/29/Dependencies-command-line/?s=09
.NET Decompiler: Decompile Any .NET Code | .NET Reflector https://www.red-gate.com/products/dotnet-development/reflector/
GitHub - icsharpcode/ILSpy: .NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! https://github.com/icsharpcode/ILSpy#ilspy-------
Assembly Binding Log Viewer (Fuslogvw.exe) | Microsoft Docs https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-1.1/e74a18c4(v=vs.71)
$ find . -type f | sort
./Dockerfile
./bin/[
./bin/[[
:snip:
./lib/libpthread.so.0
./lib/libresolv.so.2
$ mkdir /tmp/busybox
$ find . -type f | xargs ldd 2>/dev/null | grep -v :$ | perl -pE 's/^\s+//;s/ \(\w+\)$//;s/^.*? => //' | grep ^/ | sort -u | xargs cp -v --parents -t /tmp/busybox
use Mojolicious::Lite -signatures;
# for i in $(carton exec -- perl jenkins.pl jenkins http://localhost:3000/); do k=$(mojo get $i); for j in $(mojo get $i/ws); do echo -e "$j\t$k"; done; done
use Mojo::Util qw(md5_sum);
get '/' => sub ($c) {
$c->render(json => {
number => 1,
url => $c->url_for('job1', name1 => 'a')->to_abs,
CENTRAL="http://localhost:3000"
PushCentral $MYNAME
Summary () {
for U in $WWWDIR/snippet.*.html; do
cat $U >> $WWWDIR/summary.html
RESLT=$?
if [ $RESLT -gt 0 ]; then
echo "$U is unreachable" >> /tmp/tmp.$$.moshel_alert.tmp
fi