https://www.owasp.org/index.php/Session_Management_Cheat_Sheet
Auto-insert snippet for python emacs
A small skeleton you can put into your python emacs editing session:
;; insert python skeleton with auto-insert (eval-after-load 'autoinsert '(define-auto-insert '("\\.\\py\\'" . "python skeleton") '("" "#!/usr/bin/env python" \n "# " (file-name-nondirectory (buffer-file-name)) \n \n "def main():" \n "pass" \n \n "if __name__ == '__main__':" \n "main()" \n \n)))
Rooting your Gemini PDA
I recently got a Gemini PDA (WiFi). To run rooted Android and Linux (dual boot) I did the following:
- Followed the details here.
- Downloaded & unzipped Windows Flashing Tool
- Downloaded & installed Windows Drivers
- Chose my Partition setup here then downloaded
- Scatter File
- Base Firmware (ie Android)
- Linux Firmware
- Unzipped both firmwares into a dir & put scatter file in there
- Connected Gemini powered off
- Started flashing tool, selected scatter file (following this guide)
- Chose “Firmware Upgrade” & “Download”
- Powered Gemini on
- Waited. First you get a fast red progress bar (partitioning?). Then you get two slow yellow progress bars (presumably installing each OS). In total the process took 35-45 minutes.
Update: on a recent install (see step 11) this was much quicker, a couple of minutes. - Powered on Gemini into Android (my default). To get “proper” root I installed Magisk Manager from here.
WARNING: latest Magisk Manager put my Gemini into a boot loop requiring firmware reinstall – so don’t update to latest version & allow it to rebuild!
Note I skipped backing up the NVRAM. You probably shouldn’t do that.
Then post-install I installed Linux Deploy from the play store, Arch Linux under that (into an ext4 partition on my SD card) & termux as a terminal into it.
Arch Linux on aarch64 gpg keys
If you have an issue with gpg verification of packages the instructions are slightly different to recover as the signing keys are different:
pacman-key --init pacman-key --populate archlinuxarm
This is if you get errors like:
error: mutt: signature from "Arch Linux ARM Build System <builder@archlinuxarm.org>" is unknown trust :: File /var/cache/pacman/pkg/mutt-1.10.0-1-aarch64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: failed to commit transaction (invalid or corrupted package (PGP signature)) Errors occurred, no packages were upgraded.
GrafX2 – Deluxe Paint for Linux
GrafX2 is a bitmap paint program inspired by the Amiga programs Deluxe Paint and Brilliance. Specialized in 256-color drawing, it includes a very large number of tools and effects that make it particularly suitable for pixel art, game graphics, and generally any detailed graphics painted with a mouse.
Logwatch on SystemD logs in RHEL/Centos 7
Build emacs 25 rpm for redhat / centos 7
This is for the console only (no graphical xwindows) version. Installs into /opt/emacs253 so can run side-by-side with system emacs.
-
# Download emacs tarball & untar
-
./configure --prefix=/opt/emacs253 --with-gif=no --with-tiff=no --with-x-toolkit=no \ --with-xpm=no --with-jpeg=no --with-png=no
-
# install any dependencies & build make make DESTDIR=/tmp/emacs install
-
# Install fpm (gem install fpm) to build package fpm -s dir -t rpm -C /tmp/emacs --name emacs25 --version 25.3 --iteration 1 --description "emacs 25.3"
-
rm -rf /tmp/emacs
Repro-Now – Reproduce web sessions
This Chrome extension allows you to create video files of web sessions (eg to show exploits, problems with sites, etc): https://repro-now.com/
It also stores the network traffic in the mkv file.
Ascii charting
gsconnect – native kdeconnect for gnome
https://extensions.gnome.org/extension/1319/gsconnect/ is a fantastic implementation of kdeconnect which allows you interface with your android phone from your linux desktop.
I had some issues configuring it on Fedora as I was previously using kdeconnectd so gsconnect defaulted to the next available port (1717).
To resolve this I removed kdeconnectd (yum remove), uninstalled gsconnect (rm -rf ~/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io), wiped the prefs (dconf reset -f /org/gnome/shell/extensions/gsconnect/) and then reinstalled gsconnect.
Test it’s listening on 1716:
lsof -Pi | grep 171
And sync with kdeconnect android app.
(Also ensure your linux machine isn’t firewalling the ports).