Skip to content

Instantly share code, notes, and snippets.

From 5f22ddce5c2f301e9e6b2d38315e44388cefce5d Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Thu, 22 Sep 2016 19:01:48 +0200
Subject: [PATCH] Implementation of draft and RFC versions of CHACHA20-POLY1305
ciphers
Backport of https://github.com/cloudflare/sslconfig/commit/3afa6467ad3b15db2f678f8b5a1f817e56874602
---
Configure | 56 +-
Makefile.org | 4 +-
@userid
userid / ssh_config
Last active October 22, 2016 04:52
Host *
ControlMaster auto
ControlPath /tmp/ssh_mux_%r@%h:%p
ControlPersist yes
#ForwardX11 yes
GSSAPIAuthentication no
ServerAliveInterval 60
package com.framgia.android.emulator;
import android.Manifest;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
@userid
userid / Makefile
Created November 7, 2016 04:15
一个通用的C/C++ Makefile, from http://c4fun.cn/blog/2014/01/30/common-makefile/
#### #######################################################
#
# MAKEFILE FOR C/C++ PROJECT
# Author: swm8023 <swm8023@gmail.com>
# Date: 2014/01/30
#
#### #######################################################
.PHONY: all clean
all:

新的内核:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/linux-image-4.10.0-041000rc1-generic_4.10.0-041000rc1.201612252031_i386.deb
http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/linux-image-4.10.0-041000rc1-generic_4.10.0-041000rc1.201612252031_amd64.deb

sysctl: (default:net.ipv4.tcp_congestion_control = cubic, net.core.default_qdisc = pfifo_fast)

@userid
userid / apc_lock_api.h
Created January 22, 2017 11:01
APCu 中定义的lock相关的宏
PHP_APCU_API zend_bool apc_lock_init();
PHP_APCU_API void apc_lock_cleanup();
/*
The following functions should be self explanitory:
*/
PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock);
PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock);
PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock);
PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock);
PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock);
@userid
userid / build_neovim.sh
Created February 16, 2017 07:55
NeoVIM
rm ./build/ -r
CC=clang make -j4 CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=/usr CMAKE_BUILD_TYPE=Release
<?php
//print_r($_GET);
class A{
}
class B extends A{

This simple code will freeze php-fpm:

cat /tmp/php-apcu/apcu.php

<?php
while (1 != 0) {
    apcu_store ("mykey", "123qwe");
    apcu_fetch ("mykey");
}

If you have request_terminate_timeout = 3, you can run apcu.php with this code:

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;