Skip to content

Instantly share code, notes, and snippets.

View almoorthi's full-sized avatar

Moorthi almoorthi

View GitHub Profile
@almoorthi
almoorthi / dummy-web-server.py
Created June 4, 2018 07:11 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
/**
* This script will automatically sync all updates from one database to another. It is meant to be run while
* syncing the database using mongodump and mongorestore.
*
* Example:
* node livesync.js mongodb://<user>:<pass>@dbhost.com:10645/app-production \
* mongodb://<user>:<pass>@dbhost.com:10499/local?authSource=app-production \
* app-production \
* mongodb://<user>:<pass>@newdbhost.com/app-prod
*/
@almoorthi
almoorthi / clickhousedump
Created May 22, 2020 05:51 — forked from inkrement/clickhousedump
dump all clickhouse databases and tables
#!/bin/bash
OUTDIR=.
while read -r db ; do
while read -r table ; do
if [ "$db" == "system" ]; then
echo "skip system db"
continue 2;
"""
Non blocking example:
1. Browse to `localhost:8000/sleep1`
2. Browse to `localhost:8000/`
You'll observe that the first call will take 5 seconds and the second call will be executed immediately.
Blocking example:
1. Browse to `localhost:8000/sleep2`
2. Browse to `localhost:8000/`
@almoorthi
almoorthi / img-url-exif.sh
Created February 15, 2024 06:30 — forked from joshskidmore/img-url-exif.sh
img-url-exif.sh
#!/usr/bin/env bash
# Josh Skidmore <josh@josh.sc>
# Basic example of using an HTTP range header to extract EXIF data
# from a JPEG file without having to download the entire image.
# This has no error handling and assumes the EXIF data is embedded
# within the first $KB_TO_DOWNLOAD kilobytes of the image
# Requirements:
# * curl