Skip to content

Instantly share code, notes, and snippets.

View Coneboy-k's full-sized avatar
🌴
On vacation

Jacksun Coneboy-k

🌴
On vacation
View GitHub Profile
@Coneboy-k
Coneboy-k / nginx.conf
Created January 31, 2019 06:17 — forked from fotock/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
/**
* 定期回收心跳的数据
*/
public class PoolItemService {
final static HashedWheelTimer TIMER = new HashedWheelTimer(KKThreadFactory.getInstance("MOTimer", 1));
private ManageClientServiceService manageClientService;
public PoolItemService(ManageClientServiceService iTimerToHeat) {
@Coneboy-k
Coneboy-k / AbsTimerItem.java
Created June 6, 2018 10:47
基于HashedWheelTimer 的对象池
@Slf4j
public abstract class AbsTimerItem {
private static final long MIN_TIMEOUT_MILLIS = 1L;
private HashedWheelTimer timer;
private long readerIdleTimeMillis;
private long writerIdleTimeMillis;
/**
* Created by JackSun on 2017/5/25.
*
* Connect Me. admin@jacksun.me
*/
public class KKThreadHelp {
// 计算类型
@Coneboy-k
Coneboy-k / Singleton.java
Created October 31, 2017 01:33
不使用Lock 实现单例
public class Singleton {
private static final AtomicReference<Singleton> INSTANCE = new AtomicReference<Singleton>();
private Singleton() {}
public static Singleton getInstance() {
for (;;) {
Singleton singleton = INSTANCE.get();
if (null != singleton) {
return singleton;
城的灯
http://www.yangguo.info/
@Coneboy-k
Coneboy-k / token.class.php
Created February 3, 2016 16:22 — forked from BelinChung/token.class.php
REST API 中调用校验Token的生成与维护
<?php
class Token
{
private $mmc;
private $cache_time;
function __construct()
{
$this->cache_time = 60 * 60 * 24;
@Coneboy-k
Coneboy-k / turbo-qiniu.sh
Created November 11, 2015 02:05 — forked from trawor/turbo-qiniu.sh
本脚本解决部分地区七牛上传速度慢的问题
#!/bin/bash
#
# 通过对比 ping 响应时间,找到本机最快的上传ip
# Travis@fir.im
#
function refresh_host()
{
IP="$1"
UPLOAD_HOST="upload.qiniu.com"
@Coneboy-k
Coneboy-k / config
Created October 13, 2015 04:41 — forked from jackyzonewen/config
A SVN config file to solve conflicts for XCode project file,such as xcuserdata,Please Copy follow and write into a file named "config",then copy this file into the path " ~/.subversion/ "
### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.
### Section for authentication and authorization customizations.
[auth]
### Set password stores used by Subversion. They should be
### delimited by spaces or commas. The order of values determines
### the order in which password stores are used.
@Coneboy-k
Coneboy-k / Gitbook 有趣的东西
Last active August 29, 2015 14:09
Gitbook 有趣的东西
[Docker —— 从入门到实践](http://yeasy.gitbooks.io/docker_practice/)
[OpenWrt智能、自动、透明翻墙路由器教程](http://softwaredownload.gitbooks.io/openwrt-fanqiang/)
[Django Girls Tutorial](http://djangogirls.gitbooks.io/djangogirls-tutorial/)
[零基础学Python](http://looly.gitbooks.io/python-basic/)
[github-cheat-sheet](http://snowdream86.gitbooks.io/github-cheat-sheet/)