[GCP] 搭建 VPN 服务器 – 在线代理篇

区别与其它代理服务器,在线代理的优点在于不用安装额外的客户端以及配置就直接可以访问被墙的网络,但部分模块可能会无法加载出来,比如 xgeeky.com/proxy

phproxy下载:phproxy

定位到空间的根目录,新建一个文件夹 proxy
下载 proxy.zip 并解压到 proxy 文件夹下
设置好相关权限即所属者
# 新建文件夹并设置归属
sudo mkdir proxy & cd proxy
sudo chown www-data:www-data proxy
# 下载并解压proxy.zip
wget http://xgeeky.com/wp-content/uploads/2017/12/phproxy.zip
unzip phproxy.zip
# 设置归属
sudo chown www-data:www-data *

相关连接
[1] [GCP] 搭建 VPN 服务器 – 创建虚拟机实例
[2] [GCP] 搭建 VPN 服务器 – Shadowsocks篇
[3] [GCP] 搭建 VPN 服务器 – IPsec VPN篇

[GCP] 搭建 VPN 服务器 – IPsec VPN篇

感谢 hwdsl2 的贡献,使得 IPsec VPN 的创建更加简单。

# 下载脚本
wget https://git.io/vpnsetup -O vpnsetup.sh
# 如果需要自定义用户名密码之类,可以先编辑脚本,将里面的YOUR_IPSEC_PSK, YOUR_USERNAME 以及 YOUR_PASSWORD的值替换成自己的,然后运行
nano -w vpnsetup.sh
# 运行脚本
sudo sh vpnsetup.sh

基本上只要耐心等待个几分钟就自动创建完成了。当然对于如何连接到vpn服务器。作者的Github上也有详细的说明。

相关连接
[1] [GCP] 搭建 VPN 服务器 – 创建虚拟机实例
[2] [GCP] 搭建 VPN 服务器 – Shadowsocks篇
[3] [GCP] 搭建 VPN 服务器 – 在线代理篇

参考
[1] hwdsl2 – setup-ipsec-vpn

[GCP] 搭建 VPN 服务器 – Shadowsocks篇

Shadowsocks的创建相对简单,其VPN服务器的支持性也不错。基本只要在对应的平台上安装上客户端,成功配置就可以连接到VPN服务器了。

# 更新系统
sudo apt-get update
# 安装 pip
sudo curl -O sudo apt-get install python-pip
# 使用pip 安装 Shadowsocks
sudo pip install shadowsocks
sudo nano /etc/shadowsocks.json

进入编辑器后复制以下内容,记得替换密码 “mypassword” 成你的密码,之后按 Ctrl+o 保存,Ctrl+x 退出。

{
    "server":"0.0.0.0",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":600,
    "method":"aes-256-cfb",
    "fast_open": false
}
# 新建脚本
sudo nano /etc/init.d/shadowsocks

进入编辑器后复制以下内容,之后按 Ctrl+o 保存,Ctrl+x 退出。

#!/bin/sh
### BEGIN INIT INFO
# Provides:          shadowsocks
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start shadowsocks 
# Description:       start shadowsocks
### END INIT INFO

start(){
    ssserver -c /etc/shadowsocks.json -d start
}

stop(){
    ssserver -c /etc/shadowsocks.json -d stop
}

case "$1" in
start)
    start
    ;;
stop)
    stop
    ;;
reload)
     stop
     start
     ;;
*)
    echo "Usage: $0 {start|reload|stop}"
    exit 1
    ;;
esac
# 修改权限
sudo chmod +x /etc/init.d/shadowsocks
# 添加 开机启动
sudo update-rc.d shadowsocks defaults
# 启动 服务
sudo service shadowsocks start

之后就可以下载相应平台的客户端配置好就可以连接到vpn服务器了。

相关连接
[1] [GCP] 搭建 VPN 服务器 – 创建虚拟机实例
[2] [GCP] 搭建 VPN 服务器 – IPsec VPN篇
[3] [GCP] 搭建 VPN 服务器 – 在线代理篇

参考
[1] 用Google Cloud Platform搭建Shadowsocks服务教程
[2] 设置 shadowsocks server 开机启动

[GCP] 搭建 VPN 服务器 – 创建虚拟机实例

在gcp上(谷歌云)上设置一个vpn服务器可能是最爽的事情了。基于google 1年的免费额,你可以在gcp上创建一个专属vpn私服,甚至可以做到流畅1080p的YouTube播放。

1 端口映射
转到 “VPC Network – Firewall rule” 并添加一下防火墙规则,即允许所有端口。

