Skip to content

Instantly share code, notes, and snippets.

View billryan's full-sized avatar

billryan billryan

View GitHub Profile
@bgadrian
bgadrian / set.go
Last active April 7, 2024 19:36
How to implement a simple set data structure in golang
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}
@wd
wd / config.json
Last active August 19, 2023 22:23
路由器梅林固件上面使用 v2ray 的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@theanti9
theanti9 / ConnectionPool.scala
Created July 31, 2014 06:51
A simple class for managing a connection pool.
import java.util.concurrent.BlockingQueue
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
class MaxLeaseRetriesException(message:String = null, cause:Throwable = null) extends Exception(message, cause)
class ConnectionPool[R](maxSize:Int, timeout:Int = 1000, unit: TimeUnit = TimeUnit.MILLISECONDS) {
val q: BlockingQueue[R] = new LinkedBlockingQueue[R](maxSize)
@anthonywong
anthonywong / 20-noto-cjk.conf
Last active September 18, 2017 22:47
思源/Noto CJK fonconfig 設定檔
<fontconfig>
<match target="pattern">
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans T Chinese</string>
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@twolfe18
twolfe18 / gist:5767545
Created June 12, 2013 17:49
private[this] vs private in scala
// Foo.scala
class Foo {
private var i = 0
private[this] var j = 0
def getJ = j
def iThing = i * i
def jThing = j * j
}
@spikegrobstein
spikegrobstein / nginx.conf
Last active September 22, 2023 04:19
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
@stelcheck
stelcheck / hbase.rest.scanner.filters.md
Created October 30, 2012 10:00
HBase Stargate REST API Scanner Filter Examples

Stargate Scanner Filter Examples

Introduction

So yeah... no documentation for the HBase REST API in regards to what should a filter look like...

So I installed Eclipse, got the library, and took some time to find some of the (seemingly) most useful filters you could use. I'm very green at anything regarding HBase, and I hope this will help anyone trying to get started with it.

What I discovered is that basically, attributes of the filter object follow the same naming than in the documentation. For this reason, I have made the link clickable and direct them to the HBase Class documentation attached to it; check for the instantiation argument names, and you will have your attribute list (more or less).