Quantcast
Channel: 看得透又看得远者prevail.ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all 20497 articles
Browse latest View live

编译crosstool-ng

$
0
0
从3.1.0开始,udns换成了libc-ares

fedora 26上试验编译crosstool-ng 1.21.0
  • 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    In fileincluded from zconf.tab.c:213:0:
    zconf.hash.c:170:1: error: conflicting types for‘kconf_id_lookup’
     kconf_id_lookup (register const char *str, register size_t len)
     ^~~~~~~~~~~~~~~
    zconf.hash.c:41:25: note: previous declaration of ‘kconf_id_lookup’ was here
     static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
                             ^~~~~~~~~~~~~~~
    make[2]: *** [Makefile:96: zconf.tab.o] Error 1
    make[1]: *** [Makefile:166: build-lib-kconfig] Error 2
    make: *** [Makefile:126: build] Error 2
    这是由于gperf太新导致,需要3.0.4,所以最好还是在docker镜像或者虚拟机里搞好,或者脑残法,直接装个旧版
    1
    2
    3
    4
    5
    6
    wget https://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
    tarxvf gperf-3.0.4
    cdgperf-3.0.4
    ./configure--prefix=/usr
    make
    makeinstall
  • 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    INFO ]  Performing some trivial sanity checks
    [INFO ]  Build started 20170924.112011
    [INFO ]  Building environment variables
    [ERROR]    collect2: error: ld returned 1 exitstatus
    [ERROR]  
    [ERROR]  >>
    [ERROR]  >>  Build failed instep 'Checking that gcc can compile a trivial statically linked program (CT_WANTS_STATIC_LINK)'
    [ERROR]  >>        called instep '(top-level)'
    [ERROR]  >>
    [ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
    [ERROR]  >>        called from: main[scripts/crosstool-NG.sh@546]
    [ERROR]  >>
    [ERROR]  >>  For moreinfo on this error, lookat the file: 'build.log'
    [ERROR]  >>  There is a list of known issues, some with workarounds, in:
    [ERROR]  >>      '/usr/local/share/doc/crosstool-ng/ct-ng.1.21.0/B - Known issues.txt'
    [ERROR]  
    [ERROR]  (elapsed: 0:01.23)
    [00:01] / gmake[1]: *** [/usr/local/bin/ct-ng:147: build] Error 1
    gmake: *** [/usr/local/bin/ct-ng:150: build.4] Error 2

    1
    2
    dnf groupinstall "Development Tools"
    dnf installglibc-devel glibc-static libstdc++-static
  • 1
    2
    3
    4
    5
    6
    7
    8
    9
    [INFO ]  Installing final compiler
    [ERROR]    cfns.gperf:101:1: error: 'const char* libc_name_p(const char*, unsigned int)'redeclared inline with 'gnu_inline'attribute
    [ERROR]    gmake[4]: *** [Makefile:1058: cp/except.o] Error 1
    [ERROR]    gmake[3]: *** [Makefile:4118: all-gcc] Error 2
    [ERROR]    gmake[2]: *** [Makefile:874: all] Error 2
    [ERROR]  
    [ERROR]  >>
    [ERROR]  >>  Build failed instep 'Installing final compiler'
    [ERROR]  >>        called instep '(top-level)'
    这是因为gcc6以上编译旧版gcc 5.1.0,需要上游的patch, 虽然crosstool-ng有在新版本中带这个patch,可是需要的老版本的uclibc又没有了,所以还不如不要在自己系统里编译,用docker开个旧版系统应该方便些
    update 10/14/2017: lz试了下gcc 5.5.0,似乎不会出错,只需要改一下ctng.config文件里的gcc版本号即可,见这里
fedora 25 on docker
官方镜像里有25
1
2
3
4
5
6
7
8
9
sudodocker run -it --name fedora  docker.io/fedora:25 /bin/bash
dnf groupinstall "Development Tools"
dnf installautomake gperf bison flex texinfo wget bzip2libtool ncurses-devel
 
git clone https://github.com/crosstool-ng/crosstool-ng.git
cdcrosstool-ng
git checkout tags/crosstool-ng-1.21.0
./bootstrap
./configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# make
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  CC     'zconf.tab.o'
zconf.tab.c: In function'zconfparse':
zconf.tab.c:1508:42: error: 'kconf_id_strings'undeclared (first use inthis function)
  zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name);
                                          ^~~~~~~~~~~~~~~~
zconf.tab.c:1508:42: note: each undeclared identifier is reported only once foreach functionit appears in
zconf.tab.c:1629:24: warning: implicit declaration of function'kconf_id_lookup'[-Wimplicit-function-declaration]
  struct kconf_id *id= kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string)));
                        ^~~~~~~~~~~~~~~
zconf.tab.c:1629:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
zconf.tab.c: In function'zconf_endtoken':
zconf.tab.c:2237:4: error: 'kconf_id_strings'undeclared (first use inthis function)
    kconf_id_strings + id->name, zconf_tokenname(starttoken));
    ^~~~~~~~~~~~~~~~
In fileincluded from zconf.tab.c:2429:0:
lex.zconf.c: In function'zconflex':
lex.zconf.c:1117:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   struct kconf_id *id= kconf_id_lookup(zconftext, zconfleng);
                         ^~~~~~~~~~~~~~~
lex.zconf.c:1192:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   struct kconf_id *id= kconf_id_lookup(zconftext, zconfleng);
                         ^~~~~~~~~~~~~~~
Makefile:95: recipe fortarget 'zconf.tab.o'failed
make[2]: *** [zconf.tab.o] Error 1
Makefile:166: recipe fortarget 'build-lib-kconfig'failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:126: recipe fortarget 'build'failed
make: *** [build] Error 2
放弃,还是用更老的系统吧
lz用了travis的ubuntu docker镜像
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
make[5]: Entering directory `/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano'
CDPATH="${ZSH_VERSION+.}:"&& cd. && /bin/bash/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano/missingaclocal-1.15 -I m4
configure.ac:27: error: Autoconf version 2.69 or higher is required
configure.ac:27: the toplevel
autom4te: /usr/bin/m4failed with exitstatus: 63
aclocal-1.15: error: echofailed with exitstatus: 63
WARNING: 'aclocal-1.15'is probably too old.
         You should only need it ifyou modified 'acinclude.m4'or
         'configure.ac'or m4 files included by 'configure.ac'.
         The 'aclocal'program is part of the GNU Automake package:
         //www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl inorder to run:
         //www.gnu.org/software/autoconf>
         //www.gnu.org/software/m4/>
         //www.perl.org/>
make[5]: *** [aclocal.m4] Error 63
make[5]: Leaving directory `/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano'
make[4]: *** [nano] Error 2
那就按他说的装2.69好了, 因为repo里只有2.68,可以用apt-cache policy autoconf查询
1
2
3
4
5
6
7
cd~
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tarxf autoconf-2.69.tar.gz
cdautoconf-2.69
sh configure --prefix /usr
make
sudo  makeinstall
因为lz懒得一步一步试验需要装哪些,所以直接用了编译tomato固件时候需要的那些依赖,在此省略(其实就是把tomato-ci repo里的 .travis.sh 里的pre_build_prep运行了一下,装了一堆automake, autoconf, libtool等)
编译crosstool-ng 1.21工具链
准备工作,添加如下配置文件,不然wget没法从https网站下载文件
~/.wgetrc
1
check_certificate = off
1
2
3
4
5
6
7
8
sudoapt-get installgperf texinfo
 
mkdir-p /home/travis/src
 
# edit .config, modify uclibc config file path
ct-ng menuconfig
 
ct-ng build.4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
exportPATH=/home/travis/x-tools/mipsel-unknown-linux-uclibc/bin:$PATH
 
sudoapt-get installasciidoc
 
. ./travis.sh
# then build install all dependencies
 
git clone git@github.com:oglops/shadowsocks-libev.git
 
cdshadowsocks-libev
git submodule update --init --recursive
 
./autogen.sh
 
CPPFLAGS="-I$HOME/cares-install/include -I$HOME/libev-install/include -I$HOME/zlib-install/include"LDFLAGS="-Wl,-rpath,/jffs/lib -L$HOME/cares-install/lib -L$HOME/libev-install/lib -L$HOME/zlib-install/lib"CC=mipsel-unknown-linux-uclibc-gccCXX=mipsel-unknown-linux-uclibc-g++ AR=mipsel-unknown-linux-uclibc-ar RANLIB=mipsel-unknown-linux-uclibc-ranlib ./configure--disable-ssp --prefix=$HOME/ss-install--with-pcre=$HOME/pcre-install--with-sodium=$HOME/libsodium-install--with-mbedtls=$HOME/mbedtls-install--host=mipsel-uclibc-linux
 
make
makeinstall
# Then possibly strip and upx the executable files
文件下载:
http://oglopss.github.io/ctng-ss-jekyll/
3.1.0之前的下载见repo的download文件夹,或者上面github pages页面底部的之前一遍blog里的mega网盘
参考:
Issue during make #39
Repositories on Docker Hub

美国《纽约时报》具体揭秘了习近平的什么事情?

Gitlab禁聘中俄员工 防间谍渗入,盗取机密

$
0
0
问:乌克兰创办的IT公司Gitlab,最近有意推出新人事政策,禁止聘用原籍中国或俄国的员工,并且不容许员工搬到中国或俄国居住,引发相当大的风波。其实这是歧视,还是有需要作出如此严厉的管制?

李建军:其实Gitlab计划推出这项政策的背景,与最近有多间海外IT公司(特别是与保安或代码管理有关的公司)发现内部资料失窃有关。防毒软件公司趋势科技,最近更揭发有员工将公司客户资料售予犯罪集团,令犯罪可以狂打诈骗电话。这类窃案令一众IT公司十分担心,而Gitlab管理包括美国国防承包商在内的代码,而乌克兰人对俄国或中国这类国家对国民的控制手法十分了解,在想不出在技术层面可以解决资料流入中国或俄国政府手中的前提下,担心如果Gitlab失守,会影响西方国家的安全,甚至阻碍翻墙技术的发展,所以Gitlab有意推出如此具争议性政策。其中并非出于种族歧视的考虑,而是Gitlab了解到,中国和俄国政府,都有派人渗透IT公司,以及控制IT公司员工的纪录。

问:为何Gitlab会选择以国籍为前提作出限制?

