This file contains hidden or 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 | |
# rev 4 - changes suggested by KownBash https://www.reddit.com/r/bash/comments/5cxfqw/i_wrote_a_simple_video_to_gif_bash_script_thought/da19gjz/ | |
# rev 5 - made the script more verbose | |
# rev 6 - fixed an issue with a variable not displaying correctly | |
# rev 7 - added option to change dither level | |
# rev 8 - rewrote usage function | |
# Usage function, displays valid arguments | |
usage() { | |
echo "Usage: $(basename ${0}) [arguments] inputfile" 1>&2 |
This file contains hidden or 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 | |
# Script requirements lastb, diff, touch, whois, mail. | |
# To succesfully send an email it will require a working mail configuration | |
# Tested on Ubuntu 16.04 | |
recipient="[email protected]" | |
if [ ! -f /root/failed ]; then | |
touch /root/failed | |
fi |
This file contains hidden or 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
# | |
# Fully documented Vagrantfile available | |
# in the wiki: https://github.com/josenk/vagrant-vmware-esxi/wiki | |
vm_name = File.basename(Dir.getwd) | |
vm_cpus = '2' | |
vm_ram = '4' | |
if vm_name.include? "web" | |
vm_ram ='2' | |
end |
This file contains hidden or 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 | |
# SSH SOCKS tunnel helper script, opens tunnel, checks | |
# that the port is open then launches Firefox, the ssh | |
# session closes after 10 seconds which is enough time | |
# for Firefox to start but the tunnel will remain open | |
# till Firefox is closed. | |
# | |
# Changes: MP - 22/08/2018 - Initial version, tested on Ubuntu 18.04 and Windows under Cygwin | |
# | |
# Todo: Add proper detection of Cygwin environment |
This file contains hidden or 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 | |
LASTB=$(lastb | awk '{print $3}' | grep -v "192.168.1" | head -n -2 | sort | uniq -c | sed -e 's/^[ \t]*//' | sort -k1nr) | |
# lastb returns failed login attempts | |
# print only the 3rd column which has the IP addresses | |
# grep out local network entries | |
# remove last 2 lines of the output, lasst line is the date and 2nd last is blank | |
# sort list for uniq | |
# uniq -c displays a count of the uniq entries | |
# remove the leading spaces | |
# sorts the output using the 1st column from largest to smallest |
This file contains hidden or 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 | |
# If you forgot to set hostname during install like I often do... | |
sudo hostnamectl set-hostname newhostname | |
# Remove unneeded (by me) packages | |
sudo dnf autoremove -y cheese evolution libreoffice-draw libreoffice-impress gnome-maps gnome-clocks gnome-contacts gnome-contacts gnome-weather | |
# Enable extra repos | |
sudo dnf install -y fedora-workstation-repositories |
This file contains hidden or 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
alias youtube-dl-best='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" ' | |
alias youtube-dl-480='youtube-dl -f "bestvideo[height<=480][ext=mp4]+bestaudio[ext=m4a]" ' | |
alias youtube-dl-720='youtube-dl -f "bestvideo[height<=720][ext=mp4]+bestaudio[ext=m4a]" ' | |
alias youtube-dl-4k='echo -e "This will transcode the video from webm to h264 which could take a long time\n\n"; youtube-dl -f "bestvideo[ext=webm]+bestaudio[ext=m4a]" --recode-video mp4 ' | |
alias youtube-dl-mp3='youtube-dl --extract-audio -f bestaudio[ext=mp3] --no-playlist ' |
This file contains hidden or 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 | |
# Paste this script into /etc/ssh/sshrc | |
# This runs everytime an ssh session is initiated. | |
# The script checkes the remote IP address against the local | |
# subnet, if the subnet is not in the IP address then an | |
# email is sent containing details about the session and | |
# some details from whois about the IP address. | |
# | |
# Changes: Initial version, tested on CentOS 7 | |
# |
This file contains hidden or 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
# Return only the answer | |
dig +noall +answer youtube.com | |
youtube.com. 300 IN A 172.217.167.110 | |
# Return only IP address | |
dig +short youtube.com | |
172.217.167.110 | |
# Return only the answer from Googles DNS server | |
dig +short @8.8.8.8 youtube.com |
This file contains hidden or 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 | |
for file in *.mkv; do | |
# Extract filename from input file without the extension | |
filename=$(basename "$file") | |
#extension="${filename##*.}" | |
filename="${filename%.*}.mp4" | |
echo $filename | |
ffmpeg -i "$file" -codec:v libx264 -preset superfast -crf 22 -vf scale="720:trunc(ow/a/2)*2" -codec:a libfdk_aac -b:a 128k -y "$filename" | |
done |
OlderNewer