Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhou committed Jul 28, 2017
1 parent b849f84 commit c5040ef
Show file tree
Hide file tree
Showing 26 changed files with 605 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
filetype plugin indent on " required
set number "设置显示行号
set showcmd "在状态栏显示正在输入的命令
set background=dark "为深色背景调整配色
set tabstop=4 shiftwidth=4 expandtab
set laststatus=2
set cursorline "十字光標 横向
"set cursorcolumn "十字光标 纵向

syntax on "开启语法高亮
syntax enable

if has('gui_running')
colorscheme solarized
set guifont=Monaco:h20
endif
8 changes: 8 additions & 0 deletions api_release/autorelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash -
date=`date +%Y-%m-%d_%H%M%S`
sh release.sh $date
if [ $? = 0 ]
then
sh switch.sh $date
echo $date
fi
8 changes: 8 additions & 0 deletions api_release/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
$dir = dirname(__FILE__);
if (isset($_COOKIE['VERSION'])) {
define('VERSION', '/'.trim($_COOKIE['VERSION']));
} else {
define('VERSION', '/'.trim(file_get_contents($dir.'/version.txt')));
}
require_once($dir.'/version'.VERSION.'/public/index.php');
17 changes: 17 additions & 0 deletions api_release/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -

if [ ! $# -eq 1 ]
then
echo 'please input version!'
exit 1;
fi

base_path='/home/xiejinghua/mmd-api/version';
cd version_base
git pull
cd ..
cp -R version_base "$base_path/$1"
cd "$base_path/$1"
mv app/routes.php app/routes.php.bak
mv app/routes.php.bak1 app/routes.php
#/home/xiejinghua/bin/composer.phar install -vvv --no-progress
15 changes: 15 additions & 0 deletions api_release/switch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -

if [ ! $# -eq 1 ]
then
echo 'please input switch version!'
exit 1
fi

path=/home/xiejinghua/mmd-api/version/$1
if [ ! -d "$path" ]; then
echo 'switch directory not find'
exit 1
fi

echo $1 > /home/xiejinghua/mmd-api/version.txt
1 change: 1 addition & 0 deletions api_release/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2014-08-20_135301
Empty file added api_release/version/.gitkeep
Empty file.
Empty file.
50 changes: 50 additions & 0 deletions doc/team.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
# 获取坐标位置 /Applications/Genymotion.app/Contents/MacOS/tools/adb shell getevent | grep -e "0035" -e "0036"
# 转换为10进制
while [ true ]; do
# dps create team
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560 shell input tap 850 61
sleep 1
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560 shell input tap 1086 675
sleep 1

# 更多按钮
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1600 80
sleep 1
# 好友按钮
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1500 480
sleep 1
# 好友第一人
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1200 250
sleep 1
# 申请组队
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 800 400
sleep 1
# 关闭好友
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1830 110
sleep 1


# 第三个技能
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1450 1000
sleep 1
# 第四个技能
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1550 1000
sleep 3
# 第六个技能
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1800 1000
sleep 1


# 组队按钮
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1327 144
sleep 1
# 离开队伍
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 200 1000
sleep 1
# 离开队伍确认
/Applications/Genymotion.app/Contents/MacOS/tools/adb -s model:Google_Nexus_6___6_0_0___API_23___1440x2560_1 shell input tap 1000 600
sleep 1

sleep 60
done
108 changes: 108 additions & 0 deletions doc/tech/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Path to your oh-my-zsh installation.
export ZSH=/Users/sdhou/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

# User configuration

export PATH="/usr/local/sbin:/Users/sdhou/.composer/vendor/bin:/Users/sdhou/bin:/usr/local/bin:/Users/sdhou/sbin:/Users/sdhou/share/python:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/sdhou/.rvm/bin"
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

$(boot2docker shellinit 2> /dev/null)

ssh-add $HOME/.ssh/id_dsa
ssh-add $HOME/.ssh/id_rsa

export CLICOLOR=1
export PATH="$HOME/bin:/usr/local/bin:$HOME/sbin:$HOME/share/python:$PATH"
export LSCOLORS=gxfxaxdxcxegedabagacad
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/
export HOMEBREW_GITHUB_API_TOKEN='520bcad92381aa14ba304072dd0412c9f1d6839d'
export PATH=/usr/local/sbin:/Users/sdhou/.composer/vendor/bin:$PATH

alias ll='ls -alh'
alias odlb="ssh [email protected]"
alias odapp01="ssh [email protected]"
alias odapp02="ssh [email protected]"
alias odjob01="ssh [email protected]"
alias odtest01="ssh [email protected]"
alias odgit="ssh [email protected]"
alias oddb="ssh -qTfnN remote@odjob01 -L 3306/10.10.144.2/3306"
alias sdhou="ssh [email protected]"
alias gitfb='git fetch && git rebase'
alias idehelp="php artisan ide-helper:generate;php artisan ide-helper:meta;php artisan ide-helper:models -W"
60 changes: 60 additions & 0 deletions doc/tech/archlinux_install_gnome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ArchLinux Install Gnome

- 磁盘分区 先用 fdisk -l 查看磁盘
`
fdisk /dev/sda
`

- 格式化磁盘
`
mkfs.ext4 /dev/sda1
`

- 挂载分区
`
mount /dev/sda1 /mnt
vim /etc/pacman.d/mirrorlist
Server = http://mirrors.hustunique.com/archlinux/$repo/os/$arch
pacstrap -i /mnt base base-devel
genfstab -U -p /mnt >> /mnt/etc/fstab
vim /mnt/etc/locale.gen
arch-chroot /mnt /bin/bash
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc --utc
echo sdhou > /etc/hostname
passwd root
pacman -S grub os-prober dhcpcd openssh
grub-install --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable sshd
systemctl enable dhcpcd
exit
umount -R /mnt
reboot

useradd -m -s /bin/bash sdhou
passwd sdhou
vim /etc/sudoers
`

- 查看驱动
`
pacman -Ss xf86
`

- 安装显卡驱动
`
pacman -S extra/xf86-video-vmware
`
- pacman -S xorg xorg-twm xorg-server xorg-xclock
useradd -m -d /home/sdhou -s /bin/bash -c "sdhou" -U sdhou
su sdhou
sudo pacman -S wqy-microhei

vim ~/.xinitrc
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:en_US
export LC_CTYPE=en_US.UTF-8
6 changes: 6 additions & 0 deletions doc/tech/archlinux_vpn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pacman -Ss pptpclient
pptpsetup --create my_tunnel --server vpn.example.com --username alice --password foo --encrypt
pon my_tunnel
ip addr show
sudo ip route add 192.168.0.0/24 dev ppp0
sudo ip route add default dev ppp0
49 changes: 49 additions & 0 deletions doc/tech/dnspod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import httplib, urllib
import socket
import time

params = dict(
login_email="", # replace with your email
login_password="", # replace with your password
format="json",
domain_id=2394039, # replace with your domain_od, can get it by API Domain.List
record_id=36710194, # replace with your record_id, can get it by API Record.List
sub_domain="mmd", # replace with your sub_domain
record_line="默认",
)
current_ip = None

def ddns(ip):
params.update(dict(value=ip))
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/json"}
conn = httplib.HTTPSConnection("dnsapi.cn")
conn.request("POST", "/Record.Ddns", urllib.urlencode(params), headers)

response = conn.getresponse()
print response.status, response.reason
data = response.read()
print data
conn.close()
return response.status == 200

def getip():
sock = socket.create_connection(('ns1.dnspod.net', 6666))
ip = sock.recv(16)
sock.close()
return ip

if __name__ == '__main__':
while True:
try:
ip = getip()
print ip
if current_ip != ip:
if ddns(ip):
current_ip = ip
except Exception, e:
print e
pass
time.sleep(30)
1 change: 1 addition & 0 deletions doc/tech/mac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- sudo discoveryutil mdnsflushcache update dns local pool flush
7 changes: 7 additions & 0 deletions doc/tech/mysql_add_user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```sql
mysql -u root -p
insert into mysql.user(Host,User,Password) values("localhost","phplamp",password("1234"))
flush privileges
grant select,update,insert,delete on phplampDB.* to phplamp@localhost identified by '1234'
flush privileges
```
16 changes: 16 additions & 0 deletions doc/tech/nginx/nginx_api_master.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
upstream newapi {
server 192.168.0.101:80;
}

server {
listen 80;
server_name newapi.meimeidou.cn;

location / {
proxy_pass http://newapi;
}

location /analysis {
alias /usr/local/nginx/html;
}
}
Loading

0 comments on commit c5040ef

Please sign in to comment.