Skip to content

Instantly share code, notes, and snippets.

View discarn8's full-sized avatar

discarn8 discarn8

View GitHub Profile
@discarn8
discarn8 / rename.sh
Created April 11, 2022 23:25
Rename with overwrite verify
#!/bin/bash
IFS=''
echo -n "Enter text to rename: "
read -r rename
echo -n "Enter filetype to search (txt, jpg, pdf, etc): "
read ftype
while true; do
read -p "The text to rename is \""${rename}"\" and the filetype is \""${ftype}"\" - Is this correct? " yn
case $yn in
[Yy]* ) for i in *.$ftype; do
@discarn8
discarn8 / rename_character.sh
Created April 12, 2022 00:14
RenameCharacter
#!/bin/bash
IFS=''
echo -n "Enter character to remove: "
read -r rename
while true; do
read -p "The character to remove is \""${rename}"\" - Is this correct? " yn
case $yn in
[Yy]* ) for i in *; do
if [[ "$i" == *"_"* ]];then
echo "Found a file....";
@discarn8
discarn8 / webm_converter.sh
Created April 12, 2022 00:39
webm_convert_to_mp3
#!/bin/bash
# Convert your directory of webm files to mp3 automatically
D="/your_folder_here"
echo $D
while IFS= read -r -d '' file; do
echo "Processing $file" >> "$D/converted.txt"
sleep 1
ffmpeg -nostdin -i "$file" -vn -ab 320k -ar 48000 -y "${file%.*}.mp3"
rm "$file"
@discarn8
discarn8 / screendim.sh
Last active April 17, 2022 05:56
Screendimmer for Raspberry Pi 4 Using ddcutil
#!/bin/bash
# NOTE: Requires ddcutil
# sudo apt install ddcutil -y
# Edit /boot/config.txt and replace fkms with kms, then reboot
# Call using screendim.sh -b 70 -c 70
# Such as in sudo's crontab to bring the screens "alive" at 6am:
# 0 6 * * * /home/pi/scripts/screendim.sh -b 70 -c 70
#
# 70 being a number that you are visually comfortable with, for each setting
# ddcutil detect <-- To get the displays
@discarn8
discarn8 / Save_Bookmarks_and_Export_Installed_Apps.ps1
Created June 2, 2022 20:37
Save Your Windows Bookmarks and Export Your Installed Applications Using PowerShell
# Powershell Script
# Name: Save_Bookmarks_and_Export_Installed_Apps.ps1
# Date: 2022-06-02
# Ver: 1.3
#################################################################################################
#
# PLEASE READ ME FIRST !!!!
#
# PLEASE DEFINE YOUR OWN VARIABLES BEFORE RUNNING
@discarn8
discarn8 / timer.sh
Created August 26, 2022 04:28
Switch tabs in Chromium every 8 seconds and reload specific tabs [tabs] only at specific times [times] and in less than 60 seconds
#!/bin/bash
#set -xv
DISPLAY=:0.0
export DISPLAY=:0.0
export XAUTHORITY=/home/pi/.Xauthority
m=0
action=""
min=$(date +"%M")
times=(00 05 10 15 20 25 30 35 40 45 50 55)
@discarn8
discarn8 / cm600_p2.py
Created April 4, 2023 23:02
Use python2.7 to get the event logs from your Netgear CM600 modem in csv format
############################################################################################
# #
# GET EVENT LOGS FROM NETGEAR CM600 ROUTER/MODEM IN CSV FORMAT #
# CULMINATION OF: #
# https://stackoverflow.com/questions/20383924/how-to-access-netgear-router-web-interface #
# https://stackoverflow.com/users/1777330/murrgon #
# https://gist.github.com/DexterHaslem/d0365dd4cbbcceac22a002fa981beaae #
# #
# PYTHON 2.7 #
############################################################################################