Skip to content

Instantly share code, notes, and snippets.

View ik5's full-sized avatar
🎯
Focusing

ik5 ik5

🎯
Focusing
View GitHub Profile
@ik5
ik5 / gist:6e383127ef12b5eb1281df3948d6458f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:296fb90d076f259a5b0a
Add a MAC VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / gist:5ae5a706397b0f4e90df1101b2494f6f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:9f68b1818dca886e9ae8
Add a VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / config
Created February 8, 2019 10:47
my ~/.ssh/config
Host *
ControlPath ~/.ssh/sockets/master-%l-%r@%h:%p
ControlMaster auto
GSSAPIAuthentication=no
ServerAliveInterval 25
Compression yes
IdentityFile ~/.ssh/id_rsa
#ControlPersist yes
UseRoaming no
@ik5
ik5 / checksum.go
Created January 27, 2019 07:36
example of using golang's sha512 for checksum
package main
import (
"crypto/sha512"
"fmt"
)
// CalcChecksum takes a slice of bytes and calculate it as a checksum
// it is using SHA512 for that (128 bytes for result)
func CalcChecksum(buff []byte) []byte {
@ik5
ik5 / peek.go
Created January 8, 2019 07:37
How to reuse stream in golang
package utils
import (
"bytes"
"io"
"io/ioutil"
"net/http"
)
// PeekReadCloser return a copy of a reader without loosing the original content
@ik5
ik5 / wav_duration.go
Created November 21, 2018 12:31
fast example to see if a wav duration is a minute or more
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"time"
"github.com/go-audio/wav"
@ik5
ik5 / testing_hash_functions.go
Created November 18, 2018 16:14
Some non cryptographic hashing algorithms I tested
package main
import (
"fmt"
"hash"
"hash/adler32"
"hash/crc32"
"hash/fnv"
"github.com/dgryski/dgohash"
@ik5
ik5 / scan.py
Created November 12, 2018 05:56
Simple port scanner example written in python 3
#!/usr/bin/env python3
'''
Example on how to do TCP port scanner in Python
'''
import socket
def scan(address, port, timeout=3):
'''TCP Port Scanner'''
@ik5
ik5 / scan.pl
Created November 12, 2018 05:55
Simple port scanner example written in Perl 5
#!/usr/bin/env perl
use warnings;
use strict;
use v5.20;
use IO::Socket::INET;
use experimental qw( switch );
@ik5
ik5 / scan.go
Last active November 12, 2018 05:55
Simple port scanner example written in go
package main
import (
"fmt"
"net"
"strings"
"time"
)
const (