2 创建虚拟机实例
转到 “Compute Engine – VM instances” 并创建一个实例,参数可以按照一下选择:
Name (名称): 随意
Zone (区域): 选择 asia-east1-a
Machine type (机器类型): micro 即可,一个共享cpu,600mb 内存
Boot disk (启动盘): 选择 Debian 8
Firewall (防火墙): 勾上允许HTTP以及HTTPS
展开选项卡,选择 Networking (网络) – External IP (外网IP): 这里我们需要选择创建一个IP并分配给该虚拟机。这样这个虚拟机才能被外网访问到。

点击保存后,虚拟机即会开始启动。点击SSH就能以网页的形式进入我们所熟悉的SSH界面了。

相关连接
[1] [GCP] 搭建 VPN 服务器 – Shadowsocks篇
[2] [GCP] 搭建 VPN 服务器 – IPsec VPN篇
[3] [GCP] 搭建 VPN 服务器 – 在线代理篇

[GCP] Run tensorflow with GPU on Google Cloud Platform

To create a VM instance, you have to register on the Google cloud platform, and once you registered, you will get a 300$ free trial. I won’t include the registration part here as it is very easy.

1 External IP addresses
Navigate to “VPC Network – External IP addresses” and apply for a new static IP and name it as you want
The result will look like this, in this case, i named it to taiwan as i choose from asia areas:

2 Firewall rules
Navigate to “VPC Network – Firewall rule” and add a firewall rule like this:

3 Apply an API to use GPUs
You have to choose a right area as some areas do not provide GPU usage and the price could be various. In this case, we choose “asia-east1-a” and decide to use its Tesla P100
Navigate to “IAM & admin – Quotas” and select the API you want to apply, you will receive an email from Google, then the follow the instructions to use the GPU you want (usually, just click the link provided in the email).

4 Create an instance
Navigate to “Compute Engine – VM instances” and create an vm instance.
In order to the use GPU we applied, you have to choose the same area.
Hit the “Customize” button and customize your machine type, then expand the GPU section to use a P100.
For the operating system, just choose Ubuntu 16, you can also use an SSD or expand the boot disk size to 20 GB if you like.
For the Firewall section, just tick both the HTTP and HTTPS traffic.
You may also have to expand the next section and configure your network interface to use static IP (optional).
Do not be afraid of the price as Google will only charge you from the 300$ when you are running the device and it is charged by minutes.

5 CUDA® Toolkit 8.0.
Once you have created the instance, click SSH button to open an SSH console and follow the following commands.

sudo apt-get update
sudo curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda-8-0 -y

6 cuDNN v6 for CUDA 8.0
We have to use the Jupyter Notebook to upload our installation package first. To do this, you can click this link and download one. Remeber, you have to create a NVIDIA account if do not have one. Then, agree terms and choose the following one to download, which is the “cuDNN v6.0 Library for Linux”.

# The file name could be different, be careful.
# Download the cudnn package with wget. You can get the download link when you are downlowning a cudnn file.
wget https://...../cudnn-8.0-linux-x64-v6.0.tgz.xxxxxxxxxxx
# Rename the file
mv cudnn-8.0-linux-x64-v6.0.tgz.xxxxxxxxxxx cudnn-8.0-linux-x64-v6.0.tgz
# Unzip the file and install cudnn
tar -xzvf cudnn-8.0-linux-x64-v6.0.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
# Edit .bashrc
nano ~/.bashrc
# Add the following two lines to the file
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
# Press Ctrl+O to save changes and Ctrl+X to exit the editor
# Update changes
source ~/.bashrc

7 Tensorflow

sudo pip3 install tensorflow-gpu

Now you can have fun with your VM instance.
To save your 300$, do not to forget to shutdown your VM instance after using it.

[TicFirm] a tool for sniffing Ticwatch Firmware (Python script updated)!

The tool is still in its alpha stage as some functions may not work as expected, such as the alpha firmware discovery.
这是一个可以用来为Ticwatch 抓取 Ticwear 刷机包的工具,当前还在测试阶段,很多功能尚未实现,比如Alpha版的固件不能很好的获取。

Warning: this tool is only used for test purpose. Be aware of what you are doing with your watch, and I will not be responsible for breaking your device.
警告:该工具只用作测试意图。请想清楚了再刷机,对于由任何该工具造成砖机之类的问题概不负责。如见目前不支持新出的手表如 Ticwatch S, E之类,切记。

Test Results:
1. Ticwatch2 international version -> Ticwath2 Chinese version: Succeed!
2. Ticwatch2 Downgrade to 4.8: Succeed!
3. Ticwatch2 switch version manually: Succeed!

测试结果:
1. Ticwatch2 海外版刷国内版的固件:成功
2. Ticwatch2 刷低版本固件(如4.8):成功
3. Ticwatch2 版本切换(开发板->正式版):成功

Steps:
1. Download your ROM, rename it to “update.zip” and place it in the root folder of sdcard of your watch,
2. Go to develop mode and update manually, wait for around 30 secs for the watch to process.
3. Reset your device after flashing a ROM.