李建军:中国和俄国都是有名派间-谍渗入商业机构偷取商业机密的国家。但对中国,可能有一个更大问题,就是现时中国会千方百计透过海外使馆,控制海外侨民,由指挥学生破坏连侬墙,到透过一些华裔员工窃取商业和国防机密都有,而Gitlab的主要客户,包括了波音和SpaceX等一些敏感的公司。其实Gitlab的限制,原理与西方不少国家的政府,都对华为打入其国家的网络系统严加限制的原因类似。因为中国根据《国家情报法》,可以下令华为交出用户资料,包括向中国政府提供西方国家通讯系统的后门密码,此情况引起西方国家极大警觉。

另一方面,中国籍或华裔员工亦可能在部分地区,引发客户疑虑。例如在香港,很多人对脸书采取不信任态度,原因就是脸书香港分公司有不少中国员工,而这批员工在处理涉及政治敏感信息时,采取封锁手法,令香港网民感到无法信任。这亦令这次在香港的「反送中」示威中,不少人宁愿使用Telegram,都不愿使用脸书旗下的WhatsApp。在香港和台湾,Gitlab可以接触客户资料的人员如果是中国籍的话,在现时的情况下将引起很大风波;一些开发翻墙软件的独立组织,亦未必敢再用Gitlab来管理代码。所以Gitlab这次,是要在被指歧视以及保护公司客户资料安全之间作出取舍,这是十分困难的事。

问:华人日后进入美国IT公司工作会否越来越难?

李建军:华人要打入一些涉及敏感资料的IT公司,其华裔背景几乎是障碍,因为中国使馆不会放弃在海外搞统战活动,藉此控制海外侨民的活动和思想,甚至利用这些华侨,作为获取谍报或监视异见人士的工具。这种情况如无改善,西方国家的大IT公司,为了保护客户,以及本身的商誉,并无其他选择,只能减少聘请中国背景员工的数目。而事实上这种情况在短期内都不会有任何改善,因为暂时中国并无迹象会约束在海外使馆及在各机构工作人员的活动,或保证不再利用渗透的方式偷取重要资料。而只有防止渗透,才可能避免中国当局事前掌握成果,以研发更好的翻墙软件或技术,供大家在一段时间内安全和稳定使用.
------

共匪搞得中国人几乎“臭名远扬”了。

清理旧的Linux内核释放/boot空间

$
0
0
其实这个问题说穿了就是标题那几个字,/boot空间不够了,那删掉几个不用的旧内核就可以了,正巧这次虚拟机出了这个问题,就截图发个博客……哦对没错,重点其实是我又想写博客了……
今天ssh到虚拟机的时候看到了/boot已用99.1%的提示,还惊讶了一下,因为我模模糊糊记得除了/和swap之外没有再做其他单独的分区.

###查看已经安装的内核
在终端输入以下命令查看已经安装的内核。如果你不是Debian一系的系统,请换用对应的包管理工具:
dpkg --get-selections|grep linux

查看已经安装的内核

###删除旧内核
在终端输入以下命令删除指定的内核,版本号就从已经安装的内核里选旧的。如果你不是Ubuntu,内核的具体名字可能不大一样:
sudo apt-get remove linux-image-(版本号)-generic-pae

重复这个步骤,把不用的内核都删掉。
清爽了很多.

小团队使用 VSTS 快速实现持续集成和持续部署

$
0
0
最近给一个小团队项目做了持续集成和持续部署,实现很快,成本也很低,把过程分享出来供大家参考。

需求

  1. 基本要求:实现持续集成和持续部署,从提交代码开始,自动构建、部署到测试环境。
  2. 系统生态:尽量 .Net 友好。
  3. 代码管理:对接已经存在的私有代码库,国内的,如开源中国Coding.NetCSDN等。
  4. 成本控制:仅一台测试/演示服务器,尽量使用更少的服务器资源,尽量不增加额外资金投入。

方案

列了几个方案,见下表:
SolutionTypePrivate ProjectConcurrent JobCodeService FeeMaint Fee.Net Support
AppVeyorCloud11External Git$29+ / MonthLowFirst Class
Travis CI ProCloudUnlimited1External Git$69+ / MonthLow
JenkinsOn PremiseUnlimitedUnlimitedAnyN / AMiddle
TFS ExpressOn PremiseUnlimitedUnlimitedAnyN / AHighFirst Class
VS Team ServiceCloudUnlimited1 + 1AnyN / ALowFirst Class
{: class=“table table-striped”}
P.S. Visual Studio Team Service的 Free Hosted Pipeline 每月限时 240 分钟。
首先排除掉很贵的那两个,然后考虑一下要不要自建。
自建的话,如果团队内部有对 Jenkins熟悉的可以选它;TFS Express同理但是对服务器的配置要求会更高一点。
这次的项目是一个小团队,一个并行构建完全够用,一个 TFS或者 Jenkins对测试服务器的负担还是有些大,最后选用了 VS Team Service

实施

创建服务账号

填好账号名、项目名,Agile、Scrum、CMMI 按需选一个,决定不了就 Agile。
位置目前有 巴西南部、澳大利亚东部、印度南部、欧洲西部、美国中部 五个区域可选,可以在 Azure Latency Test测试一下这几个相关的区域,按我的经验美国中部稍好一些,延迟大概在100毫秒到200毫秒之间。位置速度的敏感性取决于你的需求,按照本文的项目,不托管代码,不上传下载构建产物,这个延迟已经够用了。
注意,项目创建完成之后,如果你不打算托管代码,就不要初始化默认代码库
Create Visual Studio Team Services Accounts

配置构建代理(Agent)

打开管理面板中的 Agent queues,选择 Default,按说明下载 agent 并在测试服务器上配置好。
Agent queues
配置过程中需要注意的是,如果以服务方式运行(推荐),建议修改登陆为特定用户,而不是默认的本地网络服务账号
完成后应该能在此处看到 agent 的名字,以及 Online / Idle 的状态。
Agent service
Agent queues

配置 Remote Git Repo

这一步非常关键,为了使用我们已有的私有代码库,要把代码库的信息添加进来。
打开管理面板中的 Services,在 Endpoints 选项卡下,点击 New Service Endpoint - External Git,添加一个远程代码库。
Services Endpoints
Add new external Git repository connection
如果已有的私有库支持分配只读权限的 Access Token 最好,如果不支持,就只能添加一个只读权限的账号,通过用户名和密码认证。这里的 External Git 只支持 HTTPS 方式访问代码库(_仅主库,submodule 是支持 SSH 的,详情见后文_)。

配置构建(Build)和发行(Release)

构建(Build)就是编译,而发行(Release)代表部署到某个环境。
参考文档:

1. 创建 Build definition,选择合适的模板。

Build definition template

2. 在 Process 页,选择 Default 为 Defualt agent queue。

Build definition template

3. 在 Get Sources 页,选择 From Remote repo,再选择之前创建的 External Git 库。

Build definition template
这一步需要注意的是,如果你的代码库包含 submodule,依据访问协议的不同,需要做如下处理:
  • SSH 协议:Agent 登陆的用户主目录下须有用于 SSH 登陆的证书(.ssh目录),且该证书所属的 Git 用户至少应有读权限。
  • HTTPS 协议:1) 如果 submodule 所在库可以被公开读取(内网公开可读、或者内部 Git 服务器依据 IP 允许此服务器匿名读取均可),则不需要任何处理;2) 如果 submodule 所在库需要登陆,则需要在 Git Credential Manager 中存储相关登录凭据,最简单的办法,以 Agent 用户身份打开命令行,执行一次基于 HTTPS 协议的 git clone,相关窗口会自动弹出询问凭据。
Git Credential Manager

4. 参考第 2 步的图示,根据实际情况配置构建、本地拷贝构建产物等步骤。

需要注意的是 Agent 登陆用户需要对相关的本地路径、网络共享有写权限。

5. 在 Triggers 选项卡,启用 Continuous Integration 的触发器,并配置轮询间隔。

如果需要也可以配置分支过滤。
Triggers

6. 在 Options 选项卡,配置 Build number format,按需启用 Badge。

Badge 的 URL 会在保存后显示。
Options

7. 在 Publish Build Artifacts 页,选择将 $(Build.SourcesDirectory)\README.md(按实际情况配置一个标志文件)发布到 Server。

Publish Build Artifacts
这一步将一个标志文件作为构建产物上传到服务器,是触发自动发行(Release)的必要条件。如果不进行这一步,在配置发行的时候系统就会尝试自动构建内置代码库的内容来作为发行源。

至此构建部分配置完成。Push 一下,自动构建应该就开始了!

Build Summary
Email Notification

8. 创建 Release definition,选择 Empty

Create release definition

9. 在 Artifacts 页,选择 Choose Later

如果你已经进行过了编译,也可以从 Build 中选择。效果和等下进行了第 11 步一样。
Artifacts

10. 给 Environment 起个名字。

11. 在 Triggers 选项卡,启用 Continuous Integration 的触发器,并配置 Artifacts Source。

Triggers
点击 Link to an artifact source,如无意外所有的条目都会自动填好,直接 Link:
Link to an artifact source
Triggers

12. 在 General 选项卡,填好 Release name format

General

12. 回到 Environments 选项卡,添加一些 Tasks。

通常来说部署到环境的流程不外乎以下三个步骤:
  1. 停止服务
  2. 拷贝新版本
  3. 启动服务
一般会采用脚本停止、启动多个服务。需要注意的是,为了避免意外,如果任意一个服务的停止出错(exit code 不为 0),就应该让整个部署失败(可以在脚本中用类似 if not "%errorlevel%"=="0" exit 1的语句放在每一个停止服务之后);相对的,启动服务的脚本无论何种情况都应该执行,这样如果某些服务停止失败,可以将其他服务再启动起来以恢复环境(虽然部署会失败,但是大部分情况下不影响环境正常工作),因而如图所示,勾选 Start Services 这个 Task 的 Always run。
Environments - Tasks

13. 切到 管理面板的 Notifications 选项卡,配置通知选项。

默认 VS Team Service的通知是基于服务账号的,也就是说通知只会发送给注册到这个服务账号内的用户。需要做一些修改,才能让我们的团队成员收到自动构建和自动发行(部署)的结果。
推荐禁用内置的 Build Completes、Deployment to an owned environment failed、Deployment to an approved environment failed、Deployment completion failures 这几个通知;然后建立两个通知:Build - A build fails 和 Release - A deployment is completed,注意将 Deliver to 设置为 Team email address,然后填写对应的收件人。
Build - A build fails
Release - A deployment is completed

至此发行(部署)部分配置完成。Push 一下,自动的 构建 - 发行 应该就开始了!

Release lummary
Release list
Email Notification

awesome-ci

$
0
0
List of Continuous Integration services

List of Continuous Integration services

