And Stuff ... mostly for Ubuntu/Debian
N. P. O'Donnell, 2021
synclient MaxTapTime=0
sudo sed -i "s/#\?HandleLidSwitch=.*/HandleLidSwitch=ignore/" /etc/systemd/logind.conf
sudo sed -i "s/#\?LidSwitchIgnoreInhibited=.*/LidSwitchIgnoreInhibited=no/" /etc/systemd/logind.conf
while true; do echo "hello" | nc -l 5000; done
lsof -nP -iTCP -sTCP:LISTEN
find ./*.log -type f -newermt "2021-04-30 00:00:00" ! -newermt "2021-05-02 00:00:00"
sudo visudo
Perform the following change:
- %sudo ALL=(ALL:ALL) ALL
+ %sudo ALL=(ALL:ALL) NOPASSWD:ALL
For example you may want to keep the SSH_AUTH_SOCK
variable so SSH agent keeps working:
sudo visudo
# Add variables like so:
Defaults env_keep+=SSH_AUTH_SOCK
Find out the device (sdb
, sdb
,... etc):
lsblk
Inspect the output. Run the above command again. Observe which device disappeared. Plug it in again, run command again, check that it re-appeared. Ensure you choose the correct device and not your OS drive or any other drive. Let's pretend the USB drive is device /dev/sdz
.
Unmount:
sudo umount /dev/sdz
Wipe the drive and replace with random bytes:
sudo dd if=/dev/urandom of=/dev/sdz bs=1M status=progress
(Do this several times if you're paranoid)
Format with ext3:
sudo mkfs.ext3 /dev/sdz
Forward TCP traffic on port 443 to example.com:
sudo socat TCP-LISTEN:443,reuseaddr,fork TCP-CONNECT:example.com:443
List screen sessions:
screen -ls
When one screen session exists:
screen -r
When multiple sessions exist:
screen -r <session ID>
To detach from a screen session, if the session has a shell you can type into:
screen -d
If the session does not have a shell, press Ctrl-a, then press d. DO NOT press Ctrl-d. This will kill the session!
To kill a session from inside it, hit Ctrl-d.