Skip to content

Instantly share code, notes, and snippets.

View dimmaq's full-sized avatar

Dmitrij dimmaq

  • Earth, Russia, Moscow
View GitHub Profile
34012224
17210368
205962976
612220032
8303765625
10460353203
24794911296
27512614111
52523350144
68719476736
@dimmaq
dimmaq / fizzbuzz_test.go
Last active April 29, 2020 11:39
fizzbuzz golang benchmark
package main
import "testing"
func f0(n int) (k int, k3 int, k5 int, k15 int) {
for i := 1; i <= n; i++ {
if i%3 == 0 {
//print("Foo")
k3++
}
package main
import (
"fmt"
"time"
"strings"
)
var logOn = false
@dimmaq
dimmaq / challenge4.go
Created March 25, 2020 13:06
Testing Challenge #4 - generate testing data
package main
/*
What to do
Create 5 valid data input for the specification below.
Enter them 1 at a time until you reach 5.
http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso.torrent
https://github.com/unetbootin/unetbootin/releases/download/677/unetbootin-windows-677.exe
##########################################################################################
##########################################################################################
выполнить команды
sudo add-apt-repository universe
sudo apt install redsocks net-tools
function TestWrapText(const AText: AnsiString): Boolean;
var t1, t2: AnsiString;
begin
t1 := AText;
t2 := WrapMultiLineText(AText, #13#10, ['>', #1..#32], RandomRange(1, 100));
G_Compact(t1);
G_Compact(t2);
Result := t1 = t2
end;
# Generated by iptables-save v1.8.3 on Wed Dec 4 10:14:11 2019
*nat
:PREROUTING ACCEPT [132:10921]
:INPUT ACCEPT [87:7317]
:OUTPUT ACCEPT [220:15238]
:POSTROUTING ACCEPT [59:4492]
:REDSOCKS - [0:0]
-A PREROUTING -i enp+ -p tcp -j LOG --log-prefix "pre_in: "
-A PREROUTING -i enp+ -p tcp -j REDSOCKS
-A POSTROUTING -o wlp+ -j MASQUERADE
mat@vpntest:~$ cat /etc/sockstables.sh
# clear tables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# vpn
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
mat@vpntest:~$ cat /etc/sockstables.sh
# clear tables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# vpn
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
mat@vpntest:~$ cat /etc/sockstables.sh
# clear tables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# vpn
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT