Skip to content

Instantly share code, notes, and snippets.

Avatar
😬
welcome

GITSRC gitsrc

😬
welcome
View GitHub Profile
@gitsrc
gitsrc / unixhttpc.go
Created Jul 11, 2020 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
View unixhttpc.go
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
View gist:91313e07e4eae543c1ef983739d96d6d
{
"workbench.colorTheme": "Default Light+",
"git.ignoreLegacyWarning": true,
"window.zoomLevel": 0,
"terminal.integrated.fontFamily": "monospace",
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"workbench.iconTheme": "vscode-icons-mac",
@gitsrc
gitsrc / golang-tls.md
Created Jan 2, 2020 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
View golang-tls.md

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@gitsrc
gitsrc / install-firacode.sh
Created Nov 26, 2019 — forked from nikhita/install-firacode.sh
How to install FiraCode font on Linux
View install-firacode.sh
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
@gitsrc
gitsrc / libuv_tcp_redis_server_example.c
Last active Oct 22, 2019
libuv_tcp_redis_server_example.c
View libuv_tcp_redis_server_example.c
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "hiredis/hiredis.h"
#include <string.h>
#include "uv.h"
typedef struct {
uv_write_t req;
@gitsrc
gitsrc / send_udp.c
Created Jun 13, 2019
linux c send udp
View send_udp.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include "../common/common.h"
int sendUdpPackage(char *udpPackage, Config_INI *config) {
struct sockaddr_in servaddr;
@gitsrc
gitsrc / compile-haproxy.sh
Created Jun 6, 2019 — forked from meanevo/compile-haproxy.sh
Compile HAProxy from source on CentOS 7
View compile-haproxy.sh
# Make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel
# Download/Extract source
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz
tar -zxvf /tmp/haproxy.tgz -C /tmp
cd /tmp/haproxy-*
# Compile HAProxy
# https://github.com/haproxy/haproxy/blob/master/README
make \
TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
View letsencrypt.sh
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --standalone --email test@gmail.com -d test.domain
View golang_ecdh_X25519.go
package main
import (
"bytes"
"crypto/rand"
"fmt"
"github.com/aead/ecdh"
"log"
)
@gitsrc
gitsrc / Pharos_proxy_conf.acl
Last active Apr 28, 2019
Pharos_proxy_acl_conf
View Pharos_proxy_conf.acl
[Rule]
URL,203.205.146.59:80,DIRECT
URL,203.205.128.103:443,DIRECT
IP-CIDR,113.0.0.0/13,DIRECT
IP-CIDR,113.96.0.0/16,DIRECT
IP-CIDR,183.0.0.0/10,DIRECT
IP-CIDR,14.0.0.0/21,DIRECT
IP-CIDR,203.205.0.0/16,DIRECT
IP-CIDR,101.0.0.0/22,DIRECT
You can’t perform that action at this time.