考虑到之前做的Error Handling,只要写一行
python biligrab.-y -a 1~130000 -p 0 -s 0 -e 3 -n 1
然后买箱咖啡喝掉,就可以把某站的所有东西全dump出来了。。。
https://github.com/cnbeining/Biligrab
代码下面。PEP8后代码过了1000行。。。
Continue reading
wp-search-with-algolia
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/cnbeining.com/html/wp-includes/functions.php on line 6121考虑到之前做的Error Handling,只要写一行
python biligrab.-y -a 1~130000 -p 0 -s 0 -e 3 -n 1
然后买箱咖啡喝掉,就可以把某站的所有东西全dump出来了。。。
https://github.com/cnbeining/Biligrab
代码下面。PEP8后代码过了1000行。。。
Continue reading
还有个0.96.2 版本,在Github。
可以用这个进行大量抓取了。
有必要加个cid模式,直接解析cid么?
代码下面。完整源码必须去Github找。
https://github.com/cnbeining/Biligrab
Continue reading
0.96在
https://github.com/cnbeining/Biligrab/commit/f4764cffd223b791811ff75d924dc3fbd2073753
这个版本没有省略,但是我立刻又发了个fix。。
加入两个ass转换,这样不大可能再出问题了。单纯的容易死。
老地方:
https://github.com/cnbeining/Biligrab
不包含弹幕转换源码了,去项目目录看吧。
代码下面。
Continue reading
然后就是加了100行的代码。
很简陋,主要是版本不同的问题。我个人是没办法解决了。
老地方,https://github.com/cnbeining/Biligrab
代码下面。
danmaku2ass的代码这里不附带了,本项目中有,或者去上游找:https://github.com/m13253/danmaku2ass Continue reading
需要srm:
./bash/profile:
function enc() { tar zcvf - $1 | openssl aes-256-cbc -salt -out $1.aes && srm -mfzr $1 } function dec() { openssl aes-256-cbc -d -in $1.aes | tar zxvf - && rm -f $1.aes }
参考:
https://github.com/JElchison/encrypt-tool/blob/master/encrypt-tool.sh
http://blog.extracheese.org/2010/05/the-tar-pipe.html
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/srm.1.html
http://netsecurity.51cto.com/art/201301/378513.htm
http://www.361way.com/openssl-encrypt-file/2692.html
我自己感觉是快了点。不知道大家感觉如何?
求反馈。
LNMP,http://lnmp.org/ ,是我目前看见的最方便的一键部署脚本。什么都不用担心,全傻瓜(bi)化操作。
但是,由于他几乎更换了所有的默认目录,HHVM会认不出这货。
网上所有的教程都是从0开始安装Nginx。这多不爽。
这里记录一下具体操作。
环境: Ubuntu 12.04 x64(<----重要!x86不能安装,在这里浪费了两个小时)
1.准备环境,安装HHVM:
Ubuntu有deb包,不必自己编译了。
具体列表看这里:https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM
#安装依赖 sudo add-apt-repository ppa:mapnik/boost sudo apt-get update sudo apt-get install libboost1.49-dev libboost-regex1.49-dev \ libboost-system1.49-dev libboost-program-options1.49-dev \ libboost-filesystem1.49-dev libboost-thread1.49-dev #安装HHVM # If this command is not found then do this: sudo apt-get install python-software-properties sudo add-apt-repository ppa:mapnik/boost wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list sudo apt-get update sudo apt-get install hhvm
最后你会看见:
******************************************************************** * HHVM is installed. * * Running PHP web scripts with HHVM is done by having your webserver talk to HHVM * over FastCGI. Install nginx or Apache, and then: * $ sudo /usr/share/hhvm/install_fastcgi.sh * $ sudo /etc/init.d/hhvm restart * (if using nginx) $ sudo /etc/init.d/nginx restart * (if using apache) $ sudo /etc/init.d/apache restart * * Detailed FastCGI directions are online at: * https://github.com/facebook/hhvm/wiki/FastCGI * * If you're using HHVM to run web scripts, you probably want it to start at boot: * $ sudo update-rc.d hhvm defaults * * Running command-line scripts with HHVM requires no special setup: * $ hhvm whatever.php * * You can use HHVM for /usr/bin/php even if you have php-cli installed: * $ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60 ********************************************************************
2. 修改/usr/share/hhvm/install_fastcgi.sh
替换L187~220:
nginx_check_installed() { echo "Checking if Nginx is installed" if [ -d "/usr/local/nginx/conf/" ] then echo "Detected Nginx installation" return 0 fi echo "Nginx not found" return 1 } nginx_check_custom() { echo "Checking for custom Nginx configuration" if [ ! \( -z "$(grep -E "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/nginx.conf")" \) \ -o ! \( -z "$(grep -ER "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/")" \) \ -o ! \( -z "$(grep -ER "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/vhost/")" \) ] then echo "WARNING: Detected clashing configuration. Look at /etc/nginx/hhvm.conf for information how to connect to the hhvm fastcgi instance." return 0 fi return 1 } nginx_enable_module() { echo "Enabling hhvm Nginx module" insert_line "/usr/local/nginx/conf/nginx.conf" 'server_name.*$' 'include hhvm.conf;' echo "Finished enabling module" } nginx_disable_module() { echo "Disabling hhvm Nginx module" remove_line "/usr/local/nginx/conf/nginx.conf" "hhvm.conf" echo "Finished disabling module" }
执行。
3.修改相关文件:
1)
/usr/local/nginx/conf
将所有的vhosts都改成
include hhvm.conf;
2)修改~/vhosts.sh:
同样修改。
4.删除启动项:
停止php-fpm服务,删除/etc/init.d/ 里面的php-fpm,这样这东西就不自动启动了。
5.添加监视脚本:
HHVM有可能会直接就死了。需要个脚本盯着。
脚本:
#! /bin/bash PID="`cat /var/run/hhvm/pid`" if [ "$PID" == "" ]; then /etc/init.d/hhvm start if [ "`ps ax -o pid | grep $PID`" == "" ]; then /etc/init.d/hhvm stop /etc/init.d/hhvm start fi fi
保存为/root/check_hhvm.sh,加入执行权限,添加进cron:
crontab -e
* * * * * root /root/check_hhvm.sh
好了,LNMP已经成功供PHP-FPM换成HHVM了。
从探针可以看见。
http://www.bilicloud.com/
正运行在HHVM上。
Reference:
http://hjc.im/auto-check-hhvm-status/
http://www.freehao123.com/hhvm-wordpress/
https://github.com/facebook/hhvm
https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Ubuntu-12.04
https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-Ubuntu-12.04#installing-boost-149
https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server
http://lnmp.org/faq/lnmp-software-list.html
http://blog.csdn.net/xiyuan1999/article/details/8160998
http://man.ddvip.com/soft/vieditor/vi.html
http://hjc.im/ubuntufu-wu-qi-shang-de-zui-you-wordpressfang-an/
这样0.93有可能是最短命的一个版本了。。。。
好吧,玩到底。
重写了API逻辑,如果受限,直接换假UA。
要亲命啊。
老地方,
https://github.com/cnbeining/Biligrab
代码下面。
Continue reading
看看下一步是不是直接给我发传真过来。
老地方,https://github.com/cnbeining/Biligrab
代码下面。
Continue reading
1. 已经成功过。
2.一个指导性脚本已经完成。
3.暂时不公开。