Build StatusAwesome
Join chat t.me/sqaunderhood and subscribe to receive notificatons with updates.
There are a lot of cloud continuous integration services. All of them have different set of functionality, some of them require payment, some of them are free. I have created a list of such services to make easy comparison of them and choose more suitable for you.
Some of CI services has open source code thus you can setup them in standalone mode. Pay attention to the column "Features".
There is a similarcomparison on Wikipedia.
NameDescriptionFeaturesSupported repositoriesDocumentationPrice
Abstruse CISelf-Hosted, Open-Source CI Platform. Based on NodeJS and Docker.Languages: everything that can be installed on LinuxGitHub, GitLab, BitBucket, GogsDocumentationOpen Source
App CenterCI Platform. It connects with Hockeyapp where you can store installers and send their by emailCompatible with Android, iOS, Xamarin, React Native, Unity, Cordova, macOS, tvOSGitHub, BitBucket, VSTSDocumentationFree with limitations
AppveyorAppVeyor automates building, testing and deployment of .NET applications.Languages: C#, Xamarin, F#, VB.NET, C/C++, Node.js, Ruby, TypeScript, Go, Java, Python, Perl, ErlangGitHub, BitBucketDocumentationFree with limitations
AssertibleAutomated post-deployment testing and web service monitoringExample IntegrationsGitHubDocumentationFree with limitations
AWS CodeBuildFully managed continuous integration service in AWSDockerAWS S3, AWS CodeCommit, Github, BitbucketDocumentationFirst 100 minutes per month for free, pay-as-you-go later
Azure DevOps (formerly Visual Studio Team Services)Cloud-based collaboration services for version control, agile planning, continuous delivery, and analytics application for Visual Studio, Eclipse, Xcode.
Azure DevOps, GitHub, CustomDocumentationFree with monthly build limits
BadwolfDocker based continuous integration and code lint review system for BitBucketSource code is availableBitBucketDocumentationFree (Open source)
BambooBamboo is a continuous integration and continuous deployment server
Bitbucket (for Bitbucket Cloud), Stash (for Bitbucket Server), Git, GitHub (for GitHub and GitHub Enterprise), Mercurial, Subversion, CVS, Perforce, Custom via pluginsDocumentationFull Atlassian stack for 10 users: 10$/year ( 100% of payments to charity)
BitriseMobile Continuous Integration and Delivery.Source code is availableGitHub, BitBucket, Gitlab, CustomDocumentationFree with limitations
BuildkiteA build automation platform which gives you complete control, without the pain of running your own CI system.Languages: Ruby, Python, Node.js, JavaScript, PHP, Go, Rust, Erlang, Elixir, Java, Clojure, Scala, C/C++, Objective-C, Swift, .NET/C#
Source code is available: Buildkite Agent
GitHub, Bitbucket, GitLab, CustomDocumentation14-day Trial, Free for Education, Open Source
Chrono CIContinuous Integration SecurityLanguages: Ruby on Rails, Python, Node.js, Solidity C, Java, GoGitHubDocumentationFree for 100 tests per month
Circle CIContinuous Integration and Deployment
GitHub, BitbucketDocumentationFree for 1 container
CDSEnterprise-Grade Continuous Delivery & DevOps Automation Open Source PlatformLanguages: everythingGithub, Bitbucket Server, GitlabDocumentationFree Open Source
Cirrus CIBring-Your-Own-Infrastructure CI with modern cloud technologies, matrix builds and simple-yet-powerful configurationFlexible execution environment: any Unix or Windows VM, any Docker container, any amount of CPUs, optional SSDs and GPUsGitHub, BitBucket (planned)DocumentationFree for Open Source, per-second billing for private projects
CodacyAutomated code reviews & code analyticsLanguages: Scala, Java, JavaScript, Python, Ruby, PHP, Apex, JSP, XML, Velocity, VisualForce, C#, JSON, Kotlin, MarkdownGitHub, BitBucketDocumentationFree for open-source projects
Code ClimateHosted platform to continuously measure and monitor code qualityLanguages: Ruby, Javascript, PHPGitHub, CustomDocumentation14-day Trial
CodeFreshCodefresh is a Docker-native CI/CD platform. Instantly build, test and deploy Docker images to KubernetesLanguages: Ruby, Python, Node.js, JavaScript, PHP, Go, Rust, Java, etcGitHub, BitBucket, GitLab, WebhooksDocumentationPricing
CodeshipOne more cloud based CI service: running tests and deploymentLanguages: Dart, Elixir, Go, Java and JVM based languages, PHP, Python, Node.JS, RubyGitHub, BitBucketDocumentationFree ebookFree for opensource projects or 100 builds per month
Concourse CISelf-hosted CI solution written in Golang
GitHub, generic oAuthDocumentationFree (Open source)
continuousphpContinuous Integration and deployment for projects writtn in PHPLanguages: PHPGitHub, BitBucket, GitLabDocumentationFree for Open source and educational projects
CoverallsCoveralls works with your continuous integration server to give you test coverage history and statistics.Languages: Ruby, Javascript, Python, PHP, C, Objective-C, Scala, GOGitHub, BitBucketDocumentationFree for opensource projects
CoverityCode analysis, test analysisLanguages: C/C++, Java, C#
NoneFree for opensource projects
DroneContinuous Integration serviceSource code is available.GitHub,BitBucket, Google Code, CustomDocumentationPricing
EbertEbert does continuous static analysis of your GitHub repositories and delivers it straight to your Pull Requests, helping your team to focus on what's important and deliver better software.Languages: Apex, C, Clojure, CoffeeScript, CSS, Elixir, Go, Haskell, Haxe, JavaScript, Markdown, PHP, Python, Ruby, SCSS, Shell, Swift, Vim script.GitHubDocumentation100% free for public repositories on GitHub
EvergreenEvergreen is a distributed continuous integration system built by MongoDB. It dynamically allocates hosts to run tasks in parallel across many machines.
GitHubDocumentation
GoCDOpen source, on-premises continuous delivery tool.
Git, Perforce, Mercurial,Subversion, TFS, CustomDocumentationOpen Source
GitLabGitLab is a single application for the entire DevOps lifecycleLanguages: everything that can be installed on Linux. Compatible with Linux, Windows, Android and iOSGitLab, GitHub, BitbucketDocumentationOpen Source plus Free with limitations hosted version
GitGudFree & Reliable Git hosting site powered by GitLabEverything that GitLab does but for freeGitLab, Bitbucket, GitHub, Gitea, Clone by URLDocumentationCompletely Free
Hound CIHound integrates with your existing workflow by reviewing and commenting on code.Languages: Bash, Elixir, Go, HAML, JavaScript, CoffeeScript, TypeScript, Markdown, PHP, Python, Ruby, Sass/SCSS, SwiftGitHub
Public repositories for free
HydraNix-based continuous build system

DocumentationOpensource (GNU GPLv3)
JenkinsWith thousands of plugins to choose from, Jenkins can help teams to automate any task that would otherwise put a time-consuming strain on your software team.Languages: Embedded, PHP, Python, Ruby, Java, Android, C/C++.Any VCS that supports git, mercurial, cvs, subversionDocumentationOpen Source
KritikaCoverage, Duplications, Code violationsLanguages: PerlGitHubDocumentationFree for public repositories
PeakflowCI builds, error reporting and uptime monitoringLanguages: Ruby, PHP, Javascript and anything you can set up yourself.GithubDocumentationFree for private projects
PrevisUse Travis configuration to run stuff locally in a clean environment.Everything that Travis support or almostYour computer, it's running locally!DocumentationIt's free! Since you are hosting everything locally on your computer!
Probo.CIContinuous Collaboration - break down the barriers between software developers and the other stakeholders involved in a software development projectUnderlying engine is OSS, offers several Ubuntu base images, asset pre-upload helps build speed.GitHub, BitBucketDocumentation2 month free trial then starts at $30. Pricing
Rocro INSPECODEReview less, move faster. Speed up your software development with Inspecode’s continuous code inspection and automated code correction.Languages: Java, JavaScript, C, C++, Python, Ruby, PHP, Go, Scala, TypeScript, Clojure and more...GitHub, BitBucketDocumentationFree with limitations
SaucelabsAutomated testing in the cloud for CI

Documentation14-day Trial
ScrutinizerBuild quality software, betterSources are availableGitHub, BitBucketDocumentation14-day Trial
SemaphoreHosted continuous integration and delivery solution for open source and private projects.Ruby, Node.js, JavaScript, Go, Clojure, Elixir, Erlang, Java, PHP, Scala, C/C++GitHub, BitBucketDocumentationFree for Open Source, pay only for what you use, first $20 every month on Semaphore (up to 1,300 service minutes)
ShippableContinuous DeliveryLanguages: Ruby, Python, Java, Node.js, Scala, PHP, Go; Databases: MongoDB, MySQL, Redis, Postgres, CouchDB, RethinkDB, Neo4j, and SQLiteGitHub, BitBucket, GitLabDocumentationFree with limitations
SiderIncrease code review efficiency and deliver products with confidence. Sider helps development teams accomplish more, allowing them to deliver more value to their customers.Supported Analysis ToolsGitHubDocumentationFree 14-day trial for private repositories, and forever free for open source
StyleCIThe Web Coding Style Service, used by Cachet and Laravel.Languages: PHP, JavaScript, TypeScript, Flow, CSS, SCSS, Less, Vue.js, PythonGitHub, BitBucket, GitLabDocumentationFree for opensource projects
TeamCityA Java-based build management and continuous integration server from JetBrains.Support wide variety of web browsers and build toolsGit, Subversion, Perforce, Team Foundation Server, Mercurial, CVS, SourceGear Vault 6 and 7, Borland StarTeam 6 and up, IBM Rational ClearCase, Base and UCM modes, Microsoft Visual SourceSafe 6 and 2005DocumentationFree with limitations
Travis CIHosted continuous integration service for open source and private projects.Languages: C, C++, Clojure, D, Erlang, Go, Groovy, Haskell, Java, Javascript (with Node.js), Objective-C, Perl, PHP, Python, Ruby, Rust, Scala. Source code is available.GitHubDocumentationFree for opensource projects
WerckerContinuous delivery platform
Docker HubDocumentation





定制 OpenWrt 固件-透明代理

$
0
0

折腾 OpenWrt 也有些日子了,不过还从来没尝试过自己定制 Rom。今天心血来潮,想把手里目前闲置的一个路由拿去做个中继 + 透明代理。

Repeater

现在市面上能买到的很多路由器都支持中继模式,我手里这台 HG556a ver.C 在更新到 OpenWrt Chaos Calmer 正式版之后居然也支持了。实测中继模式运行完美,美滴很。
本来我还不得不插上一个 Atheros 的无线网卡进行中继呢,现在倒是省事了。

Transparent Proxy

