Skip to content

Instantly share code, notes, and snippets.

View alessiosavi's full-sized avatar
🏠
Working from home

alessiosavi

🏠
Working from home
View GitHub Profile
@byt3bl33d3r
byt3bl33d3r / ecdh_eke.py
Created October 13, 2018 02:55
ECDH Encrypted Key Exchange (Python 3.6+)
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, padding
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from secrets import token_bytes
class DiffieHellman:
def __init__(self):
@psmolak
psmolak / api-spec.md
Last active February 13, 2024 16:22
OGame API documentation

Statistics API

API url: s{server}-{country}.ogame.gameforge.com/api/{endpoint}

Endpoints

players.xml (1 day)
Contain list of all players on the server along with their names and status.

@eduncan911
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@evantoli
evantoli / GitConfigHttpProxy.md
Last active June 19, 2024 00:17
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@zchee
zchee / cgo.md
Last active July 2, 2024 10:20
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@mattes
mattes / check.go
Last active June 12, 2024 19:31
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}