Skip to content

Instantly share code, notes, and snippets.

View messi18's full-sized avatar

messi18 messi18

  • Tianjin, China
View GitHub Profile
@jarek-przygodzki
jarek-przygodzki / centos-install-kernel-debuginfo.sh
Created February 16, 2017 20:23
CentOS 7 - How to install kernel-debuginfo
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)
import com.sun.btrace.AnyType;
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class ChannelTrace {
@TLS static boolean subscribed = false;
import slick.model.Model
import slick.driver.PostgresDriver
import Config._
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import slick.codegen.SourceCodeGenerator
import slick.jdbc.meta.MTable
import slick.model.Column
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active July 22, 2024 18:14
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@denji
denji / nginx-tuning.md
Last active July 20, 2024 17:33
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@debasishg
debasishg / gist:8172796
Last active July 5, 2024 11:53
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@rednaxelafx
rednaxelafx / DirectMemorySize.java
Created January 11, 2012 07:18
An Serviceability-Agent based tool to see stats of NIO direct memory, as an alternative on JDK6 without JMX support for direct memory monitoring. Only works on JDK6; to work on JDK7 will need some tweaking because static variables are moved to Java mirror
import java.io.*;
import java.util.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.*;
import sun.jvm.hotspot.utilities.*;
public class DirectMemorySize extends Tool {
@rednaxelafx
rednaxelafx / command_prompt
Created January 2, 2012 15:03
quick-n-dirty modification to ObjectHistogram to get generational information
$ export SAPATH=/home/sajia/taobao-jdk-repo/hotspot/make/linux/linux_amd64_compiler2/generated/
$ java -classpath .:$SAPATH/sa-jdi.jar sun.jvm.hotspot.tools.JMap -histo `pgrep java` > jmap_output.log
Attaching to process ID 1587, please wait...
WARNING: Hotspot VM version 20.5-b03 does not match with SA version 20.0-b12-internal. You may see unexpected results.
Debugger attached successfully.
Server compiler detected.
JVM version is 20.5-b03
Iterating over heap. This may take a while...
Heap traversal took 3.577 seconds.
$ java -version
@rednaxelafx
rednaxelafx / clhsdb_session
Created November 25, 2011 14:52
A new "objtree" command for CLHSDB
$ pgrep java
3464
$ clhsdb
hsdb> attach 3464
Attaching to process 3464, please wait...
hsdb> jsload objtree.js
hsdb> objtree 0xc99f6378
Oop for java/util/HashSet @ 0x00000000c99f6378 (size of 16)
_mark: 5
map: Oop for java/util/HashMap @ 0x00000000c99f6388 (size of 48)