所谓透明代理,就是说,用户完全感受不到代理的存在,但是又能享受代理提供的网络服务。
实际使用时,用户不需要设置代理或者 VPN,就能够达到翻墙等目的。

OpenWrt ImageBuilder

这次我们的定制选择使用 OpenWrt ImageBuilder 进行。因为 Build 的是 Chaos Calmer 正式版映像,没有必要从源代码开始编译。如果是 Trunk 的话,由于内核版本迭代非常快,建议从源代码开始编译。
首先下载 Chaos Calmer 的 ImageBuilder。官方源很不稳定而且速度慢,推荐中科大的镜像源:http://mirrors.ustc.edu.cn/openwrt/
下载时只需确定自己的设备类型就可以,比如我们这次使用的 HG556a ver.C 属于 brcm63xx。
还有一点,brcm63xx 以及很多其他的 BSP 都有 generic 和 smp 两种固件。这是因为 BroadCom 有几个 CPU 为双核心,但是其架构比较特别,比如我们使用的 HG556a 的 BCM6358,两个核心共享同一个 TLB,因此 OpenWrt 官方并不支持在 BCM6358 SoC 上使用双核心。而 BCM6362 和 BCM6368 每个核心拥有独立的 TLB,在这些 SoC 上使用 smp 固件就可以完全释放双核心的潜能。
这里还有一点要说明,BCM6358 的两个核心并不完全相同,Core 0 的 Instruction Cache 比 Core 1 的大一倍,然而 OpenWrt 默认只使用 Core 1。我们可以通过修改 CFE 中部分代码,使系统使用 Core 0。据说可以获得 15-20% 的性能提升。
我们在这里选 generic 和 smp 没有太大区别,干脆也选 smp 吧。那么下载得到的文件就是 OpenWrt-ImageBuilder-15.05-brcm63xx-smp.Linux-x86_64.tar。
解压之后我们可以看到下面这些东西:
$ ll
总用量 1068
drwxr-xr-x 11 yichya yichya 4096 2月 14 01:38 ./
drwxrwxr-x 4 yichya yichya 4096 2月 13 16:14 ../
drwxrwxr-x 3 yichya yichya 4096 2月 13 15:17 bin/
drwxr-xr-x 3 yichya yichya 4096 9月 4 21:37 build_dir/
-rw-r--r-- 1 yichya yichya 98530 9月 4 21:37 .config
drwxrwxr-x 2 yichya yichya 12288 2月 13 23:04 dl/
drwxr-xr-x 3 yichya yichya 4096 9月 4 21:38 include/
-rw-r--r-- 1 yichya yichya 5239 7月 24 2015 Makefile
-rw-r--r-- 1 yichya yichya 686463 9月 4 21:13 .packageinfo
drwxr-xr-x 3 yichya yichya 4096 2月 13 15:17 packages/
-rw-r--r-- 1 yichya yichya 1211 2月 13 16:57 repositories.conf
-rw-r--r-- 1 yichya yichya 10680 7月 24 2015 rules.mk
drwxr-xr-x 4 yichya yichya 4096 7月 24 2015 scripts/
drwxr-xr-x 3 yichya yichya 4096 9月 4 21:37 staging_dir/
drwxr-xr-x 3 yichya yichya 4096 9月 4 21:37 target/
-rw-r--r-- 1 yichya yichya 223540 9月 4 21:13 .targetinfo
drwxrwxr-x 2 yichya yichya 4096 2月 13 15:15 tmp/
首先我们需要做的事情是,配置 repositories.conf,将 OpenWrt.org 官方源换为 ustc.edu.cn 提供的镜像源。
## Place your custom repositories here, they must match the architecture and version.
# src/gz chaos_calmer http://downloads.openwrt.org/chaos_calmer/15.05/brcm63xx/smp/packages
# src custom file:///usr/src/openwrt/bin/brcm63xx/packages

## Remote package repositories
src/gz chaos_calmer_base http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/base
src/gz chaos_calmer_luci http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/luci
src/gz chaos_calmer_packages http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/packages
src/gz chaos_calmer_routing http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/routing
src/gz chaos_calmer_telephony http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/telephony
src/gz chaos_calmer_management http://mirrors.ustc.edu.cn/openwrt/chaos_calmer/15.05/brcm63xx/smp/packages/management

## This is the local package repository, do not remove!
src imagebuilder file:packages
这样,后面生成映像的速度会有很大提升。
输入 make 命令查看帮助:
$ make
Available Commands:
help: This help text
info: Show a list of available target profiles
clean: Remove images and temporary build files
image: Build an image (see below for more information).

Building images:
By default 'make image' will create an image with the default
target profile and package set. You can use the following parameters
to change that:

make image PROFILE=""# override the default target profile
make image PACKAGES=" [ [ ...]]"# include extra packages
make image FILES=""# include extra files from
make image BIN_DIR=""# alternative output directory for the images
那么我们先看一下这个包中包含的所有 target profile 吧。
$ make info
Current Target: "brcm63xx (smp)"
Default Packages: base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools swconfig kmod-gpio-button-hotplug dnsmasq iptables ip6tables ppp ppp-mod-pppoe kmod-nf-nathelper firewall odhcpd odhcp6c
Available Profiles:

Default:
Default Profile
Packages: kmod-b43 wpad-mini
963281TAN:
Generic 963281TAN
Packages:
96328avng:
Generic 96328avng
Packages:

# ...

HG556a_AB:
Huawei EchoLife HG556a (version A/B - Atheros)
Packages: kmod-ath9k wpad-mini kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
HG556a_C:
Huawei EchoLife HG556a (version C - Ralink)
Packages: kmod-rt2800-pci wpad-mini kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
HG655b:
Huawei HG655b
Packages: kmod-rt2800-pci wpad-mini kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev

# ...
我们看到 HG556a ver.C 对应的 profile 是 HG556a_C。那么我们直接试着 make image 一下吧。
$ make image PROFILE="HG556a_C"
没费多少功夫就结束了,然后我们就可以在 bin 文件夹下面找到这些东西:
$ ll bin/brcm63xx/
总用量 8504
drwxrwxr-x 2 yichya yichya 4096 2月 14 19:25 ./
drwxrwxr-x 3 yichya yichya 4096 2月 13 15:17 ../
-rw-rw-r-- 1 yichya yichya 292 2月 14 16:17 md5sums
-rw-rw-r-- 1 yichya yichya 4980740 2月 13 23:04 openwrt-15.05-brcm63xx-smp-HG556a_C-squashfs-cfe.bin
-rw-rw-r-- 1 yichya yichya 3801088 2月 14 16:17 openwrt-15.05-brcm63xx-smp-root.squashfs
-rw-rw-r-- 1 yichya yichya 452 2月 14 16:17 sha256sums
其中 squashfs 文件是根文件系统的映像,而 bin 文件就是可以直接刷到路由器里面的固件了。
当然,这个固件的功能非常简单,简单到连 Web 界面都没有。想要设置只能通过 ssh 连接到路由,通过手动修改 /etc/config 下的配置文件完成对路由器的设置。

Get Started

上一步中我们定制的固件功能缺乏,以至于很难满足普通用户的正常使用需求。因此,我们需要增加固件中包含的软件包数量。
我们在 make info 的时候可以看到最上面的 Default Packages 和下面每一个 target 对应的 profile 中写明的 Packages。从配置文件中看,HG556a_C 中只包含了最基础的包、Ralink 无线网卡驱动、USB 支持和一个 LED 驱动,并不包括 Web 界面。
在我们这次的定制中,我们希望加上图形界面,然后再添加一些例如 U 盘支持、SFTP、动态 DNS 等的功能。于是我们选定所有需要的包:
  • wget
  • luci
  • block-mount
  • openssh-sftp-server
  • kmod-fs-vfat
  • kmod-fs-ext4
  • luci-app-ddns
然后,修改配置文件。配置文件的位置在 /target/linux/brcm63xx/profiles 目录下。在里面我们可以找到一个 huawei.mk 文件,跟我路由器相关的配置应该就在里面了。
打开 huawei.mk,果然找到了 HG556a_C 的配置:
defineProfile/HG556a_C
NAME:=Huawei EchoLife HG556a (version C - Ralink)
PACKAGES:=kmod-rt2800-pci wpad-mini \
kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
endef
defineProfile/HG556a_C/Description
PackagesetoptimizedforHuaweiHG556aversionC(Ralink).
endef
$(eval$(callProfile,HG556a_C))
只要在中间的 PACKAGES 节中增加我们需要的包就可以了。在这里我们无需人工处理依赖,Imagebuilder 会自动帮我们完成依赖相关的工作。
修改成下面这样:
defineProfile/HG556a_C
NAME:=Huawei EchoLife HG556a (version C - Ralink)
# PACKAGES:=kmod-rt2800-pci wpad-mini \
# kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
PACKAGES:= kmod-rt2800-pci wpad-mini kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev wget luci block-mount openssh-sftp-server kmod-fs-vfat kmod-fs-ext4 luci-app-ddns
endef
defineProfile/HG556a_C/Description
PackagesetoptimizedforHuaweiHG556aversionC(Ralink).
endef
$(eval$(callProfile,HG556a_C))
保存,然后回到主目录,生成映像:
$ make image PROFILE="HG556a_C"
很快就得到了一个我们定制好的映像。

Add repositories from blocked sources

准备透明代理则稍微复杂了那么一点儿。参考来自 https://cokebar.info/archives/664的教程,我们需要再安装以下几个包:
  • ip
  • ipset
  • libopenssl
  • iptables-mod-tproxy
以及来自第三方的
  • shadowsocks-libev-spec
  • ChinaDNS
  • luci-app-shadowsocks
  • luci-app-chinadns
将上面几个软件包添加到 target profile 中就可以实现自动安装了。
不过,麻烦的事情在于,第三方的源是直接被 GFW 拉黑的 sourceforge。
在 repositories.conf 中添加以下两个源:
# ShadowSocks
src/gz openwrt_dist http://openwrt-dist.sourceforge.net/releases/brcm63xx/packages
src/gz openwrt_dist_luci http://openwrt-dist.sourceforge.net/releases/luci/packages
直接 make image 的话,在从上面两个源更新列表时会卡住很久,不得不按 Ctrl + C 终止。
Downloading http://openwrt-dist.sourceforge.net/releases/brcm63xx/packages/Packages.gz.
^CMakefile:100: recipe for target '_call_image' failed
make[1]: ***[_call_image] Interrupt
Makefile:178: recipe for target 'image' failed
make: ***[image] 中断
在这里为了解决在终端下使用代理的问题,我们需要使用一个叫做 proxychains 的工具,它可以支持 SOCKS5 全局代理。
安装 proxychains:
sudo apt-get install proxychains
修改 proxychains 的配置文件 /etc/proxychains.conf
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode

