Instantly share code, notes, and snippets.

Ido Kanner ik5

  • :::1
View GitHub Profile
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
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 {
View peek.go
package utils
import (
"bytes"
"io"
"io/ioutil"
"net/http"
)
// PeekReadCloser return a copy of a reader without loosing the original content
View wav_duration.go
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"time"
"github.com/go-audio/wav"
View testing_hash_functions.go
package main
import (
"fmt"
"hash"
"hash/adler32"
"hash/crc32"
"hash/fnv"
"github.com/dgryski/dgohash"
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'''
View scan.pl
#!/usr/bin/env perl
use warnings;
use strict;
use v5.20;
use IO::Socket::INET;
use experimental qw( switch );
View scan.go
package main
import (
"fmt"
"net"
"strings"
"time"
)
const (
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) } )
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|