Skip to content

Instantly share code, notes, and snippets.

@ah01
ah01 / gist:762576
Last active April 29, 2021 14:10
const.pde
//
// This sketch will print some of interesting predefined constants to Serial.
//
// For more information, look at
// http://electronics4dogs.blogspot.com/2011/01/arduino-predefined-constants.html
// helper macro
#define LINE(name,val) Serial.print(name); Serial.print("\t"); Serial.println(val);
void setup()
@brenes
brenes / README.md
Last active June 11, 2024 19:15
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@mindplay-dk
mindplay-dk / README.md
Last active March 16, 2024 12:14
ISO 3166-2 Country and State/Region Tables for MySQL
@zhovner
zhovner / whois-change.sh
Created June 22, 2013 23:13
Monitoring whois changes for one domain
#!/bin/bash
#
# Run this script once per day
#
DOMAIN="ZHOVNER.COM"
if [ ! -f /tmp/$DOMAIN.old.whois.txt ]; then
@smithweb
smithweb / httpBL.class.php
Last active September 10, 2022 09:08
Project Honeypot httpBL PHP class
<?php
define( 'httpBL_KEY', '[YOUR API KEY HERE]' );
class httpBL {
private static $_visitor_type = array(
0 => 'Search Engine Bot',
1 => 'Suspicious',
2 => 'Harvester',
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@ruzickap
ruzickap / openwrt_dhcp.sh
Last active November 24, 2021 14:24
OpenWrt DHCP modifications
uci set dhcp.lan.start=200
uci set dhcp.lan.limit=54
uci set dhcp.@dnsmasq[0].domain=xvx.cz
uci set dhcp.@dnsmasq[0].leasefile=/etc/dnsmasq-dhcp.leases
#Send email for new connections:
echo "dhcp-script=/etc/dnsmasq-script.sh" >> /etc/dnsmasq.conf
cat > /etc/dnsmasq-script.sh << \EOF
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@anderZubi
anderZubi / transmission_install.sh
Last active March 8, 2024 06:29
Script to install Transmission BitTorrent client in WD MyCloud NAS
#!/bin/bash
echo Backing up your sources.list...
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo Adding the sid repo to sources.list...
echo deb http://ftp.us.debian.org/debian/ sid main >> /etc/apt/sources.list
echo Updating the sid packages list...
apt-get update