[ProxyList]
socks5 127.0.0.1 1080
然后在 make image 时使用这样的命令:
$ proxychains make image PROFILE="HG556a_C"

Configure Transparent Proxy

制作好了能够完成透明代理的固件,我们还需要进行一些配置,才能顺利的实现透明代理。

Enable ShadowSocks

在服务页面中选择 ShadowSocks,填写好基本配置。

Enable ChinaDNS

ChinaDNS 的配置有以下几种可选方案:
  • 直接在墙外的远程主机上搭建 DNS 缓存服务器,使用其他的端口。
  • 利用 ShadowSocks 转发 UDP 53 端口。
  • 直接连接到外部 DNS 服务器,在 DNS 查询时不利用 ShadowSocks。
  • 利用 TCP 方式完成 DNS 查询。
对于各种方式的优缺点,引用原文:
前两种方案可以有效避免 GFW 造成的 DNS 污染,此时 ChinaDNS 的作用完全就是为国外站点做解析优化,因为 DNS 查询由代理服务器转发,DNS 查询的发起者相当于代理服务器,获得的解析结果都是就近于代理服务器的;
而方案三则会直面 DNS 污染,此时 ChinaDNS 的防污染功能发挥作用,同时方案三无法做到国外网站解析结果优化,因为获得的 IP 是就近于你的位置的。
方案四则可以有效的避免国外 DNS 的污染,不过同样也无法做到国外网站解析结果优化。
而且,方案四还有一个严重的问题:慢。
我的 ShadowSocks 服务器并没有搭建 DNS 缓存(我也搭不了,不是我的),但是支持 UDP 端口转发,因此,我们选择第二种方案。
在服务页面中选择 ShadowSocks,填写好 UDP 端口转发配置,将 UDP 5300 转发到 Google 公共 DNS 即可。

然后配置 ChinaDNS,设置上游 DNS 为一个国内 DNS 和我们转发的 DNS(即 127.0.0.1:5300)。Local Port 就是 ChinaDNS 提供服务的端口,这里默认 5353 即可。Bidirectional Filter 建议打开,可以减少受到 DNS 污染的几率,但是可能会减慢部分网站访问速度。

Configure DnsMasq

最后配置 dnsmasq 将所有的 DNS 请求转发给 ChinaDNS 的 5353 端口。

确定 ChinaDNS 和 ShadowSocks 都已经启动并正常工作,即可享受透明代理带来的愉悦啦。

Speed Test

我们利用国内外两个网速测试工具进行速度测试。
国内的网站可以自动识别到国内,不经过代理,不影响速度。

国外的网站自动通过代理访问,实现自动翻墙。

同时可以看到,整个过程中我并没有打开右上角的 SwitchyOmega 代理切换。
在使用中还会发现一点小问题:比如说访问京东的时候,网站就会认为我的请求来自国外,然后在页面顶端显示一个导航栏建议我到京东的国外站点购物,真是够了 233333
顺便预告一下:下一次介绍集成 ADBYBY 和 KMS 服务器,当然下一次我会换新买的 7620n SoC 的路由器来演示;之后我会以集成石像鬼 QoS 为例介绍一下 OpenWrt 的 BuildRoot.

问一句中国:你情何以堪?

$
0
0



·60年代人为的大饥荒,30万饥民逃港风起云涌,港府无法消化只好抓遣,但香港市民同情沿街乞讨的大陆饥民,先是慷慨施舍,后来组织救济,对抗军警抓捕,送衣送粮,藏人到家并介绍打工!
·89年大陆大抗议,香港人全城动员倾力援助,演艺界倾巢出动参加筹款义演,大陆人喜爱的邓丽君小姐也在场,头裹布条上写"民主万岁"上台,唱的是"在山的那一边",而那时成立的香港支持大陆民主联合会30年至今依然在运作。
·64后开枪引发大陆最大逃亡潮,香港黑白两道共组"黄雀行动",营救几乎全部大陆八九精英(北明是亲历人、受益者、见证人之一)。
·98年大陆洪灾29省市自治区受难,香港政府拨900万元初赈灾难,后全港政府民间演艺界和媒体总行动:出镜、上台、拍卖、义演,共捐往大陆6.8亿元,居全球援助之首。
·2008年中国南方遭受50年不遇暴风雪,波及21省市,香港民建联、自由党、中华总商会、中华厂商会、香港总商会、工业总会及多个中小企商会出钱出力,开放宿舍、提供膳食,令民工可留厂度岁;再有市民解囊、艺人再度登台义演,遂开通各种捐助渠道。仅香港赛马会就向香港红十字会中国赈灾基金捐出1000万港元。
·同年5.12汶川大地震,香港长达四年时间持续援助共84.31亿元人民币,援建项目涉及教育、医疗、社会福利事业等多个领域,项目总数达190个……。
·如今香港人面临"送中",遂和平示威,维护自己权益,反对修改条例而已,竟面临严酷镇压。置此危难时刻,听不见来自大陆的声援和呼声。盖因当局封锁消息,制造假象、控制舆论,牵制大脑,陷有香港同胞于悲惨境地,让他们从耄耋老人到几岁乳童,孤独地抗争。
北明问一句中国,作为多次受惠于香港的国家和你的人民,你情何以堪! ! !
2019年8月12日
(以上资讯全部属实,来源出处请翻墙搜索关键字)
-----------------------------
中国大陆对香港人是典型的“忘恩负义”。

林保華:保存香港年輕人的有生力量

$
0
0
在香港特首林鄭月娥北上見了習近平與韓正兩位中共頂層領導人後,體內的荷爾蒙迸發出來,暴力鎮壓大升級,警察連續攻打大學校園。其中香港中文大學與香港理工大學的校園先後變成了戰場,爆發徹夜的攻防戰。警方的理由是到裡面執法,到底執什麼法也說不清楚。如果說藏有匪類,也應該拿出證據;又說裡面有兵工廠,那更是駭人聽聞的事情,但也可以請校方先自行檢查。成為「廠」而校方不知,校長是否該打屁股?到執筆時,理工大學校園內包圍了許多人,警察似在表演「甕中捉鱉」,要大展警察的威風。
警察進攻校園,在世界上是罕有的事情,即使是獨裁國家,但是居然在香港發生了。「東方之珠」變成了「東方之豬」,這就是不忘初心的「一國兩制」?林鄭是雌心勃勃要創世界紀錄嗎?你系得嘅!
學校被稱為「黌宮」,是個傳道、授業、解惑的莊嚴所在;大學更是學術殿堂。警察隨意侵入這個地方,實在褻瀆象牙之塔,引起公憤是必然的,流氓政權的本質也更展現在世人面前。這些學校的學生,或者「兄弟學校」的學生那種被侮辱的感覺,已經不是「秀才遇到兵,有理說不清」了,而是被侮辱與踐踏。因此奮起抵抗是必然的,其他學校的學生前來相挺,甚至稍微懂得什麼是文明的市民也前來支援。中大的校長、副校長出來斡旋,不管是不是完全認同他們的觀念,至少是暫時緩和了局勢。港大校長原來不聞不問,在關鍵時候也被逼出來調解,警察最後也沒有進入校內。理大似乎不是這樣,學生被校長與警察欺騙,所以特別憤怒,衝突也更激烈。
由於最近衝突的焦點都在校園內,難免使人質疑,特區政府把衝突焦點放在大學,安得是什麼心?
香港首富李嘉誠不久前曾經說,香港年輕人是香港未來的主人翁,那麼香港的大學生更是未來主人翁的菁英分子。我老早就指出這次的鎮壓行動是要對香港人進行世代滅絕,現在選擇先從世代菁英下手就更明顯了。台灣人的世代菁英也在228屠殺中被消滅而出現斷層,對這個問題就看得更清楚了。這就是北京與香港特區政府的大陰謀。
因為有備而來,這次鎮壓,香港警方出動了許多新式武器,除了稍早時候使用中國製造的催淚彈,因為更具毒性不但是當事人受創更重,而且毒害這個時代的香港居民而留下後遺症。而進攻理工大學的戰役,不但出動兩架水砲車,還出動裝甲車,甚至首次出動「聲波砲」(Sonic Guns),可讓示威者耳膜劇痛或暈眩;據香港網路媒體SocREC社會記錄頻道發佈的影片顯示,港警還使用爆震彈(Stun Grenade),爆震彈在擲出後,發出強烈的閃光和高達180分貝的巨響,使人員在半小時內暫時失去聽覺、視覺。
現在國際社會還沒有完全認清中共的邪惡,或因為其他原因繼續姑息。在這個情況下,香港年輕人必須保存有生力量,避免不必要的損失與犧牲。因為既然中共在佈局,我們就應該避免掉入陷阱。因此盡量還是採取以前行之有效的流水式游擊戰。應該是我們去調動對手,而不要讓對手調動我們。固然我們的手足掉入對方手裡受到凌虐讓我們很心痛,但是我們應該進行外圍的救助行動,而不是一起進入陣地同對方展開裝備極不對稱的陣地戰。
未來的世界還會有許多變化,我們的手足即使被關上10年、8年,就算被送上中國受難,有幸活下來,或者還是年富力強,可是那時習近平、林鄭一隻腳已經進入棺材了,甚至可能已經嗚呼哀哉。那時裡裡外外的香港手足還有機會重建新香港。反之,如果太多人聚集在一起被一網打盡,留下來堅持鬥爭的就大為削弱,不符合相關未來的長遠利益。
在堅持游擊戰的時候,我們的隊伍也應該分為多個區塊鏈,部分還在面上堅持,部分轉入地下,擴大地下隊伍,以應對中共的地下化。香港無法畢其功於一役,因此一定要比賽韌力與意志力。

陶杰:中国的幻觉

$
0
0


去过台湾,就会觉得台湾人已经不再是什么「中国人」──当「中国人」的定义,根据当前政治正确的潮流,专指「在中华人民共和国出生长大的华人」。

台湾有一股很浓的人情味。即使酒店的一个收拾客房的女工,都很有礼貌,她会常常真诚地对客人说:「抱歉」、「路要当心走噢」。客人带孩子,她会开心地逗逗他:「好乖唷」,脸上绽开一朵朴拙的微笑,那个笑容,她的笑容,不是根据跨国酒店业的瑞士行政总裁的人事手册训练出来的空姐式的专业笑容,令人想起一九四八年南京一座大宅里的一个老仆人,还加上一点点昭和年代榻榻米间的一个阿巴桑。

