Skip to content

Instantly share code, notes, and snippets.

View jeantil's full-sized avatar
✔️

Jean Helou jeantil

✔️
View GitHub Profile
@jeantil
jeantil / perf.md
Last active August 25, 2016 09:20
Mesure de perf JVM

Mesure System

  • sysbench
  sysbench --test=memory --memory-block-size=$size --memory-total-size=10G run
  sysbench --test=cpu --num-threads=1 run
  • dstat: https://github.com/dagwieers/dstat
    • ./dstat/dstat --proc --cpu --cpu-use --sys --mem-adv --swap --page --disk -D total --disk-tps --net --time --output my-dstat-output.csv
set JAVA_OPTS="%JAVA_OPTS%
-Dhttp.proxyHost=yourserver
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=yourserver
-Dhttps.proxyPort=8080"
// tu as 2 flux différents a gérer :
// ton protocole interne
def receiveChat:Receive = {
case chatMessage@ChatMessage(message, topic, client) if isActive =>
// dans tous les cas j'ajoute le message a la fin de la file d'attente
// si tu ne fais pas ça tu envoies potentiellement les chat messages dans le désordre
// aka race condition :)
buffer.enqueue(chatMessage)
// dans tous les cas j'essaye d'envoyer totalDemand messages depuis la file d'attente
deliverPending()
<!DOCTYPE html>
<html>
<body>
<script>
var o = function(x){
console.log("debut");
var groups=[];
console.log(groups);
groups.push("toto")
console.log("fin");
@jeantil
jeantil / intellij_notes.md
Last active April 1, 2016 15:10
Notes on some intellij issues I want to tackle

SCL-xxxxx

There are a couple more issues I am interested in fixing but I haven't found where to look yet, pointer would be nice the first is fairly recent (haven't opened the youtrack yet) given the following code

class A()

trying to trigger the move refactor when the cursor is after A results in an error popup which says that Move method is not supported for constructors while it would make sense if the cursor was after the ( I think that before the paren it should trigger a move class not a move method. I have no idea where to look though

public class MockDNSService implements DNSService{
private Map<String,DNSRecord> records=new HashMap<String, DNSRecord>();
public void registerRecord(String hostname, InetAddress[] addresses,Collection<String> MXRecords, Collection<String> TXTRecords ){
records.put(hostname,new DNSRecord(addresses, MXRecords, TXTRecords));
}
public void dropRecord(String hostname){
records.remove(hostname);
}
@jeantil
jeantil / storj_synology_guide.md
Last active February 16, 2017 06:23
Installing dataserv-client on a Synology NAS using Debian Chroot.

History

  • 2016-03-28 revision by redd (BTC/SJCX: 1GhLgxeaa58eCXkWCSCuxLKR18vYXi7Tvi) (pointer to fix enable ssh after DSM 6 upgrade)
  • 2016-03-26 revision by skunk(BTC/SCJX: 18wfYoL4PvmTFUxz3KcH5p5ytbzCS5VT6Z)
  • 2016-02-15 revision by jean (BTC/SCJX: 1JSyKVJJHeAk5QsP7BDZTjGWKwMhaYUZta) (make sure the right pip is used within chroot)
  • 2016-02-01 revision by jean (BTC/SCJX: 1JSyKVJJHeAk5QsP7BDZTjGWKwMhaYUZta) (remove graphviz dependency as it is no longer needed)
  • 2015-12-09 revision by jean (BTC/SCJX: 1JSyKVJJHeAk5QsP7BDZTjGWKwMhaYUZta) (introduces history, drops source.list modification, drops python3, markdown)
  • ??? revision by reddd (BTC/SJCX: 1GhLgxeaa58eCXkWCSCuxLKR18vYXi7Tvi) (
@jeantil
jeantil / Enumerators.scala
Created June 30, 2015 08:29
Generates an enumerator from a sequence of futures
//"experimental, needs to be checked for cpu consumption", "2015-02-20"
object Enumerators {
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Random
import scala.concurrent.duration._
import play.api.libs.iteratee._
type OUT[T] = Option[T]
type ACC[T] = Seq[Future[T]]
@jeantil
jeantil / sense.json
Created May 29, 2015 13:26
Exact Filter on array field in elasticsearch
DELETE /blog
PUT /blog
{
"settings":{
"analysis":{
"analyzer":{
"mykeyword":{
"type":"custom",
"tokenizer":"keyword"
}
@jeantil
jeantil / hlist.scala
Created February 20, 2015 08:53
Filtering "None"'(s) out of an Hlist
object Hlister extends App {
import shapeless._
case class A(value: Int)
case class B(value: Int)
case class C(value: Int)
trait folderLP extends Poly2 {
implicit def default[T, L <: HList] = at[T, L]((t,acc) => acc)
}