Skip to content

Instantly share code, notes, and snippets.

Avatar

yzzzd legatoo

  • Beijing
View GitHub Profile
View tf_run.sh
#!/bin/bash
####################################################################################################################
#
# 说明:
# 无论单机版本还是分布式版本,请使用本脚本启动您的程序。本脚本默认项目具有一个run.py的主入口。
# 脚本通过用户输入的参数确认执行本地版还是AFO版本。脚本默认从conf文件夹内加载配置。
# * 对于local(默认)模式,从local_settings中以及hyper_params文件夹中抽取程序运行参数,抽取后输送给run.py执行
# * 对于afo模式,加载afo_settings.xml文件,并将hyper_params中指定的超参配置添加入afo_settings.xml,传递给
# afo进行执行
@legatoo
legatoo / bazel.rb
Last active Dec 6, 2018
0.15.0 for tf building
View bazel.rb
class Bazel < Formula
desc "Google's own build tool"
homepage "https://bazel.build/"
url "https://github.com/bazelbuild/bazel/releases/download/0.15.0/bazel-0.15.0-dist.zip"
sha256 "c3b716e6625e6b8c323350c95cd3ae0f56aeb00458dddd10544d5bead8a7b602"
depends_on :java => "1.8"
depends_on :macos => :yosemite
def install
@legatoo
legatoo / cpu.sh
Created Nov 23, 2018
谁在消耗cpu
View cpu.sh
#!/bin/sh
ts=$(date +"%s")
jvmPid=$1
defaultLines=100
defaultTop=20
threadStackLines=${2:-$defaultLines}
topThreads=${3:-$defaultTop}
View install-gcc-4.9.3.sh
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
View gist:74588362e9e16b58ea85edc4ba12c967
import akka.actor.Actor;
import akka.actor.IndirectActorProducer;
import org.springframework.context.ApplicationContext;
/**
* An actor producer that lets Spring create the Actor instances.
*/
public class SpringActorProducer implements IndirectActorProducer {
final ApplicationContext applicationContext;
final String actorBeanName;
View gist:66ff6a6b209fb5311a0764ffc393b3fe
import akka.actor.AbstractExtensionId;
import akka.actor.ExtendedActorSystem;
import akka.actor.Extension;
import akka.actor.Props;
import akka.routing.FromConfig;
import org.springframework.context.ApplicationContext;
/**
* An Akka Extension to provide access to Spring managed Actor Beans.
*/
@legatoo
legatoo / status
Created Mar 19, 2016
Kill lock mysql transcation.
View status
#查看 mysql 正在进行的进程
show processlist;
mysqladmin processlist -h 10.4.243.25 -P 6002 -uq3boy -p123
# transcation 部分可以看到那个 thread 给 lock 了,然后杀掉解锁
SHOW ENGINE INNODB STATUS \G;
#杀掉 mysql 任务
kill id
@legatoo
legatoo / settings.xml
Last active Aug 29, 2015
Maven Setting For Work
View settings.xml
<settings>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>local-repository</id>
<name>local private repository</name>
<url>http://10.64.12.230:8081/nexus/content/groups/public</url>
<releases>
@legatoo
legatoo / yarn-starter.sh
Last active Aug 29, 2015
Put log of every Yarn run into different file
View yarn-starter.sh
#!/usr/bin/env bash
# Start all hadoop daemons. Run this on master node.
bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd`
rm_logfile_name=yarn-yarn-resourcemanager-`hostname`.log
nm_logfile_name=yarn-yarn-nodemanager-`hostname`.log
@legatoo
legatoo / tor_vote.py
Created Dec 7, 2014
Wechat vote using Tor and Pycurl
View tor_vote.py
import subprocess
import pycurl
import time
from urllib import urlencode
from StringIO import StringIO
import re
from io import BytesIO
def refreshIP():
print "Refreshing IP..."
You can’t perform that action at this time.