Skip to content

Instantly share code, notes, and snippets.

View RidaAyed's full-sized avatar

Rida Ayed RidaAyed

View GitHub Profile
@swarminglogic
swarminglogic / watchfile.sh
Last active January 1, 2025 19:07
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@wandernauta
wandernauta / sp
Last active June 3, 2025 10:02
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@benhosmer
benhosmer / time-files-modified.py
Created January 25, 2013 14:12
Find the oldest and newest file in a directory and sort them.
#!/usr/bin/env python
import os
path = 'data'
os.chdir(path)
files = sorted(os.listdir(os.getcwd()), key=os.path.getmtime)
oldest = files[0]
newest = files[-1]
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 18, 2025 09:50
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sobelk
sobelk / tdbalance.sh
Created November 25, 2011 17:18
TD Bank check balance shell script
#!/usr/bin/sh
DOMAIN="onlinebanking.tdbank.com"
COOKIEJAR="cookiejar-tdbank"
USERAGENT='Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2'
USERNAME="username"
read -sp "Password: " PASSWORD; echo
curl \