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
# To verify first, just echo instead of move: | |
for f in */* ; do fp=$(dirname "$f"); ext="${f##*.}" ; echo "$f" "$fp"/"$fp"."$ext" ; done | |
# Rename for realz: | |
for f in */* ; do fp=$(dirname "$f"); ext="${f##*.}" ; mv "$f" "$fp"/"$fp"."$ext" ; done | |
# Move all files to root: | |
mv *.mkv */*.mkv . | |
# Delete all empty folders in current directory: |
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
How to view the system specs in linux | |
Open terminal and type sudo dmidecode --type. | |
Don't click Enter yet! after --type, you can write bios or system, etc. to view the related specs. | |
For example: sudo dmidecode --type bios will display the BIOS specs. | |
Complete list of "What can I write after --type" (common parameters are in bold): | |
Memory | |
BIOS | |
System |
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
My Channel: Don't Sleep, Game On! | |
https://www.youtube.com/channel/UC_0LXPKmBlSeHVkAPs-D3kA/ | |
Free Video Editing Software list: | |
https://www.oberlo.com/blog/best-free-video-editing-software | |
OBS Studio 110 - MIXER MASTER - How to use OBS Mixer for Multiple Audio Tracks & Balanced Audio, by EposVox: | |
https://www.youtube.com/watch?v=nd739DyqSV4 | |
OBS Studio - Advanced Mic Settings (Noise Removal, Compressor, Noise Gate), by Gaming Careers: |
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
@ECHO OFF | |
:top | |
ping 8.8.8.8 | |
ECHO. | |
ECHO File start %time% | |
ECHO. | |
:: wget -O - "http://ipv4.download.thinkbroadband.com/100MB.zip" | |
:: wget -O - "http://ipv4.download.thinkbroadband.com/50MB.zip" | |
:: wget -O - "http://ipv4.download.thinkbroadband.com/20MB.zip" | |
:: wget -O - "http://speedtest-ca.turnkeyinternet.net/100mb.bin" |
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 | |
logfile=/root/$$.log | |
exec > $logfile 2>&1 | |
# Can be executed remotely with this command: | |
# curl -L https://gist.githubusercontent.com/flatlinebb/3dea9f4ee2c39ca92ec8bcbd6b0b9a82/raw/f3b63c55d007375bfb4cb10832ff05d6315ce6d8/debian-initial-install.sh | bash | |
# Get OS details: | |
lsb_release -a |
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 | |
set -e | |
set -u | |
set -o pipefail | |
start=$SECONDS | |
exts=$(ls -dp *.*| grep -v / | sed 's/^.*\.//' | sort -u) # not folders | |
ignore="" |
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 | |
# This script allows you to perform an nmap scan against targets listed in a TXT file. | |
# Target can be a single IP, a hostname, or a network range (i.e. 192.168.2.0/24; 10.1.2.10-25) | |
# Nmap will output in XML file, which then will be converted to HTML for web viewing. | |
# The file will be copied to the web server folder when it can be viewed in a browser. | |
# It may be publically viewable, so choose wisely! | |
# Scan can be run on a schedule, it will save old scan copies | |
# Optionally, use mailx or sendmail or whatever you want to email yourself when the scan is done | |
# Exit script on error | |
set -ex |
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 | |
# This script needs to be run as root or sudo!!!! | |
# Provide client name or IP address as CommandLine argument: | |
# For example, sudo ./nmap_ADHOC.sh 192.168.2.111 | |
# Feel free to modify the nmap scan options to suit your needs | |
# Use 'mailx' or any other email solution if you want to be notified by email when the scan is done | |
# Customize the web directory to match your setup | |
# Exit on error, and mark commands with a + in output | |
set -ex | |
# Capture a log file with the same name as the target: |
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
To enable SMART on a drive: | |
for sd in /dev/sd[a-f]; do echo $sd; smartctl --smart=on --offlineauto=on --saveauto=on $sd; done | |
For drives in USB enclosures, add the -d sat switch: | |
for sd in /dev/sd[a-z]; do echo $sd; smartctl --smart=on --offlineauto=on --saveauto=on -d sat $sd; done | |
To get the ERROR rate | |
for sd in /dev/sd[a-z]; do smartctl -A /dev/sdb | head -7| tail -1; smartctl -A /dev/sdb | grep Error_Rate | grep -v Multi | |
for sd in /dev/sd[a-e]; do echo $sd; smartctl -a $sd | grep Model ; smartctl -A $sd | head -7| tail -1; smartctl -A $sd | grep Error_Rate | grep -v Multi; done |
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
# PS1 Prompt | |
tty -s && export PS1="\[\033[38;5;35m\]\t [\[\033[38;5;33m\]\j\[\033[38;5;35m\]] [\h:\[$(tput sgr0)\]\[\033[38;5;33m\]\w\[$(tput setaf 3)\]]\n\\[\033[38;5;35m\]$ \[$(tput sgr0)\]" | |
# Env | |
export TERM=xterm-256color | |
export EDITOR=vim | |
# Don't add duplicate lines or lines beginning with a space to the history | |
HISTCONTROL=ignoreboth |