This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Quick Debian 11 Developer workstation with LAMP | |
# Run after installing Debian 11 | |
if [ $(wget -q http://deb.debian.org/debian) ]; then | |
echo "Built $(date +%Y/%m/%d)" | sudo tee -a /etc/motd | |
echo "vm.swappiness = 1" | sudo tee -a /etc/sysctl.conf | |
sudo sysctl -p | |
sudo apt update | |
sudo apt install -y curl byobu scratch python3-venv python3-pip python3-setuptools python3-wheel build-essential dkms linux-headers-$(uname -r) manpages-dev nmap ncat apache2 apache2-utils mariadb-server php-mysql php libapache2-mod-php php-cli strace ltrace xxd bzip2 shellcheck | |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo journalctl --disk-usage | |
sudo journalctl --vacuum-size=500M | |
sudo journalctl --disk-usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(declare -a A=$(grep CODENAME /etc/lsb-release);echo ${A[0]:4:1}${A[0]:11:1}${A[0]:6:1}${A[0]:9:1}${A[0]:9:1}${A[0]:3:1}|tr [:upper:] [:lower:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Windowed countdown timer | |
# USAGE: update the duration variable on line 9. | |
# Author: Raresteak | |
# https://github.com/raresteak | |
import time | |
from tkinter import * | |
# Countdown timer duration in seconds | |
duration = 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open(path/to/file) as file: | |
for line in file: print(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Getting these warnings after starting dnscat2 server: | |
/dnscat2/server/libs/dnser.rb:872: warning: Capturing the given block using Kernel#proc is deprecated; use &block instead | |
/dnscat2/server/tunnel_drivers/driver_dns.rb:316: warning: Capturing the given block using Kernel#proc is deprecated; use &block instead | |
Solution: | |
start the server and redirect std error to /dev/null, example: | |
ruby dnscat2 2>/dev/null | |
no more warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rem Windows incremental backup of source to destination | |
Rem /D Copies files changed | |
Rem /E Copies directories and subdirectories, including empty ones. | |
Rem /Y Suppresses prompting to confirm you want to overwrite | |
Rem /I If destination does not exist and copying more than one file,assumes that destination must be a directory. | |
xcopy C:\Users\%username%\Documents\* E:\Backup\%computername%\%username%\Documents /D /E /Y /I | |
xcopy C:\Users\%username%\Desktop\* E:\Backup\%computername%\%username%\Desktop /D /E /Y /I | |
xcopy C:\Users\%username%\Downloads\* E:\Backup\%computername%\%username%\Downloads /D /E /Y /I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOW=$(date -u -d "now" +%s) | |
EOW=$(date -u -d "19 January 2038 03:14:08 UTC" +%s ) | |
echo "Remaining time from Now: $(date -u) to " | |
echo " $(date -u -d "19 January 2038 03:14:18 UTC")" | |
echo "Remaining seconds: $(expr $EOW - $NOW)" | |
echo "Remaining minutes: $(echo "scale=2;$(expr $EOW - $NOW)/60" | bc)" | |
echo "Remaining hours : $(echo "scale=2;($(expr $EOW - $NOW)/60)/60" | bc)" | |
echo "Remaining days : $(echo "scale=2;(($(expr $EOW - $NOW)/60)/60)/24" | bc)" | |
echo "Remaining years : $(echo "scale=2;((($(expr $EOW - $NOW)/60)/60)/24)/365" | bc)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOMORROW=$(date -d "tomorrow" +%Y%m%d) | |
NOW=$(date -d "now" +%s) | |
EOD=$(date -d "$TOMORROW" +%s) | |
echo "$(date)" | |
echo "Remaining seconds today: $(expr $EOD - $NOW)" | |
echo "Remaining minutes today: $(echo "scale=2;$(expr $EOD - $NOW)/60" | bc)" | |
echo "Remaining hours today: $(echo "scale=2;($(expr $EOD - $NOW)/60)/60" | bc)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$WShell = New-Object -com "Wscript.Shell" | |
while ($true) | |
{ | |
Echo "Key press" | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Milliseconds 100 | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Seconds 300 | |
} |