This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:local apiPrefix "https://uablacklist.net/subnets_mikrotik_" | |
:local tempFile "uablacklist.txt" | |
:local listName "uablacklist" | |
/log info "removing existing '$listName'..." | |
:put "removing existing '$listName'..." | |
/ip firewall address-list remove [/ip firewall address-list find list=$listName] | |
# mikrotik can't load >4KB file inside a variable, so backend contains file pieces which we download and parse one by one | |
:local i 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CustomTime provides an example of how to declare a new time Type with a custom formatter. | |
// Note that time.Time methods are not available, if needed you can add and cast like the String method does | |
// Otherwise, only use in the json struct at marshal/unmarshal time. | |
type CustomTime time.Time | |
const ctLayout = "2006-01-02 15:04:05 Z07:00" | |
// UnmarshalJSON Parses the json string in the custom format | |
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"encoding/xml" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include <avr/sleep.h> | |
#include <avr/power.h> | |
#include <avr/wdt.h> | |
// Blink Before sleeping | |
#define LED_PIN (13) | |
// This variable is made volatile because it is changed inside | |
// an interrupt function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode, | |
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with | |
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/) | |
For ATmega328P, ~0.1µA. | |
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA, | |
for ATtinyX5 revisions that don't, ~20µA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2016 Jeevanandam M. ([email protected]) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This rewrite redirects sitemap.xml to sitemap_index.xml, which is what Yoast's WordPress SEO plugin generates. | |
rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; | |
# This rewrite ensures that the styles are available for styling the generated sitemap. | |
rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; | |
# These rewrites rule are generated by Yoast's plugin for Nginx webserver | |
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last; | |
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; |