Skip to content

Instantly share code, notes, and snippets.

View discarn8's full-sized avatar

discarn8 discarn8

View GitHub Profile
@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 #
############################################################################################
@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 / 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 / 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 / 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 / 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 / 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 / DS18B20_fetch-temp.py
Last active March 25, 2022 09:51
Python script to get temperature reading from DS18B20 sensor
#!/usr/bin/python
import os
import time
if os.path.isdir('/sys/bus/w1/devices/28-011111ffffff/'):
os.system('/sbin/modprobe w1-gpio')
os.system('/sbin/modprobe w1-therm')
temp_sensor = '/sys/bus/w1/devices/28-011111ffffff/w1_slave'
@discarn8
discarn8 / d3-diagram.html
Created March 22, 2022 05:06
Simple D3.js Example
d3-diagram.html
--------------------------------------------------------------------
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
body {font-family: 'Arial';
background: #000000;}
</style>
<svg width="960" height="600"></svg>
@discarn8
discarn8 / check_rasp_temp
Created March 21, 2022 04:51
Nagios Check Raspberry Pi Temperature
/usr/lib/nagios/plugins/check_rasp_temp
---------------------------------------------------------
#!/bin/bash
# Adapted from check_nagios_latency
VCGENCMD="/opt/vc/bin/vcgencmd"
# Prints usage information
usage() {