台湾的公函,正体、直排,行文很古雅,尊称「陈总经理志明先生」、「李厂长国强先生」,末端署吁「行政院用笺」之类的朱砂公印。

台湾人提出请求,说「拜托」,问到阁下的家长,尊称「老太爷」,问到你的儿女,还称「令郎」、「令千金」什么的。这些用语:劳驾、拜托、抱歉、老太爷、嫂夫人之类,是'大陆的中文‘吗?不是,因为这一套绝不是中华人民共和国的常用语文。

去台湾,才发现台湾的老一辈人士──通常是外省人──仍在使用一套死去的旧中文。严格来说,中华人民共和国是中国的唯一代表,因此,「繁体字」不是中文。

「老子」怎样,「臭娘们」如何,妈个B,顶你个肺之类,真正的中文,以电影《疯狂的石头》为经,以台湾以外的华文报刊的常用语为纬:像「打造平台」、「工程配套」、「开发景点」、「建设上马」等等。台湾令人觉得陌生。

台湾人的书面文字和生活礼仪,民国年代的儒家涵养加日治时期的谨恭和谐。台湾人整天叫嚷「去中国化」,是很多余的。即使自称中国,台海的两岸,哪一个中国是优雅的中国,哪一个是伪劣的中国,已经令人没有兴趣再争论。

眼前的现实是:总之「中国」不是善良和优雅的代名词。联合国承认的中国并不是台湾,外国人学「中文」,不,汉语,不必学「台端」、「阁下」、「老太爷」这类词汇,正如今天住在美国不必讲拉丁文。

台湾使用的所谓中文,是一种「前中国」的中文,他们的人情味和礼仪,与中国没有关系,而马英九,一脸的端庄正气,他有半点中国人的味道吗?没有。赖昌星、周正毅、葛优,以及迪士尼园的自由行,才是中国人的真风格/真面孔。

台湾没有问题,中国也没有问题,时空倒错的幻觉,有如把人看成了猿猴,或把猿猴看成了人,这才是问题。 

Crosstool-NG

$
0
0
A versatile cross-toolchain generator.

Introduction

Crosstool-NG aims at building toolchains. Toolchains are an essential component in a software development project. It will compile, assemble and link the code that is being developed. Some pieces of the toolchain will eventually end up in the resulting binaries: static libraries are but an example.
Before reporting a bug, please read bug reporting guidelines. Bugs that do not provide the required information will be closed without explanation.
Refer to documentation at crosstool-NG website for more information on how to configure, install and use crosstool-NG.
Note 1: If you elect to build a uClibc-based toolchain, you will have to prepare a config file for uClibc with <= crosstool-NG-1.21.0. In >= crosstool-NG-1.22.0 you only need to prepare a config file for uClibc(or uClibc-ng) if you really need a custom config for uClibc.
Note 2: If you call ct-ng --help you will get help for make(2). This is because ct-ng is in fact a make(2) script. There is no clean workaround for this.

Repository layout

To clone the crosstool-NG repository:
git clone https://github.com/crosstool-ng/crosstool-ng

Old repositories

These are the old Mercurial repositories. They are now read-only: http://crosstool-ng.org/hg/

Pull Requests and Issues

You can find open Pull Requests on GitHub here and you can find open issues here.

Contributing

To contribute to crosstool-NG it is helpful to provide as much information as you can about your change, including any updates to documentation (if appropriate), and test... test... test.
git clone https://github.com/crosstool-ng/crosstool-ng
  • Create a topic branch for your work
git checkout -b fix_comment_typo
  • Make changes
  • hack
  • test
  • hack
  • etc...
  • Add your changes
git add [file(s) that changed, add -p if you want to be more specific]
  • Verify you are happy with your changes to be commited
git diff --cached
  • Commit changes
git commit -s
The -s automatically adds your Signed-off-by: [name] to your commit message. Your commit will be rejected without this.
Also, please explain what your change does. "Fix stuff" will be rejected. For examples of good commit messages, read the changelog.
  • Push your topic branch with your changes to your fork
git push origin fix_comment_typo
  • Go to the crosstool-ng project and click the Compare & pull request button for the branch you want to open a pull request with.
  • Review the pull request changes, and verify that you are opening a pull request for the appropriate branch. The title and message should reflect the nature/theme of the changes in the PR, say the title is Fix comment typos and the message details any specifics you can provide.
  • You might change the crosstool-ng branch, if you are opening a pull request that is intended for a different branch. For example, when you created your topic branch you could have done:
git checkout -b fix_out_of_date_patch origin/1.22
Then when you get to this pull request screen change the base branch from master to 1.22
  • By creating a pull request, the PR is entered into the backlog. A travis-ci job will run to test your changes against a select set of samples. As they start to get worked, they should be placed in the Ready state. PRs that are being worked are In Progress. If a questions come up about the commit that might envolve changes to the commit then the PR is placed in Waiting For Response, you have two options:
  1. Fix the issue with the commit by adding a new commit in the topic branch that fixes the code review. Then push your changes to your branch. This option keeps the comments in the PR, and allows for further code review. I personally dislike this, because people are lazy and fix reviews with fix more review issues. Please make good commit messages! All rules about commits from above apply! THIS IS PREFERED
Add your changes
git add [file(s) that changed, add -p if you want to be more specific]
Verify you are happy with your changes to be commited
git diff --cached
Commit changes
git commit -s
  • Push your topic branch with your changes to your fork
git push origin fix_comment_typo
At this point the PR will be updated to have the latest commit to that branch, and can be subsequently reviewed.
  1. Interactively rebase the offending commit(s) to fix the code review. This option is slightly annoying on Github, as the comments are stored with the commits, and are hidden when new commits replace the old commits. They used to disappear completely; now Github shows a grey 'View outdated' link next to the old commits.
This recipe also comes handy with other issues, like your topic branch not being up-to-date with master:
git fetch --all
git rebase --ignore-whitespace origin master
git rebase -i ^
NOTE: The --ignore-whitespace stops git apply (which is called by rebase) from changing any whitespace when it runs.
Replace pick with edit or remove the line to delete a commit. Fix the issue in the code review.
git add [file(s)]
git rebase --continue

git push --force origin fix_comment_typo

Patchwork

We previously used patchwork for development, but it is no longer used. I'd like to see patches that are still applicable turned into Pull Requests on GitHub.
You can find the list of pending patches available on patchwork.

More Info

You can find all of this and more at crosstool-ng.org
Report issues at the project site on GitHub.
We have a mailing list. Archive and subscription info can be found here: https://sourceware.org/ml/crossgcc/

from https://github.com/crosstool-ng/crosstool-ng
------

git clone https://github.com/crosstool-ng/crosstool-ng.git
cdcrosstool-ng
git checkout tags/crosstool-ng-1.21.0
./bootstrap
./configure
make
makeinstall
-----------------------

相关帖子:https://briteming.blogspot.com/2019/11/crosstool-ng.html

FFmpeg static

$
0
0
Scripts to build ffmpeg with all the deps statically (webm + h264 included)。
STATUS: community-supported
Three scripts to make a static build of ffmpeg with all the latest codecs (webm + h264).
Just follow the instructions below. Once you have the build dependencies, run ./build.sh, wait and you should get the ffmpeg binary in target/bin

Build dependencies

# Debian & Ubuntu
$ apt-get install build-essential curl tar libass-dev libtheora-dev libvorbis-dev libtool cmake automake autoconf

# OS X
# 1. install XCode
# 2. install XCode command line tools
# 3. install homebrew
# brew install openssl frei0r sdl2

Build & "install"

