Skip to content

Instantly share code, notes, and snippets.

View diggzhang's full-sized avatar
🎯
Focusing

Xingze Zhang diggzhang

🎯
Focusing
View GitHub Profile
@diggzhang
diggzhang / mongod.conf
Created March 20, 2018 09:37
single cluster cache size 1gb in wt engine.
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
import os
import sys
print("Hello1")
os._exit(1)
print("Hello2")
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
class Mutex implements Lock {
// 静态内部类,自定义同步器
private static class Sync extends AbstractQueuedSynchronizer {
// 是否处于占用状态
ability
ability_belonged
ability_scale
account
added_coins
answer
api
apk_sign
apk_url
app_duration
@diggzhang
diggzhang / jar_pm.sh
Created September 21, 2017 03:58
jar package forever load script
# jar processing manager @diggzhang20170921
# */5 * * * * cd /home/master/event/ && /usr/bin/sh /home/master/event/jar_pm.sh
#!/usr/bin/env bash
# ##################################################
# Java Processing Manager
#
version="0.0.1"
author="diggzhang@gmail.com"
@diggzhang
diggzhang / disk_manager.py
Created September 18, 2017 03:43
使用python监控磁盘容量
# coding:utf-8
"""
Monitor on the target disk
If disk usage out of limit bounds
Execute the cleanup operation
"""
import os
import psutil
@diggzhang
diggzhang / PriorityMailBox.scala
Created September 13, 2017 04:17
PriorityMailBox code snip
package com.packt.chapter1
import akka.actor.{Props, ActorSystem, Actor}
import akka.dispatch.{PriorityGenerator, UnboundedPriorityMailbox}
import com.typesafe.config.Config
/**
* Created by user
*/
object PriorityMailBoxApp extends App {
@diggzhang
diggzhang / CustomMailbox.scala
Created September 13, 2017 03:44
actor mail box test code
package com.packt.chapter1
import java.util.concurrent.ConcurrentLinkedQueue
import akka.actor.{Props, Actor, ActorSystem, ActorRef}
import akka.dispatch.{MailboxType, ProducesMessageQueue, Envelope, MessageQueue}
import com.typesafe.config.Config
/**
* Created by user
*/
@diggzhang
diggzhang / Communication.scala
Created September 13, 2017 03:13
Communication between actors
package com.packt.chapter1
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import scala.util.Random._
/**
* Which contains messages to be sent to the actors.
* Actors will use these messages for communication.
*/
object Messages {
#!/usr/bin/env python3
# coding: utf-8
# https://gist.github.com/diggzhang/37748f50be53cfdabc204dd87130b759
# 回复语,在发送群邀请后会回复这个
reply_text = """你好,如果您是我们歪友,欢迎加入我们歪歪群
"""
# 45min