Skip to content

Instantly share code, notes, and snippets.

View vishalroygeek's full-sized avatar

Vishal Roy vishalroygeek

View GitHub Profile
@vishalroygeek
vishalroygeek / port_packet_counter.sh
Created July 29, 2025 06:23
A bash script to count the number of packets received at TCP/UDP port(s) at defined interval ⌚
#!/bin/bash
# Get protocol, ports and interval from CLI
PROTOCOL=$1
PORTS=$2
INTERVAL=$3
if [ -z "$PROTOCOL" ] || [ -z "$PORTS" ] || [ -z "$INTERVAL" ]; then
echo "Usage: $0 <PROTOCOL> <PORTS> <INTERVAL>"
echo "PROTOCOL can be:"
@vishalroygeek
vishalroygeek / redis_monitor_command_counter.sh
Created July 29, 2025 05:42
A bash script that utilizes Redis MONITOR to count its command execution at defined interval ⌚
#!/bin/bash
# Redis connecting string, interval, command to monitor from CLI
REDIS_CONN=$1
INTERVAL=$2
COMMAND=$3
if [ -z "$REDIS_CONN" ] || [ -z "$INTERVAL" ]; then
echo "Usage: $0 <REDIS_COMMAND> <INTERVAL> <COMMAND_TO_MONITOR>"
echo "Example: $0 'redis-cli -h localhost -p 6379' 10 publish"
(function() {
var a = String;
var b = a.fromCharCode;
var c = [
55, 114, 117, 51,
95, 119, 52, 114,
114, 49, 48, 114
];
var d = "";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Loud House GIF</title>
<script>
var encodedURL = "aHR0cHM6Ly9tZWRpYS5naXBoeS5jb20vbWVkaWEvZDNNSlo4R0pTRm9mdEQ4SS9naXBoeS5naWY=";
@vishalroygeek
vishalroygeek / power_down_notifier.pyw
Created July 19, 2020 02:23
A python script that notifies you whenever there is a power cut ⚡
from win10toast import ToastNotifier
from ping3 import ping
import time
import os
#Defining variables
device_ip_address = "192.168.0.101" #IP address of the device to be pinged
notification_delay = 120.0 #Frequency of the offline notification in seconds
loop_delay = 1.0 #Frequency of device status chekcing in seconds
was_offline = False
@vishalroygeek
vishalroygeek / internet_down_buzzer.py
Last active May 10, 2020 16:49
A python script that helps Raspberry Pi make a beep-beep sound when there is no internet 📡
import RPi.GPIO as GPIO
import time
import urllib.request
#Defining variables
buzzer_pin = 23
def setup():
GPIO.setmode(GPIO.BCM)
@vishalroygeek
vishalroygeek / users_to_csv.py
Last active May 10, 2020 16:47
A python script to get all the user data from firestore database and put it into a CSV file 📁
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import csv
#Initializing firebase
cred = credentials.Certificate("path/to/serviceAccount.json")
firebase_admin.initialize_app(cred)
db = firestore.client()