Skip to content

Instantly share code, notes, and snippets.

View vamdt's full-sized avatar

vamdt vamdt

  • Foggy Beijing
View GitHub Profile
@vamdt
vamdt / regex.js
Created February 12, 2015 13:03
Common regex
// 中文 英文 数字
var chinese_english_num_re = /[\u4e00-\u9fa5a-zA-Z0-9]+/;
#!/bin/bash
sudo apt-get install -y xfonts-utils fontconfig
cd `dirname $0`
mkdir msyh
cd msyh
curl -O https://coding.net/u/vamdt/p/fonts/git/raw/master/msyh.ttf
curl -O https://coding.net/u/vamdt/p/fonts/git/raw/master/msyhbd.ttf
cd ..
sudo cp -r ./msyh /usr/share/fonts/truetype/
@vamdt
vamdt / ci_php_lint.sh
Last active August 29, 2015 14:26
php lint run in ci(jenkins)
#!/usr/bin/env bash
# APP_ROOT/deploy/ci_php_lint.sh
cd $(dirname $0)
cd ..
exit_code=0
for i in $(git ls-files --ignored --exclude='**/*.php')
do
@vamdt
vamdt / php_info_in_cli_example.sh
Created August 18, 2015 04:56
php info show in cli
#!/usr/bin/env bash
# eg, check gd extensions
php -r 'phpinfo();' | grep -A 20 gd$
@vamdt
vamdt / go-update.sh
Created September 14, 2015 11:47
go update script
#!/usr/bin/env bash
usage() {
printf 'go-update.sh go$VERSION.$OS-$ARCH.tar.gz\n'
exit 1
}
[ -z "$1" ] && usage
go_pkg_name="$1"
@vamdt
vamdt / cmder_aliases
Last active July 30, 2016 05:17
cmder\config\aliases
e.=explorer .
gl=git log --oneline --all --graph --decorate $*
ls=ls --color --show-control-chars $*
pwd=cd
clear=cls
history=cat %CMDER_ROOT%\config\.history
unalias=alias /d $1
g=git $*
gs=git status $*
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\openwemacs]
@="&Edit with Emacs"
[HKEY_CLASSES_ROOT\*\shell\openwemacs\command]
@="E:\\tools\\emacs\\bin\\runemacs.exe \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs]
@="Edit &with Emacs"
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs\command]
#!/usr/bin/env bash
JMETER_PATH=/path/to/jmeter
JMETER_PLAN_DIR=/path/to/jmx
set -xe
cd $(dirname $0)
pwd
for file in $(ls $JMETER_PLAN_DIR); do
@vamdt
vamdt / telnet_send_email.sh
Last active March 17, 2016 07:19
telnet send mail, for test
telnet mail.host 25
ehlo mail.host #握手
mail from:<test@mail.host> #发送方
rcpt to: <testing@target.mail.host> #收件方
data #正文
TO: testing@target.mail.host
FROM: test@mail.host
SUBJECT: telnet test
test,aha
@vamdt
vamdt / SendMail.java
Last active March 18, 2021 02:44
Send mail use java mail api
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.util.*;
public class SendMail {