Skip to content

Instantly share code, notes, and snippets.

@EdwardsBean
EdwardsBean / ray.sh
Last active February 22, 2020 02:36
#!/bin/bash
red='\e[91m'
green='\e[92m'
yellow='\e[93m'
magenta='\e[95m'
cyan='\e[96m'
none='\e[0m'
_red() { echo -e ${red}$*${none}; }
_green() { echo -e ${green}$*${none}; }
#!/usr/bin/expect
set timeout 30
spawn ssh -qTfnN -D 7070 [email protected]
expect {
"yes/no"
{
send "yes\r";exp_continue
}
"password:"
{
@EdwardsBean
EdwardsBean / gist:be33fdbb897e463b58bd
Last active August 29, 2015 14:10
各种构建工具仓库设置
# Maven
<repositories>
<repository>
<id>baidu</id>
<url>http://maven.scm.baidu.com:8081/nexus/content/groups/public/</url>
</repository>
<repository>
<id>company</id>
<url>http://172.17.156.61:8081:8081/nexus/content/groups/public/</url>
</repository>
@EdwardsBean
EdwardsBean / stop.xml
Last active August 29, 2015 14:09
java程序停止脚本
#!/bin/bash
FRAMWORK_MAIN_CLASS=""
if [ -z $FRAMWORK_MAIN_CLASS ]; then
echo "FRAMWORK_MAIN_CLASS为空!"
exit 1
fi
echo "kill $FRAMWORK_MAIN_CLASS"
ps -ef|grep $FRAMWORK_MAIN_CLASS|grep -v grep|cut -c 9-15|xargs kill
@EdwardsBean
EdwardsBean / quartz.xml
Created November 12, 2014 09:29
spring quartz配置示例
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--要调用的工作类-->
<bean id="hourJob" class="com.baidu.grab.schedule.PM25HourJob"/>
<!--调用对象和方法-->
<bean id="hourTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
@EdwardsBean
EdwardsBean / package.xml
Created November 12, 2014 09:28
maven工程打包成tar.gz,并生成conf,bin,lib目录
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
<id>package</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
@EdwardsBean
EdwardsBean / start.sh
Created November 12, 2014 09:25
java程序启动脚本
#!/bin/bash
################################
# main
################################
# FRAMEWORK_HOME必填
FRAMEWORK_HOME="/home/edwardsbean/grab"
FRAMWORK_MAIN_CLASS="com.baidu.grab.GrabMain"
FRAMEWORK_CLASSPATH=""
opt_conf=""
@EdwardsBean
EdwardsBean / .gitignore
Created October 13, 2014 14:31
Default excludes for project
#
# Project specific excludes
#
#
# Default excludes
#
# Binaries
*.7z
@EdwardsBean
EdwardsBean / hb-test.py
Last active August 29, 2015 13:58 — forked from takeshixx/hb-test.py
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select