Skip to content

Instantly share code, notes, and snippets.

View brownchow's full-sized avatar
🎯
Focusing

Rick brownchow

🎯
Focusing
  • Earth
View GitHub Profile
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@rnyrnyrny
rnyrnyrny / logger.go
Last active October 23, 2023 05:28
log using uber zap and lumberjack
// NOTE
// This gist was created long time ago.
// According to zap's doc, now we can use zapcore.AddSync to directly add lumberjack as a zap sync
// see https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// So I wrote a new gist if anyone is interested:
// https://gist.github.com/rnyrnyrny/a6dc926ae11951b753ecd66c00695397
// 下面的代码已经过时了,现在直接用zapcore.AddSync就行,参考zap文档
// thanks to:
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active July 10, 2024 06:26
Online Resources For Web Developers (No Downloading)

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@arxdsilva
arxdsilva / tokenGeneratorExample.go
Last active May 22, 2024 03:06
Golang - How to generate a random Token
package main
// https://play.golang.org/p/5VsRVVtyo-J
import (
"crypto/rand"
"fmt"
)
func tokenGenerator() string {
import socket
import telnetlib
import struct
import hashlib
import random
"""
root $ python web_of_science2.py
[*] connected to webofscience2.2016.volgactf.ru:45679
[+] recv: 'Tell me your name first\n'
@mslinn
mslinn / decompile.bat
Last active July 23, 2024 13:17
Decompile JVM class files using IntelliJ IDEA's embedded FernFlower decompiler
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src
@karpathy
karpathy / min-char-rnn.py
Last active July 22, 2024 04:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@ericflo
ericflo / proxy.go
Last active April 17, 2024 21:27
Golang TCP Proxy
package proxy
import (
"io"
"net"
"sync"
log "github.com/Sirupsen/logrus"
)
@denji
denji / golang-tls.md
Last active July 1, 2024 05:41 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

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)