View makelist.sh
#!/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 import
: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 merge.pl
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 import
: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 sprache.cs
using System; | |
using System.Linq; | |
using Sprache; | |
namespace Trash | |
{ | |
public static class EntryPoint | |
{ | |
public static void Main() | |
{ |
View Patch Version.cs
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
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; |