Skip to content

Instantly share code, notes, and snippets.

View dpogorzelski's full-sized avatar

Dawid Pogorzelski dpogorzelski

View GitHub Profile
@dpogorzelski
dpogorzelski / ethereum_keys.sh
Created July 15, 2021 13:59 — forked from miguelmota/ethereum_keys.sh
Generate Ethereum Private key, Public key, and Address using Bash and OpenSSL
# Generate the private and public keys
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key
# Extract the public key and remove the EC prefix 0x04
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Extract the private key and remove the leading zero byte
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv
# Generate the hash and take the address part
BEGIN MESSAGE.
cqfrQAubnizS3ST OsKdqfOlGi3bJrX cKHrQDD6YVRaS9s zpuNBtwGhbuFyvp
RK79wGRJlPhihEB b6B0PO1EmguTCKq 6Xr2MZHgg7059XU sMwIbVekDxLxIx6
vhoKVuXXuCR4H1o Wg9fyOKZf8mlVxH h2PCm6hFPjp6x5t BzgwP6bDbxTzTuH
R91ziexj3Omxfbv X2cNatbw3BNeMOV AgoPi3KrLsWxFio Lq4AH.
END MESSAGE.
@dpogorzelski
dpogorzelski / NC-MySQLDUMP.sh
Created June 9, 2016 13:32 — forked from vanjos/NC-MySQLDUMP.sh
Easy way to do a mysqldump and restore using netcat (this is NOT encrypted)
#####
# You'll be needing two machines, the target machine and source one (makes sense, right)?
#####
# On the target machine
nc -l 55555 | gzip -d -c | mysql <database name> -u<user> -p<password> [ | <decrypt> ]
#####
# On the source machine
mysqldump -u<user> -p<password> <database name> | gzip | nc <ip of target server> 55555 [ | <encrypt> ]
@dpogorzelski
dpogorzelski / statsc.c
Last active August 29, 2015 14:16
statsc
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <statsc.h>
#include <fcntl.h>
#include <strings.h>
#include <string.h>
#include <unistd.h>
bootrec /FixMbr
bootrec /FixBoot
bootrec /ScanOs
bootrec /RebuildBcd
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
# I've found that an equal number of processes & threads tends
# to show the best performance for Graphite (ymmv).
@dpogorzelski
dpogorzelski / sha256.c
Last active December 16, 2020 00:22
sha256
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <netinet/in.h>
#include <stdlib.h>
#define TYP_INIT 0
#define TYP_SMLE 1
#define TYP_BIGE 2
static uint32_t hash[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,

Keybase proof

I hereby claim:

  • I am shoen on github.
  • I am shoen (https://keybase.io/shoen) on keybase.
  • I have a public key whose fingerprint is 103B 7745 C0AC 8658 B4A4 54C9 D256 038D DC33 8ECF

To claim this, I am signing this object:

echo /var/vcap/sys/cores/core-%e-%s-%p-%t > /proc/sys/kernel/core_pattern
ulimit -c unlimited
ulimit -n 100000
echo 5 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
echo 1024 > /proc/sys/net/core/somaxconn