View import
This file contains 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
:do { | |
:do { | |
/file remove "/ipsum.rsc"; | |
/file remove "/subnet.rsc"; | |
} on-error={} | |
:put "Downloading ipsum.rsc..."; | |
:do { | |
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc" | |
} on-error={ |
View docker-compose.yml
This file contains 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
services: | |
rabbit_1: &rmq | |
image: rabbitmq:management | |
hostname: rabbit_1 | |
ports: | |
- "15673:15672" | |
- "5673:5672" | |
environment: | |
- RABBITMQ_ERLANG_COOKIE='mysecret' | |
healthcheck: |
View import
This file contains 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
:do { | |
:do { | |
/file remove "/total.rsc"; | |
} on-error={} | |
:put "Downloading total.rsc..."; | |
:do { | |
/tool fetch address=/*address*/ src-path=total.rsc dst-path="/total.rsc" mode=tftp keep-result=yes | |
} on-error={ | |
:put "Error. Download failed"; |
View makelist.sh
This file contains 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
#!/bin/bash | |
cd /root/blacklist | |
wget -N https://antifilter.download/list/ipsum.lst https://antifilter.download/list/subnet.lst; | |
./merge.pl total.lst ipsum.lst subnet.lst; | |
cat total.lst | sed 's/\(^\)/\/ip firewall address-list add list=rkn address=/g' > total.rsc; | |
cp total.rsc /var/lib/tftpboot/; | |
logger "total.rsc was updated"; |
View merge.pl
This file contains 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
use strict; | |
use Net::IP; | |
my @ips = (); | |
my $result = shift @ARGV; | |
for(my $i = 0; $i < @ARGV; ++$i) { | |
open(my $in, $ARGV[$i]) or warn "Can't open $ARGV[$i]: $!"; | |
while (!eof($in)) { | |
defined(my $line = readline $in) or die "readline failed for $ARGV[$i]: $!"; |
View sprache.cs
This file contains 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
using System; | |
using System.Linq; | |
using Sprache; | |
namespace Trash | |
{ | |
public static class EntryPoint | |
{ | |
public static void Main() | |
{ |
View Patch Version.cs
This file contains 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
function Patch-Version($pathToFile, $buildNumber) { | |
$versionFormat = "(\d+)\.(\d+)\.(\d+)\.(\d+)"; | |
$pathToTmpFile = $pathToFile + ".tmp"; | |
Get-Content $pathToFile | % { $_ -replace $versionFormat, ('$1.$2.' + $buildNumber + '.$4') } | Set-Content $pathToTmpFile | |
Move-Item $pathToTmpFile $pathToFile -force | |
} | |
Patch-Version $args[0] $args[1]; |
View gist:d1d60aac2836bbe19ac8
This file contains 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
import java.util.ArrayList; | |
import java.util.List; | |
public class AvlTree<K extends Comparable<K>, V> { | |
private static class Node<K extends Comparable<K>, V> { | |
public K key; | |
public V value; | |
public Node left; | |
public Node right; | |
public int height; |