Skip to content

Instantly share code, notes, and snippets.

Ido Kanner ik5

  • :::1
Block or report user

Report or block ik5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ik5
ik5 / config
Created Feb 8, 2019
my ~/.ssh/config
View 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 Jan 27, 2019
example of using golang's sha512 for checksum
View checksum.go
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 Jan 8, 2019
How to reuse stream in golang
View peek.go
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 Nov 21, 2018
fast example to see if a wav duration is a minute or more
View wav_duration.go
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"time"
"github.com/go-audio/wav"
@ik5
ik5 / testing_hash_functions.go
Created Nov 18, 2018
Some non cryptographic hashing algorithms I tested
View testing_hash_functions.go
package main
import (
"fmt"
"hash"
"hash/adler32"
"hash/crc32"
"hash/fnv"
"github.com/dgryski/dgohash"
@ik5
ik5 / scan.py
Created Nov 12, 2018
Simple port scanner example written in python 3
View scan.py
#!/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 Nov 12, 2018
Simple port scanner example written in Perl 5
View scan.pl
#!/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 Nov 12, 2018
Simple port scanner example written in go
View scan.go
package main
import (
"fmt"
"net"
"strings"
"time"
)
const (
@ik5
ik5 / index.js
Created Oct 26, 2018
Get OSM details on long and lat in go and javascript
View index.js
fetch('https://nominatim.openstreetmap.org/reverse?format=json&lat=32.0959358&lon=34.8215234&addressdetails=1&accept-language=en')
.then((data) => { return data.json() } )
.then((data) => { console.table(JSON.stringify(data)) } )
.catch((err) => { console.error(err) } )
@ik5
ik5 / scan.rb
Last active Aug 27, 2018
simple example for naive TCP port scanner in Ruby
View scan.rb
#!/usr/bin/env ruby
require 'socket'
def tcp_connect(address, port, timeout: 20)
# making sure we are talking with IP
connected = false
addr = Socket.getaddrinfo(address, nil)
sock_addr = Socket.pack_sockaddr_in(port, addr[0][3])
Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket|
You can’t perform that action at this time.