$ ./build.sh [-j ] [-B] [-d]
# ... wait ...
# binaries can be found in ./target/bin/
Ubuntu users can download dependencies and and install in one command:
$ sudo ./build-ubuntu.sh
If you have built ffmpeg before with build.sh, the default behaviour is to keep the previous configuration. If you would like to reconfigure and rebuild all packages, use the -B flag. -d flag will only download and unpack the dependencies but not build.
NOTE: If you're going to use the h264 presets, make sure to copy them along the binaries. For ease, you can put them in your home folder like this:
$ mkdir ~/.ffmpeg
$ cp ./target/share/ffmpeg/*.ffpreset ~/.ffmpeg

Build in docker

$ docker build -t ffmpeg-static .
$ docker run -it ffmpeg-static
$ ./build.sh [-j ] [-B] [-d]
The binaries will be created in /ffmpeg-static/bin directory. Method of getting them out of the Docker container is up to you. /ffmpeg-static is a Docker volume.

Debug

On the top-level of the project, run:
$ . env.source
You can then enter the source folders and make the compilation yourself
$ cd build/ffmpeg-*
$ ./configure --prefix=$TARGET_DIR #...
# ...

Remaining links

I'm not sure it's a good idea to statically link those, but it probably means the executable won't work across distributions or even across releases.
# On Ubuntu 10.04:
$ ldd ./target/bin/ffmpeg
not a dynamic executable

# on OSX 10.6.4:
$ otool -L ffmpeg
ffmpeg:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

Community, bugs and reports

This repository is community-supported. If you make a useful PR then you will be added as a contributor to the repo. All changes are assumed to be licensed under the same license as the project (ISC).
As a contributor you can do whatever you want. Help maintain the scripts, upgrade dependencies and merge other people's PRs. Just be responsible and make an issue if you want to introduce bigger changes so we can discuss them beforehand.

TODO

  • Add some tests to check that video output is correctly generated this would help upgrading the package without too much work
  • OSX's xvidcore does not detect yasm correctly
  • remove remaining libs (?)

Related projects

from https://github.com/zimbatm/ffmpeg-static
------

Scripts to build ffmpeg with all the deps statically (webm + h264 included).

FFmpeg static build

Three scripts to make a static build of ffmpeg with all the latest codecs (webm + h264).
Just follow the instructions below. Once you have the build dependencies, just run ./build.sh, wait and you should get the ffmpeg binary in target/bin
这个和原版的不同之处是加了--enable-librtmp, 因为在c**fuck项目中需要用到rtmps

What's New

12/11/2015
  • 更新各libs的新版下载链接,ffmpeg最近版本到了2.8.3,链接改成了从git server下的
  • 增加x265
  • x11grab现在改成用xcb的了

Build dependencies

# Debian & Ubuntu
$ apt-get install build-essential curl tar

# OS X
# install XCode, it can be found at http://developer.apple.com/
# (apple login needed)
#

Build & "install"

$ ./build.sh or build-ubuntu.sh
# ... wait ...
# binaries can be found in ./target/bin/
NOTE: If you're going to use the h264 presets, make sure to copy them along the binaries. For ease, you can put them in your home folder like this:
$ mkdir ~/.ffmpeg
$ cp ./target/share/ffmpeg/*.ffpreset ~/.ffmpeg

Debug

On the top-level of the project, run:
$ . env.source
You can then enter the source folders and make the compilation yourself
$ cd build/ffmpeg-*
$ ./configure --prefix=$TARGET_DIR #...
# ...

Remaining links

I'm not sure it's a good idea to statically link those, but it probably means the executable won't work across distributions or even across releases.
# On Ubuntu 10.04:
$ ldd ./target/bin/ffmpeg
not a dynamic executable

# on OSX 10.6.4:
$ otool -L ffmpeg
ffmpeg:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) 
 
 from https://github.com/oglops/ffmpeg-static

FitVids.js

linux桌面系统上的图片相关工具

$
0
0
  • 截图工具Shutter
    1
    yum install shutter
     
  • 拼贴图工具 PhotoCollage
    1
    2
    3
    4
    5
    yum install python34 python34-setuptools python-distutils-extra
    easy_install pip
     
    # 然后
    pip3 install photocollage
     
  • 转图片工具 XnViewMP 

  • 转gif工具 gifsicle
  •  
  • 离线网站工具,ui好土 httrack
    1
    yum install httrack httraqt
     
  • 相当于windows画图的小工具pinta

  • 相当于photoshop / painter 的 krita

persistent process supervision,持久进程监视工具- perp

$
0
0
在linux vps上。
wget http://b0llix.net/perp/distfiles/perp-2.07.tar.gz
tar xvf perp-2.07.tar.gz

http://b0llix.net/perp/site.cgi?page=README
http://b0llix.net/perp/site.cgi?page=download
http://b0llix.net/perp/site.cgi?page=INSTALL
http://b0llix.net/perp/site.cgi?page=manual

 

一款牛逼的远程桌面软件-HP的Remote Graphics Software7.1

$
0
0
有很多远程控制的大牌软件,比如常用的VNC,teamviewer,或者M$自己的remote desktop,(不要告诉我你用qq的远程协助,那真是土的掉渣了),那这个Remote Graphics Software牛逼在何处呢?用人话说就是它能让你遥控另一台机器远程用Maya Max Houdini而且不卡,你用其他任何一个软件都会遇到画面更新缓慢(顿)的问题,而RGS号称他完全不会,因为他”采用HP Lab专利的HP3编解码技术,170:1的压缩比不仅节约网络带宽,而且能实现高清以及3D OpenGL图像数据的传输”。

远程桌面软件其实并不少,当然他不是最nb的,他依然只是把远端机器的画面传过来而已,不是让你直接利用远端机器的硬件(比如硬件解决方案teradici),他的意义在于成本低廉,安装简单,装个软件就完事,其特色功能还有Remote Audio和Remote USB,

现在rgs7.1支持到RHEL7和win8.1,在HP的z系列工作站上是免费的.
应用场景:
  • 你是管渲染农场的,有个文件在本机没问题,发到渲染机就跳,怎么也找不到原因在哪,vnc连去渲染机开houdini查错,但是操作巨卡…
  • 你是个TD,有动画师坐在另一层(栋)楼,让你给他的文件解决个问题,你的工具什么的都在你的机器上,不想老远跑过去,万一需要个什么又得跑回来(此时神器tmux也能登场),用vnc又巨卡
  • 其实他的本意是让在拍片现场的supe拿着ipad或者笔记本,能轻松连回公(xue)司(han)总(gong)部(chang)查看各种资源 ( 在此为dneg最近裁掉的同事们默哀下,唉….)
下面就来在Linux和Windows上试试:
  • 安装就不说了吧,如果你连安装都不会,那你还是别玩了
  • 说下三种登录方式的区别
    • Standard authentication – 支持win和linux的 RGS Sender.
    • Easy Login – 支持win和linux的 RGS Sender.
    • Single Sign-on – 支持win的 RGS Sender.
    下面来用白话文说下,你面前正在用的机器装receiver,你想遥控的远处的机器装sender(顾名思义,他要把画面send过来嘛),receiver是免费的,sender是要买然后加license的,不然你画面正中会永远飘着一个提醒你去买的窗口.
    三种登录方式不同之处:
    • Standard authentication – 你在机器A(receiver)上说我要连机器B(Sender),你需要在A上输入B的名字,然后输用户名密码,

      • 如果B上有人登录了,机器B上会弹出窗口提示说有人要连他,B的用户按了确定,你才能连到B
      • 如果B上没人登录,是锁定状态,你在A上会看到登录窗口,你自己来登录
    • Easy Login – 在A上不会让你输账号密码,他会先连去B,然后你在B上登录即可,只要一次就行
    • Single Sign-on – 在A上会让你输账号密码,连到B以后就不会问你账号密码了,只要一次就行
    好像很晕,用哪个好呢,一般是win和lin都想要,而Easy Login支持的验证多些,那就用这个好了
    linux上还需要一些packages,不然他自动启动不了,而且运行/opt/hpremote/rgsender/rgsender.sh任何提示都没有
    1
    yum install libpng12
    装好后可以如此验证他开没开(lz找了半天右下角的眼睛图标……之前公司里都有的,结果后来发现是新版的软件linux下不支持那个图标了,user manual里写了)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # 看看他随x启动了么
    [root@localhost oglop]# cat /var/log/Xorg.0.log | grep rgs
    [    27.941] (RG) 04:14:24.084 Listening for RG connections at /var/opt/hpremote/rgsender/sockets/rgsender-rge:0
    [    27.969] (RG) 04:14:24.112 Started rgsender process PID = 2454
    [    30.865] (RG) 04:14:27.008 Established connection with rgsender
    # 进程里有的
    [root@localhost oglop]# ps aux | grep rgs
    root      2454  0.0  2.3 950756 17464 tty1     Sl+  04:14   0:00 ./rgsender -daemon -display 0 -l /etc/opt/hpremote/rgsender/logSetup
    root     25911  0.0  0.1 112640   960 pts/1    R+   04:23   0:00 grep --color=auto rgs
    他似乎没有带删除的script,如果想删,其实就只有这两个需要删
    1
    2
    3
    4
    5
    6
    [root@localhost oglop]# rpm -aq | grep rgs
    rgsender_config_64-7.1.0.5856-1.x86_64
    rgsender_linux_64-7.1.0.5856-1.x86_64
    # 能用yum尽量用yum
    yum remove rgsender_config_64 rgsender_linux_64
    linux下的配置文件在/etc/opt/hpremote/rgsender/rgsenderconfig
    默认的standard authentication的时候,lz用sender上的账号登录不了,不知何故,后来试了下easy login,可以登录,前者的原因没有详查.
按理说linux上的sender没注册应该有个框的,但是这里没有,好奇怪,/etc/opt/hpremote/rgsender/Preload.lic里也只是说了z系列的工作站可以免费用
和其他软件或解决方案的对比视频:
HP Remote Graphics Software vs. Citrix Receiver on a tablet
HP RGS 7 vs. Teradici PCoIP Remote Workstation card (Tera2)
参考:
[SOLVED] How to define custom hosts in tomato?
Show All Running Processes in Linux

Linux桌面系统下,如何简便的录屏幕为GIF 文件

$
0
0
需要的工具有
  1. 编译时候带 –enable-x11grab 的ffmpeg,如何知道带没带可以直接运行ffmpeg,然后
    如果你从repo里装的ffmpeg的没有带这个argument,那你可以自己编译一个。
  2. 需要有imagemagick
  3. lolilolicon大神编的FFcast script, 有原版(需要bash>4.3),和chilicuil修改版(不需要bash>4.3)因为我这里是CentOS 6.5,比较老,没有bash 4.3,所以我这里用chilicuil大神的
    1
    2
    3
    4
    5
    git clone https://github.com/minos-org/ffcast.git
    cdffcast
    make
    # 你可以随便“装”个地方先,之后再拷去别的地方,或者你直接prefix=$HOME/.local也可以
    makeinstallDESTDIR=$HOME/tools
  4. imgur网站有很多上传工具和script,比如这个Bart’s Bash Script Uploader
  5. xsel 或者 xclip
综上,你可以自己拼一个script
1
2
3
4
5
6
#!/bin/bash
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
TMP_GIF=$(mktemp /tmp/outXXXXXXXXXX.gif)
ffcast -s ffmpeg -y -r 15 $TMP_AVI \
&& convert -setdelay 10 -layers Optimize $TMP_AVI $TMP_GIF \
&& ~/.local/bin/imgurbash.sh $TMP_GIF
其中-set delay 10 是慢放用的
为了达到“连放”效果,lz还特意去找ffmpeg accurate seeking的说明,试了老半天 ..
edit: lz又重录了一段,遗憾的是”连放效果”不好…orz
1
ffmpeg -i out.avi -ss 00:00:03.20 -t 00:00:00.55 -vcodec copy out_1.avi -y ; convert -loop 0 -layers Optimize out_1.avi out.gif ; ~/.local/bin/imgurbash.sh out.gif
之后你就有了…

edit:又改了下,因为imgur上传gif最大只能2MB,这里试着用gifsicle把他压小些,因为不知道如何指定说我就要最大2MB,请自动酌情降低质量要怎么写,如果实在太大,重录把… 反正问PyQT问题一般也就录几秒
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
TMP_GIF=$(mktemp /tmp/outXXXXXXXXXX.gif)
ffcast -s ffmpeg -y -r 15 $TMP_AVI \
&& convert -setdelay 10 -layers Optimize $TMP_AVI $TMP_GIF
 
maxsize=2048
actualsize=$(du-k "$TMP_GIF"| cut-f 1)
if[ $actualsize -ge$maxsize ]
then
    TMP_GIF2=$(mktemp /tmp/outXXXXXXXXXX.gif)
    gifsicle -O2 --colors 64 $TMP_GIF  > $TMP_GIF2
fi
 
~/.local/bin/imgurbash.sh $TMP_GIF
edit2: 在家里的centos7上又半自动了下
然后在~/.bashrc里加了两个alias
1
2
aliasrecord='~/scripts/gif-batch.sh -r'
aliasupload='~/scripts/gif-batch.sh -u'
所以之后只要运行 record 就可以录,运行 upload 就可以上传了
edit3: 又给改进了下,在这里,加了上传到 gfycat和可以指定文件名
edit 4: 又改了下,现在去掉了imgur,因为逼格太低,换成了gfycat,lz知道有很多垃圾在里面,但是还没定型,lz也不知道最后想要什么效果
有几处疑问如下:
  1.  似乎在家里的centos7上用 -vcodec libx264,然后再convert转gif比较清楚,但是公司里convert非常之慢,似乎ffmpeg直接录成gif比较清楚
  2. 现在的json parse法比较弱智,也许用jq比较好,或者干脆把script写成python的,但是lz想先试试bash
ps:这个script的折腾只是为了方便的录成gif然后上传,如果你只是要录桌面,那直接用ffcast就可以了,比如
1
2
3
4
5
# 录指定窗口 用libx264
ffcast -w ffmpeg -y -r 20 -vcodec libx264 xxx.mov
 
# 录指定区域,用拖拽框选设定
ffcast -s ffmpeg -y -r 20 -vcodec huffyuv x.avi
pss: 公司似乎用不了libx264或是huffyuv,此时可以加上-b:v 16384k 让录的avi质量高些
psss: 录了个5m44s的demo,原avi 115.7MB,转gif后5.1MB

demo已上传至gfycat,点这里观看 … 似乎gfycat把他压成了1MB
pssss:
发现convert的时候很卡,开始试了加-limit area 512MiB 没什么效果,设下面两个环境变量似乎有效果
1
2
export MAGICK_THREAD_LIMIT=2
export MAGICK_THROTTLE=50
但是设置过后转换就慢到无法结束了,有人建议编译的时候–disable-openmp,不过经试验,设置MAGICK_AREA_LIMIT为一个较小的数可能有用比如0(强制cache到disk)
1
export MAGICK_AREA_LIMIT=100
最新版我就不继续贴这里了,在github的gist上有。
参考:
GIF screencasting; the UNIX way
imgur upload tools

年代向錢看 川普、習近平角力!港警追殺中文大學、理工大學!水炮車、聲波炮、戴奧辛催淚彈攻擊學生!中國002新航母挑釁台海

中共鎮壓香港的思路

$
0
0
香港,是中美兩大勢力的交疊區,也是中美鬥爭的前線。也因此,香港抗爭從一開始就是國際議題,這是由於香港的特殊地位使然。
香港抗爭者努力將抗爭國際化是因為他們除了美國之外再也沒有任何可以與中共對抗的幫手,唯有將自己化身為大國政治博弈的籌碼,才能有活路。
這正正是與中共利益相反的走向。
中國金融極度依賴香港。根據香港金融分析員六子山指出的兩組數據:
中國的外資投資(Foreign Direct Investment, FDI),2018年的總數約$1,300億美元,當中有超過七成的資金來源是香港,即超過900億美元。
香港認可金融機構的貸款總數,至今年四月時約為100,000億港元,當中有30,000億(3,850億美元)是境外貸款。境外貸款說到底大部份都是借給中国。
如六子山所說,只是把兩條數粗略加起來,已經有5,000億美元,還未計中國企業在香港債市股市集資的數目。只要美國等西方國家不承認香港的國際金融中心地位,中國幾十萬億美元即時見財化水,然後中國的金融市場立刻失去資金供應,接下來的經濟衰退將隨即拖垮中國。
可知中共不可能使用強硬手段毀滅香港的國際金融中心地位。
中共在對美貿易戰的情況下,應付即將到來的金融危機已經焦頭爛額,這是中共面臨最迫切的事。
在這種情況下,香港抗爭國際化,正正在最有影響力的時間點把中共最忍受不了的損失暴露出來,任由美國為首的西方國家攻擊或勒索中共。中共要鎮壓香港,就必須在減低金融衝擊的前提下,用盡辦法將香港抗爭國內化:
與美國達成協議,確保金融不受衝擊,或尋求由國際市場提供融資以紓緩中共的金融危機壓力;
軍事上和輿論上盡力排除西方國家對香港的影響;
聯合塔利班、朝鮮、俄羅斯等國際反美勢力,請他們支持中共鎮壓香港;
將鎮壓部隊偽裝成香港本地人或者香港警察,使得鎮壓香港的表面責任不在中共;
動員全國宣傳機器,抹黑香港抗爭是「港獨」、「顏色革命」、「外國勢力干涉」,以鼓動全国民族主義情緒,轉化即將到來的金融危機的壓力;
在世界各地動員海外中文媒體和海外華人團體發表反對香港示威的聲明與報導,以圖抵銷香港抗爭國際化的影響,干擾西方民主國家的民意;
製作大量的假新聞,甚至以苦肉計炮製香港示威暴力的形象,並透過微信、微博、牆內搜索引擎等,影響香港、澳門、台灣、海外華人當中依賴中國資訊來源的民眾;
僱用香港黑社會甚至非廣東省民眾(主要是福建省)到香港襲擊一般市民,以製造恐怖氣氛;
透過商界、企業主去威脅解僱他們的僱員,以製造恐怖氣氛;
定性香港「出現恐怖主義苗頭」,以準備滿足《香港駐軍法》第六條的出兵條件,並在深圳公開集結解放軍或武警部隊,文攻武嚇,以製造恐怖氣氛。香港抗爭國際化,正正在最有影響力的時間點把中共最忍受不了的損失暴露出來。(湯森路透)
在此補充,《香港駐軍法》第六條:「全國人民代表大會常務委員會決定宣布戰爭狀態或者因香港特別行政區內發生香港特別行政區政府不能控制的危及國家統一或者安全的動亂而決定香港特別行政區進入緊急狀態時,香港駐軍根據中央人民政府決定在香港特別行政區實施的全國性法律的規定履行職責。」
一旦香港抗爭被中共成功國內化,西方國家基於外交立場上的尷尬而退卻,那麼香港抗爭者乃至香港市民將失去來自西方國家的支援力量,到時香港立法會會通過立法措施將香港同化,於是就可以將美國等西方勢力從香港驅逐出去。只要西方國家無法透過香港議題來制裁中國,那麼中共在香港的統治成本也將大大降低,並可以繼續壓榨香港。
台灣讀者請特別注意「超限戰」的概念,因為從中共來看,他們已經對全球(包括台灣和美國)發動超限戰很多年了。他們自知單從軍事技術上無法打贏台灣海峽登陸戰,他們就要從台灣社會內部奪取台灣的控制權。今日香港是中共的練兵場,他日就要把香港經驗用在台灣身上。請支援香港抗爭,在香港抵擋中共,以免戰火燒進台灣。(為了對中共「敬而遠之」,作者以中共的簡化漢字來稱呼他們的機構)
※作者為香港中學教師

ESXI(6.0-6.7)下部署iKuai主路由,提供宽带叠加/流控+OpenWrt/LEDE负责翻墙等扩展,双软路由并肩作战

$
0
0
ESXI中安装两个软路由,一个负责宽带叠加、流控分流,另一个负出国留学、去广告、接AP等扩展,相互弥补各自的不足之处,让我们的网络环境得到最大的优化.


一、在esxi主界面下配置网络的IP地址

1.在主界面下按F2输入密码进入,找到Configure Management Network这个选项


2.然后进入IPv4 Configuration这个选项,在里面按空格选择最后的选项自定义IP地址及网关

①ip地址设置为:10.10.10.111(可以自定,搞不清楚的就按我的这个设定)

②子网掩码设置为:255.255.255.0

③网关设置为:10.10.10.10

二、在电脑上把电脑的IP设置为10.10.10.100,子网掩码设置为255.255.255.0,网关设置为10.10.10.10



三、进入esxi后台界面进行网卡的配置,esxi后台地址就是我们前面设置的ip地址,10.10.10.111


1.选择网络》虚拟交换机》添加标准虚拟交换机,有几个网口就填加几个交换机,我这里有六个网口,系统已经默认为我们添加一个网口了,我这边需要在添加五个,一共就是六个(注:安全里面的三个选项都要设置为接受)


2.选择网络》端口组》添加端口组,同样把我们六个虚拟交换机添加上


四、安装及爱快软路由


1.进入爱快官网www.ikuai8.com下载固件

2.在esxi后台,存储》选择你的硬盘》数据浏览器》新建一个目录,把下载好的爱快iso固件上传进去

3.创建爱快的虚拟机


4.配置虚拟机,CPU内存自定义,硬盘默认8G就可以了,在添加一个网卡,让爱快有两个网卡,一个做LAN,一个做WAN,由于我的网口比较多有六个,为了方便区分,我就把第一个设为LAN口,第六个设为WAN口,然后cd驱动器那里选择我们之前上传的爱快iso的固件即可,然后就可以启动虚拟机了,按照提示进行安装就可以了。


5.安装好后,在控制台选择2,将LAN的地址设置为10.10.10.10,这样我们就可以通过这个IP地址进入爱快后台界面了


6.进入爱快后台绑定WAN口,默认后台账号密码为admin,在网络设置》内外网设置》选择WAN口绑定没有绑定的那个网口,也就是我们在esxi绑定的第六个网口,因为第一个网口已经默认是LAN口了,绑定完成后,我们切换协议为ADSL/pppoe 进行拨号,就可以联网了。


7.设置爱快的DHCP服务,进入网络设置》DHCP设置》DHCP服务端,添加一条DHCP服务端,网络接口就选择我们的lan1,客户端地址填写10.10.10.100-10.10.10.200(懂的可以自行修改,不懂的就照着填就OK),子网掩码255.255.255.0,网关10.10.10.11(这个网关就是我们需要设置的LEDE路由器的IP地址),DNS就填拨号上网后出现的运营商提供的DNS即可(可以到拨号那里查看)


四、安装及配置LEDE软路由


1.进入koolshare官网koolshare.cn下载最新固件

2.将下载下来的固件解压后,用StarWind Converter软件转为为esxi专用文件

3.在esxi后台,存储》选择你的硬盘》数据浏览器》新建一个目录,把转换好的两个文件都要上传进入后,会自动合并为一个文件

4.创建LEDE的虚拟机


5.配置虚拟机,CPU内存自定义,默认硬盘删除,添加一块现有硬盘,选择我们之前上传的lede固件,网卡除了默认的第一个外,我们在添加四个,一共组成五个网卡,第六个就不用了,它已经在爱快里面做WAN口了,我们就不需要添加了,然后保存,启动虚拟机就可以了。


6.启动好后,在控制台按回车,输入以下命令:

vi /etc/config/network

按'i'建进入编辑状态,把option ipaddr里面的地址改为10.10.10.11,按esc键退出,输入:wq保存退出,在输入以下命令重启:

reboot


7.进入lede后台,在接口处把我们设置在虚拟机里面的四个网口都设置为lan口,然后可以把默认那两个碍眼的wan口删除,然后修改网关为10.10.10.10(这里的网关就是爱快主路由的地址),DNS还是设置为我们拨号上网后运营商提供的NDS,这样设置完,我们就使用了双路由共同作战咯。


五、需要到的固件及工具不想自行到官网下载的,可以在这里下载

谷歌网盘下载

from https://www.vediotalk.com/archives/1055
Viewing all 20497 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>