Skip to content

Instantly share code, notes, and snippets.

View mehdi89's full-sized avatar
💭
looking for new opportunities

Mehedi Hasan mehdi89

💭
looking for new opportunities
  • TubeOnAI
  • Dhaka, Bangladesh
  • 17:01 (UTC -12:00)
View GitHub Profile
@mehdi89
mehdi89 / README.md
Last active June 4, 2026 10:13
smokeping-connectivity — one-shot internet disconnect monitor (Docker, Linux/macOS). Graphs latency+loss to Google/Cloudflare/Quad9 every 60s; gaps show when/how long you were offline. Localhost-only dashboard.

smokeping-connectivity

A one-command internet disconnect monitor. It runs SmokePing in Docker and graphs your connection to Google, Cloudflare, and Quad9 (plus your LAN gateway, if detectable) every 60 seconds.

The graphs tell you when your internet dropped and how long it was out — the "smoke" bands show latency jitter and packet loss, and flat gaps mark full outages. The dashboard is bound to localhost only, so it's private by default.

Works on Linux and macOS. The only requirement is Docker.


@mehdi89
mehdi89 / install_node_exporter.sh
Last active December 16, 2022 11:34
Install latest node_exporter in ubuntu with one command
wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz
tar xvzf node_exporter-*.tar.gz
mv node_exporter-*/node_exporter /usr/local/bin/
# Create a node_exporter user
useradd --no-create-home --shell /bin/false node_exporter
# Set the ownership of the node_exporter binary to the node_exporter user
@mehdi89
mehdi89 / change_aws_instance_type.sh
Last active May 6, 2022 06:29
Change AWS instance type from terminal (stop -> change instance type -> start)
echo "instance id: $1"
echo "instance type: $2"
#2>&1 > /dev/null to suppress the cli output
echo "stopping instance"
aws ec2 stop-instances --instance-ids $1 2>&1 > /dev/null
echo "waiting for instance to stop"
aws ec2 wait instance-stopped --instance-ids $1
@miguelmota
miguelmota / setup.config
Last active July 26, 2021 15:42
Elastic Beanstalk NGINX rewrite http to https using .ebextensions
files:
"/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf":
mode: "000755"
owner: root
group: root
content: |
server {
listen 80;
gzip on;

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>