Skip to content

Instantly share code, notes, and snippets.

View gen2brain's full-sized avatar

Milan Nikolic gen2brain

  • Belgrade, Serbia
View GitHub Profile
@zxvdr
zxvdr / ssh
Created January 2, 2014 23:41
SSH proxy
package main
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"fmt"
"log"
"net"
"os"
)
@ncw
ncw / README.txt
Last active February 25, 2026 13:30 — forked from spikebike/client output
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@ajdavis
ajdavis / README.md
Last active February 17, 2023 18:31
gprof on Python: How to statically compile Python 2.7.6 on Fedora 18, with some stdlib C modules, plus a hacked-up version of PyMongo and libbson

PYTHON

sudo yum install glibc-static zlib-static

download python source to /virtualenvs/nodict/Python-2.7.6

Configure to accomplish 3 things: static -pg TODO: NEEDED, ALONG WITH --enable-profiling ?? prefix

// compile this like g++ go2.c -lgdi32 [if you're using mingw]
#include <windows.h>
#include <stdio.h>
// Helper function to retrieve current position of file pointer:
inline int GetFilePointer(HANDLE FileHandle){
return SetFilePointer(FileHandle, 0, 0, FILE_CURRENT);
}
//---------------------------------------------------------------------------
@michaljemala
michaljemala / tls-client.go
Last active September 5, 2025 07:30
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@udienz
udienz / pdns-initial.sh
Last active May 31, 2022 14:06
Powerdns bulk create domain to sql records
#!/bin/bash
host=localhost
passwd=17agustus
db=pdns
user=pdns
list=/tmp/blacklists/porn/domains
sqlin="mysql -u $user -p$passwd -h $host $db"
sql_new_domain () {
@VladSumtsov
VladSumtsov / MyActivity.java
Last active July 29, 2019 10:09
RecycleView PullToRefresh SwipeRefreshLayout
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.togethernetworks.basesdk.BaseActivity;
import com.togethernetworks.gallery.samples.mortar.UiModule;
@bradrydzewski
bradrydzewski / generate_docker_cert.sh
Last active January 9, 2026 16:50
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@TheRook
TheRook / spf.py
Last active March 4, 2024 18:27 — forked from moloch--/spf.py
#!/usr/bin/env python
import dns.resolver
import dns.name
#import netaddr
from urlparse import urlparse
INFO = "\033[1m\033[36m[*]\033[0m "
@phrawzty
phrawzty / S3_as_Yum_repo.md
Last active November 10, 2023 19:20
Use S3 as a Yum repo

S3 as Yum repo

There are two parts to this:

  • Managing access to non-public S3 resources.
  • Building RPM repositories in an automated, deterministic way that Yum can use.

Environment

In general, a CentOS 7 x86_64 box in AWS EC2; in specific, this Packer profile.