刷写步骤:
1. 下载你需要的固件并重命名为“update.zip”,然后将改固件拷贝至手表存储的sd卡根目录
2. 进入开发者模式,点击手动升级即可。手表大约需要几十秒的时间来配置环境,请耐心等待即可
3.刷完后最好重置下手表。

Current Version / 当前版本: 0.2
Download Link / 下载链接: TicFirm v0.2
TicFirm for PC version may not run correctly because I won’t maintenance it anymore, pls use the python script to find more/new roms.
Ticfirm 的PC程序将不会再继续维护下去,所以请使用下面的python脚本来挖掘你想要的固件。

Ver 0.2:
– Updated most firmware links;
– Added support for all release & beta ROMs.
– Fixed bugs.
Ver 0.1:
– Achieved basic features.

Screenshot:

Advanced users/高级用户:
You can use the folling python script to sniffer any official roms with yourself. All the detected results will be saved into a csv file.
对于高级用户,你可以用以下python脚本来嗅探需要的固件,并且,所有的结果会被保存到csv文件中以供浏览及再利用。
Github: Ticfirm-sniffer

[Tricks] Enable immersive mode with ADB command

//Turn on immersive mode (hide both status and navigation bars)
adb shell settings put global policy_control immersive.full=*
//Hide the navigation bar only
adb shell settings put global policy_control immersive.navigation=*
//These commands could be applied to specific apps, just replace the "*" with package names
//For example, if we want to immersive the Chrome and the Maps, just use the following command
adb shell settings put global policy_control immersive.full=com.android.chrome,com.google.android.apps.maps
//Revert to the standard mode
adb shell settings put global policy_control null

[PSV] VPKManager 0.42 is released!

It is a tool that can help to manager your .vpk files, enjoy!
2016/09/27: Be sure that you are using the right database because the English database and Chinese one are sepsrate.
2016/09/27: The new built version requires you guys to join the world for sharing game infos and savedata. Hence, I provide a temporary admin account which will allow you to modify the online database. Furthermore, if you are willing to do this, pls email me (hzxswxm@gmail.com, it is better to sent me some screenshots for the games you have to prove yourself), then i can share you the real admin account (the long lasting one)!

Version 0.42 (2016/09/26)
1. Fixed the bug that some mini install package cannot install correctly
2. Other improvements (code)

Version 0.41
1. Fixed a bug when calculating the checksum for DLC
2. Fixed a bug when uploading savedata (disable choosing file function when uploading)
3. Fixed a bug for the searchBox (disable when syn)

Version 0.40
1. Added support for Syn with Cloud!
2. Added support for Sharing & Downloading Savedata directly!
3. Added support for more game detials
4. Added support for searching games
5. Added support for choosing language
6. Added support for renameing *.lnk files
7. Added support for remebering the size of windows
8. Fixed some translation bugs
9. Fixed the notification when chooing game path
10. Fixed some bugs when renaming files
11. Lots of improvements
Notice: I have limited the online syn frequency to once per week if you are not using an admin account. The purpose is to protect the weak server. However, thare are alternative ways to force to do online syn, such as delete the native database (VPKManager.en-US.xml or VPKManger.zh-CN.xml).
MOST IMPORTANT: DO NOT keep doing online syn by this trick on purpose!

Version 0.32
1. Added savedate id to ‘Comment’ (Thank donghui2199)
2. Fixed a translantion bug

Version 0.31
1. Fixed a important bug for extracting games
2. Fixed some translantion and other things

Version 0.30
1. Fixed Chinese support
2. Support extracting files with updates or fullgames
3. Fixed several bugs

Version 0.21
1. Fixed a bug of renaming files

Version 0.2
1. Extract games to PSP savedata folder
2. Delete and rename games
3. Lots of improves

Version: 0.1
Features:
1. View .vpk and .zip files
2. Open files and file locations.

Prototypes:
Capture

Capture1

 

Download: VPKManger.zip

[Theme] TouHou Project / 東方Project

Version: 1.10
Updated: 07/10/2015
Description: include all system icons, 10 background pics and BGM.
Changelog:
  Ver 1.01: notifyBgColor fixed (04/10/2015).
  Ver 1.10: Added BGM (绯色月下、狂咲丿绝)!! Thx for ordi the Tutorial. (07/10/2015)

 

2015-10-03-005339 2015-10-03-005341 2015-10-03-005344 2015-10-03-005346 2015-10-03-005350 2015-10-03-005353 2015-10-03-005356 2015-10-03-005358 2015-10-03-005400

 

Download: PCSF00688-TOUHOUPROJECT000_Ver_1.10.zip

Reference: 

http://www.pixiv.net/member_illust.php?id=230943&type=all&p=6