Skip to content

Instantly share code, notes, and snippets.

View floptical's full-sized avatar

Roland MacDavid floptical

  • City of Philadelphia
  • Philadelphia, PA
View GitHub Profile
@cmlewis89
cmlewis89 / arp-monitor.sh
Last active September 25, 2023 20:11
Bash script to monitor any new device connects to a network using arp
#!/bin/bash
#
# arp-monitor, an ARP tables monitor
# inspired by https://gist.github.com/maugern/30ace2764aafc683a802de2ed82f91af
#
# This script is intended to start on launch and run on an always connected device on a network (eg: server).
# It scans the network with 'arp -a' and sends a notification webhook whenever recognizes a new mac address on the network.
#
# For auto-run on login you can rename the script to a .command and add it to your Login items on Mac OS or
# modify the script to remove the loop and take a look at crontab
@carlessanagustin
carlessanagustin / statuscake_ips.php
Last active August 20, 2023 21:17
Generate a list of StatusCake IP addresses to allow in firewall
<?php
/**
* Generate a list of Status Cake Ip addresses
* To add allowed IPs to Nginx or Firewall
* from: https://www.statuscake.com/kb/knowledge-base/what-are-your-ips/
*/
$statuscake_locations_json = "https://app.statuscake.com/Workfloor/Locations.php?format=json";
$locations = json_decode(file_get_contents($statuscake_locations_json));
$output = "#STATUS CAKE IPs" . "\n";
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL