Skip to content

Instantly share code, notes, and snippets.

View gogotanc's full-sized avatar
🎈
New Year~

tanc gogotanc

🎈
New Year~
View GitHub Profile
@gogotanc
gogotanc / JavaPostFileUpload.java
Last active January 21, 2019 09:40
Java post 测试文件上传
// import org.apache.http.*;
HttpClient httpclient = new DefaultHttpClient();
try {
HttpPost httppost = new HttpPost("url");
FileBody bin = new FileBody(new File("path2file"));
MultipartEntity reqEntity = new MultipartEntity(); //建立多文件实体
reqEntity.addPart("parameterName", bin);//upload为请求后台的File upload;属性
httppost.setEntity(reqEntity); //设置实体
HttpResponse response = httpclient.execute(httppost);
rm -rf arcastle
mkdir arcastle
mkdir arcastle/Payload
cp -r arcastle.app arcastle/Payload/arcastle.app
cp icon.png arcastle/iTunesArtwork
cd arcastle
zip -r arcastle.ipa Payload iTunesArtwork
exit 0
@gogotanc
gogotanc / vim批量替换
Created August 21, 2018 10:46 — forked from prafulliu/vim批量替换
vim批量替换
http://hi.baidu.com/zhmsong/blog/item/7cb17eeaddca8adad539c977.html
:s/XXX/YYY/g
其中XXX是需要替换的字符串,YYY是替换后的字符串
以上这句只对当前行进行替换,如果需要进行全局替换,则要:
%s/XXX/YYY/g
如果需要对指定部分进行替换,可以用V进入visual模式,再进行
:s/XXX/YYY/g
或者可以指定行数对指定范围进行替换:
@gogotanc
gogotanc / README-Template.md
Created June 15, 2017 15:37 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@gogotanc
gogotanc / tf_serving.sh
Created May 3, 2017 04:31 — forked from jarutis/tf_serving.sh
Install Tensorflow Serving on Centos 7 (CPU)
sudo su
# Java
yum -y install java-1.8.0-openjdk-devel
# Build Esentials (minimal)
yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils
# Extra Packages for Enterprise Linux (EPEL) (for pip, zeromq3)
yum -y install epel-release
sudo yum -y install epel-release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
# use pip or pip3 as you prefer for python or python3
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
@gogotanc
gogotanc / minReact.html
Created October 7, 2016 14:28
React Hello World示例
<!DOCTYPE html>
<html>
<head>
<script src="../build/react.js"></script>
<script src="../build/react-dom.js"></script>
<script src="../build/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
@gogotanc
gogotanc / Echo.java
Last active October 4, 2016 14:39
Java 获取命令行输入,并显示。
import java.util.Scanner;
public class Echo {
public static void main (String[] args) {
String inData;
Scanner scan = new Scanner( System.in );
System.out.print("Enter the data : ");
inData = scan.nextLine();
System.out.println("You entered : " + inData );
}