Skip to content

Instantly share code, notes, and snippets.

View mtantawy's full-sized avatar

Mahmoud Tantawy mtantawy

View GitHub Profile
@mtantawy
mtantawy / redirector.rb
Created October 21, 2024 16:43
Redirects follower
# Usage: ruby redirector.rb
# Description: A simple web server that follows redirects for a given URL.
require 'webrick'
require 'net/http'
require 'uri'
require 'timeout'
SERVER_PORT = 8000
class RedirectTracker < WEBrick::HTTPServlet::AbstractServlet
@mtantawy
mtantawy / steam_link_pinger.sh
Created July 4, 2018 08:35
Steam Link pinger
@mtantawy
mtantawy / shitter.sh
Last active September 5, 2017 09:10
Shits random data in equaly sized files.
#!/bin/bash
if [ $1 == "-h" ];
then
echo "Shits random data in equaly sized files.";
echo "Usage: $0 #ITERATIONS #BLOCKS";
exit
fi
ITERATIONS=$1
BLOCKS=$2
@mtantawy
mtantawy / light_sensor_leds.ino
Created March 23, 2016 21:32
Arduino sketch to control LEDs based on a light sensor, light up the LEDs when the light is low and vice versa.
int photoRPin = 0;
int minLight; //Used to calibrate the readings
int maxLight; //Used to calibrate the readings
int lightLevel;
int adjustedLightLevel;
void setup() {
//Serial.begin(9600);
//Setup the starting light level limits