Build 10Gbe SFP+ network in Home Lab

I build a Freenas box using a supermicro X8DTN-F motherboard with dual xeon L5630 24GB ram.

I also build a vmware box using all-in-one board SUPERMICRO X11SBA-LN4F with 32GB ECC ram.

X8DTN-F has 2 onboard Gib RJ-45 ports, they are not fast enough for iSCSI storage share.

SO I bought LOT OF 5 MELLANOX CONNECTX-2 10GbE ETHERNET NETWORK CARD MNPA19-XTR. They cost me $65 plush $12 shipping and $25 for customs.
I also bought 3 Genuine Cisco SFP-H10GB-CU3M 3 Meter 10GbE Twinax Cable 37-0961 COPQAA6J A. They cost me about $15 each.

I installed one card on Freenas box and another one on vmware box.

This is some tests from iperf.

/usr/lib/vmware/vsan/bin/iperf -c 10.8.99.2
————————————————————
Client connecting to 10.8.99.2, TCP port 5001
TCP window size: 32.5 KByte (default)
————————————————————
[ 3] local 10.8.99.4 port 57624 connected with 10.8.99.2 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 8.05 GBytes 6.91 Gbits/sec

And using dd in a vm whos storage is based on iSCSI from Freenas over SFP+

dd if=/dev/zero of=testfile bs=1G count=10
10737418240 bytes (11 GB, 10 GiB) copied, 29.0997 s, 369 MB/s

This is a very good result.

One link of 10 Gib link cost me less than $56, This results are very acceptable.

Getting Started with Videos

OpenCV 3.0

    Learn to read video, display video and save video.
    Learn to capture from Camera and display it.
    You will learn these functions : cv2.VideoCapture(), cv2.VideoWriter()

DirectShow runtime is a core Windows component. It does not need a separate installation

FFmpeg
Capture & Display Camera
ex: ffmpeg -i “rtsp://root:camera@10.0.4.127/stream/profile1=u” -vcodec copy -acodec none test.mp4
https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg
rdp/screen-capture-recorder-to-video-windows-free
ffmpeg -f dshow -i audio=”virtual-audio-capturer”:video=”screen-capture-recorder” yo.mp4

list all ffmpeg
ffmpeg -list_devices true -f dshow -i dummy
Use the built-in GDI screengrabber (no install needed) like this :
ffmpeg -f gdigrab -framerate 10 -i desktop [output]
ffmpeg -f gdigrab -framerate 25 -i title=Calculator [output]
ffmpeg -f gdigrab -framerate 25 -i title=”Netflix – Google Chrome” [output]
ffmpeg -f gdigrab -framerate 25 -i title=”Netflix – Google Chrome” -f dshow -i audio=”virtual-audio-capturer” -c:v libx264 -b:v 200k test.mp4
ffmpeg -f dshow -framerate 25 -i video=”screen-capture-recorder” -f dshow -i audio=”virtual-audio-capturer” -c:v libx264 -b:v 200k test.mp4

ffmpeg wiki

x264 lossless
ffmpeg -i input -c:v libx264 -preset ultrafast -qp 0 output

Recording webcam
ffmpeg -f alsa -i default -f v4l2 -s 640×480 -i /dev/video0 output.mpg
ffmpeg -f alsa -i default -f v4l2 -s 640×480 -i /dev/video0 -acodec flac -vcodec libx264 output.mkv

VOB to any container
cat f0.VOB f1.VOB f2.VOB | ffmpeg -i – out.mp2

Two-pass MPEG-4 (very high quality)
ffmpeg -i video.mpg -an -vcodec mpeg4 -pass 1 -f rawvideo -y NUL
ffmpeg -i video.mpg -acodec libvorbis -aq 8 -ar 48000 -vcodec mpeg4 -pass 2 -b 8000k output.mp4

FFserver
he FFmpeg package includes FFserver, which can be used to stream media over a network.

H264 Capture
-i audio=”Sound Blaster Audigy Fx”
Motion, a software motion detector http://motion.sf.net

Linux DDNS with namecheap

sudo apt-get update
sudo apt-get install ddclient

During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want,, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.

The following is the format of the DDClient configuration:

/etc/ddclient.conf

use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=yourdomain.com
password=your dynamic dns password
yourhost

Raspbeery Pi3 with 2 wifi donggle/VPN router

connecting to a WPA WiFi network, your /etc/network/interfaces file will contain something like this:

allow-hotplug wlan0 # detect WiFi adapter
iface wlan0 inet dhcp # connect WiFi with DHCP
wpa-ssid “myhostnetwork” # WPA access point name
wpa-psk “myhostpassword” # WPA access point password

Manually restart WiFi to connect the Raspberry Pi to the Internet.
$ sudo ifdown wlan0
$ sudo ifup wlan0

You can validate that you have a WiFi connection by pinging a website or running the command:

$ ifconfig wlan0

Installing hostapd
$ wget https://github.com/jenssegers/RTL8188-hostapd/archive/v1.1.tar.gz
$ tar -zxvf v1.1.tar.gz
$ cd RTL8188-hostapd-1.1/hostapd
$ make
$ sudo make install

/etc/hostapd/hostapd.conf
interface=wlan1
ssid=mySecureRouter
wpa_passphrase=mySecurePassword

$ sudo service hostapd start
$ sudo update-rc.d hostapd enable

Install DHCP server
$ sudo apt-get install dnsmasq

/etc/dnsmasq.d/dnsmasq.custom.conf
interface=wlan1
dhcp-range=wlan1,192.168.10.10,192.168.10.200,2h
dhcp-option=3,192.168.10.1 # our router
dhcp-option=6,192.168.10.1 # our DNS Server
dhcp-authoritative # force clients to grab a new IP

/etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.8.4

/etc/network/interfaces
iface wlan1 inet static
address 192.168.10.1
netmask 255.255.255.0

$ sudo ifdown wlan1
$ sudo ifup wlan1
$ sudo service dnsmasq start
$ sudo update-rc.d dnsmasq enable

TOR, or The Onion Router, is an encryption technology that encrypts and distributes your internet data across a network of computers on the way back and forth to a website.
VPNs can be more secure than TOR if you trust your VPN server.

To install TOR,
$ sudo apt-get install tor
$ sudo service tor start
$ sudo update-rc.d tor enable

Installing VPN
$ sudo apt-get install openvpn

Edit /etc/openvpn/client.conf
$ sudo service ntp start
$ sudo update-rc.d ntp enable

$ sudo service openvpn start
$ sudo update-rc.d openvpn enable

Routing
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables –t nat –A POSTROUTING –o tun0 -j MASQUERADE
$ sudo iptables –A FORWARD –i wlan1 –o tun0 -j ACCEPT
$ sudo iptables –A FORWARD –i tun0 -o wlan1 –m state –state RELATED,ESTABLISHED –j ACCEPT

persistent the settings
$ sudo sh –c “iptables-save > /etc/iptables.restore”
$ echo “up iptables-restore < /etc/iptables.restore” | sudo tee --append /etc/network/interfaces https://makezine.com/projects/browse-anonymously-with-a-diy-raspberry-pi-vpntor-router/
http://www.dickson.me.uk/2016/06/21/setting-up-a-raspberry-pi-as-a-vpn-router-updated/

台海局势的三个想不到op

台海局势的三个想不到

(2016年9月27日)

李 毅

蔡英文上台四个月了。目前的台海局势,蔡英文1月16日当选以来的台海局势,可以用三句话来概括。第一,蔡英文永远不会承认九二共识,蔡英文永远不会承认两岸同属一中。第二,蔡英文连任做八年,毫无悬念。第三,国民党将很快土崩瓦解,蓝营已经不复存在,绿营将长期执政,至少二十年。二十年之后,绿营执政将更加巩固。关于这三个核心观点,我今年已经发表了三篇长文,做了详细的研究和解说。
台海局势,有三个想不到。第一个想不到,是大陆对蔡英文、民进党坚持台独的意志与决心,想不到。大陆朝野,大陆党政军上中下涉台官员,大陆研究台湾的学者,有很多人,对台湾很不了解。大陆改革开放三十多年,一心一意搞建设,全心全意谋发展,对很多事情,都采取一切向钱看的态度。从向钱看的角度出发,台湾经济,目前总量只有大陆的二十分之一,接近零增长,主要依赖大陆,任何人执政,哪怕为了过好日子,也必须要和大陆搞好关系,也必须要承认九二共识,也必须要承认两岸同属一中。这些大陆官员和学者,根本就不了解,根本就想不到,蔡英文和一批民进党骨干,活着不是为了钱,她(他)们为了台独理想,英勇奋斗,赴汤蹈火,前赴后继,有大无畏的英雄气概,不但不要钱,连死都不怕。这些大陆官员和学者以为,先用减少陆客,然后用不执行两岸经贸协定的穷台政策,然后用烽火外交,减少台湾的邦交国,迫使蔡英文当局在经济、政治、外交上日子过不下去,最终一定会迫使蔡英文和民进党就范,回过头来,承认九二共识,承认两岸同属一中。这根本是白日做梦。蔡英文当局的所作所为,很快就会使这些大陆官员和学者,幡然悔悟,认识到自己完全错了,彻底错了。世界上,并不是一切问题,都是人民币能解决的。他们幡然悔悟的时间,就在一两年之内。国民党很快就会土崩瓦解。蓝营已不复存在。蔡英文连任,根本没有悬念,因为根本就没有对手。洪秀柱,朱立伦,吴敦义,郝龙斌,连胜文,柯文哲,宋楚瑜,王金平,等等,都不是蔡英文的对手。蔡英文做满八年后,绿营长期执政,更是没有蓝营对手。
第二个想不到,是蔡英文和民进党,想不到,大陆朝野完成祖国统一神圣大业的意志与决心。在本质上,在实质上,蔡英文,民进党,不了解中国,不了解中华文明。大陆很世俗,饮食男女,穷人吃喝玩乐,富人吃喝嫖赌抽,没有什么东西是神圣的。目前明文规定的,神圣的东西,只有一个:祖国统一神圣大业。祖国统一,在自古世俗的中华文明,为什么是唯一神圣的东西?夏商周,三千年,实际控制的地方,不大。领先世界两千年的中国,主要是秦皇汉武建立的。秦始皇千古一帝,统一了长城内外,大江南北,直到广东福建沿海。汉武帝雄才大略,继承秦皇统一大业,指挥卫青、霍去病等伟大将帅,打了将近四十年,消灭了北方大国匈奴,拿下了今天外蒙古,拿下了河西走廊,出河西走廊拿下了新疆,在南边建立了海南省,犯强汉者,虽远必诛。秦皇汉武,建立中国,尸积成山,血流成河。在元朝,700年前,西藏进入祖国大家庭。台湾自古是中国的,隋唐以来,郑成功以来,刘铭传以来,一千多年了,1888年,中国正式建立台湾省。1895年,因为甲午战争失败,中国台湾省被日本割去。1945年,因为中国抗战胜利,中国从日本收回台湾省。甲午战败割让台湾,是中国百年国耻的重要标志,任何爱国的中国人,每忆及此,情不自禁,痛彻心扉。秦皇汉武以降,两千年来,每次中国重新统一,大多尸积成山,血流成河。今天,中国经济总值世界第二,军费世界第二,正在赶超美国。今天,在台海这个局部战场,中国军队已对美日军队取得战略优势。今天,蔡英文,民进党,不承认九二共识,不承认两岸同属一中,全面加速走向文化台独、思想台独、教育台独、社会台独,消灭了和平统一的任何希望。这是中国的奇耻大辱。这是侮辱十四亿中国人民,这是侮辱中国军队,这是侮辱中国执政党,这是侮辱中国领袖。是可忍,孰不可忍。蔡英文民进党的如意算盘是,在陆客减少、经济穷台、烽火外交之后,蔡英文民进党岿然不动,大陆黔驴技穷,不得不承认现实,向蔡英文民进党低头让步。这是白日做梦。一两年内,大陆和平手段用尽之后,确认和平统一无望之时,就是台独势力灭亡之日。两千年来,中国的本质,不是一切向钱看,而是秦皇汉武毛泽东,是祖国统一的神圣大业。如果和平统一没有任何希望了,谁敢坐视? 没人敢坐视。
第三个想不到,是美国对台海形势的爆炸性,想不到。美国只知道,本拉登不怕死,伊斯兰国不怕死。美国根本想不到,蔡英文和一批民进党骨干也不怕死。美国以为,美国能管住李登辉、陈水扁,也一定能管住蔡英文。美国不知道,蔡英文大智大勇,蔡英文有足够的政治智慧,让美国管不住蔡英文。美国如果管不住蔡英文,还有可能管住大陆吗?简直是开玩笑。习近平,敢在钓鱼岛海空巡航,敢建立东海航空识别区,敢在南海大规模填海造岛。台湾问题,比所有这些问题加起来,还重要一百倍。陆客减少、经济穷台、烽火外交之后,如果蔡英文民进党还是岿然不动,坚决不承认九二共识,蔡英文连任毫无悬念,难道要大陆认输吗?目前,美国党政军掌管台海的一线官员,都没有大智慧,格局都很小,连话都不会说。反倒是美国学术界,一两年来,有人对台湾的未来有理性的讨论。一两年后,如果美国台海一线党政军官员,还是这样没有大智慧,结果必然是爆炸性的。美国在乌克兰失策,误判普京,使美俄关系崩盘。今天,美国出兵台海已经没有丝毫胜算。美国在台海失策,误判大陆,将使美国在西太平洋的霸权提前崩盘。
今年一月以来,大陆,台港澳,美日欧,研究台海局势的文章,中文的,英文的,读了几百篇。我同意:金灿荣的四个阶段说,朱成虎的四个幻想说,王洪光的台海战役方案。我有三篇长文,在全球华人广为流传。1月19日,《李毅台湾观选总结:和平统一 已无可能》。5月15日,《李毅再论和平统一已无可能》。6月12日,《美国之音李毅采访录》。拙文三篇,仅供批判,仅供参考。

KMS

Activate a Windows Operating System: Windows 7, Windows 8, Server 2008, Server 2008 R2, or Server 2012:
Open up an Elevated Command Prompt window. For instructions, please see our guide: How To Open an Elevated Command Prompt.
In the elevated Command Prompt window, verify that the current directory is C:\Windows\System32. If it is not, type
CD \Windows\System32
and press Enter.
Type the following command:
cscript slmgr.vbs /skms kms01.cit.cornell.edu
and press Enter.
(Note: The url in the command above begins with kay-emm-ess-zero-one.)
Type the following command:
cscript slmgr.vbs /ato
and press Enter.
Close the Command Prompt window.
And you’re done for that installation of Windows on that computer.

Activate Microsoft Office (2016, 2013, or 2010)
Open an Elevated Command Prompt window. For instructions, please see our guide How To Open an Elevated Command Prompt.
Type the following command, depending on your version of Office:
Office 2016:
CD \Program Files\Microsoft Office\Office16
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office16
Office 2013:
CD \Program Files\Microsoft Office\Office15
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office15
Office 2010:
CD \Program Files\Microsoft Office\Office14
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office14
Type the following command:
cscript ospp.vbs /sethst:kms01.cit.cornell.edu
and press Enter. (Note: The url in the command above begins with kay-emm-ess-zero-one.)
Type the following command:
cscript ospp.vbs /act
and press Enter.
Close the command prompt window.

毛主席论宪法

1954年,毛主席在宪法讨论会上的发言:
全文如下:
世上本无事,洋人自扰之。没有宪法的社会,是最好的社会。中华五千年,从来没有宪法,也没见什么损失嘛!汉唐强盛,有宪法吗?满清准备玩宪法,结果亡的更快。教训是深刻的嘛!可我们有不少同志,就是迷信宪法,以为宪法就是治国安邦的灵丹妙药,企图把党置于宪法约束之下。我从来不相信法律,更不相信宪法,我就是要破除这种宪法迷信。国民党有宪法,也挺当回事,还不是被我们赶到了台湾?我们党没有宪法,无法无天,结果不是胜利了吗?所以,迷信宪法的思想是极其错误的,是要亡党的。我们伟大光荣正确的党也是历来不主张制定宪法的,可是,建国后,考虑到洋人国家大都制定了宪法,以及中国知识分子还没有完全成为党的驯服工具的情况、人民群众还受国民党法治思想毒害的悲惨国情,为了争取时间,改造和教育人民群众,巩固党的领导,还是要制定宪法的嘛。制定宪法,本质上就是否定党的领导,在政治上是极其有害的,在不得以而为之的情况下,我们一定要化害为利,最大限度的缩小宪法的约束,坚持党的领导。当然啦,将来如果有一天,条件成熟了,有人提议废除宪法,永远不要制定宪法,我会第一个举手的,不举手的肯定是国民党。公安机关不是汇报说国民党很难抓吗?我看,到了一定时候,他们会自己跳出来的,这是不以人的意志为转移的!
当然啦,宪法制定是制定了,执行不执行,执行到什么程度,还要以党的指示为准。只有傻瓜和反党分子才会脱离党的领导,执行宪法。如果没有我们党的领导,谁会执行现在这部宪法呢?有人不是说,敌对势力最尊重宪法吗?敌对势力如果把党赶下台,头一件事肯定就是废除这部宪法,这你们能否认吗?如果党不领导宪法,党就得下台;党下了台,宪法也就完蛋了。同志们,你们说,党不领导宪法能行吗?如果哪个人连这么简单的道理都不懂,那我们也只好说:这个人比工农群众还无知,需要到广阔天地接受工农群众的再教育、再改造!
我们的党,好比诸葛亮,对于“宪法”这个阿斗,是怀有极其复杂的感情啊!不公开承认阿斗的领导地位是不好的,是无法向人民群众交代的;如果不把阿斗当摆设,也是不好的,是无法让党随意向人民群众发号施令的,也是迟早要被司马懿抓去砍头的。所以,我考虑再三,决定在全国所有学校取消宪法课,开设政治课,让全国人民明白,第一,阿斗还是有的,诸葛亮也受他的领导,不会胡作非为的,放心好啦;第二,诸葛亮是最厉害的,是会呼风唤雨、撒豆成兵的;不听他的话,后果会非常严重的,严重到比地球爆炸还可怕!

万恶的低速网

深圳电信
1000

2016-12-11 new test

office Results
Office Internet

Bench Marks
Geekbench 4 scores are calibrated against a baseline score of 4,000 (which is the score of an Intel Core i7-6600U @ 2.60 GHz). Higher scores are better, with double the score indicating double the performance.
Xeon CPU Single-Core Score 1634 Multi-Core Score 14163
GPU OpenGL Scores 98125

VM X3470 2 VCores Single-Core Score 2414 Multi-Core Score 4100

openssl speed rc4 aes
C2758VM
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 159006.44k 268251.83k 333113.94k 357163.01k 365226.67k
aes-128 cbc 40476.44k 45582.87k 47630.99k 119251.29k 121312.60k
aes-192 cbc 34584.42k 38270.81k 39600.90k 101186.40k 102191.02k
aes-256 cbc 29730.55k 32524.41k 33697.13k 87645.47k 88743.94k

E5-1650 VM
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 474722.01k 637783.56k 768633.73k 810385.69k 825222.23k
aes-128 cbc 128898.97k 119135.41k 146525.09k 147826.03k 136773.41k
aes-192 cbc 112993.81k 121691.71k 106095.54k 126747.41k 126995.31k
aes-256 cbc 99919.90k 104369.55k 109507.89k 109137.02k 109050.14k

X3470 VM
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 306668.07k 426158.85k 467770.11k 480143.70k 481804.29k
aes-128 cbc 100775.06k 108721.77k 111111.17k 232358.23k 237480.33k
aes-192 cbc 85099.41k 90430.59k 92906.75k 198164.55k 200168.79k
aes-256 cbc 72925.21k 77958.38k 79049.80k 170237.27k 170196.99k

Raspberry Pi 2 B+
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 56269.73k 66391.47k 69212.33k 70118.74k 70380.20k
aes-128 cbc 19625.01k 21155.04k 21714.86k 21878.78k 21927.25k
aes-192 cbc 17120.37k 18346.20k 18786.63k 18821.12k 18847.06k
aes-256 cbc 15325.02k 16303.68k 16714.74k 16678.57k 16700.76k

Comparision of Unix bech results

Hostus E5-1650 i core 768MB Ram 20GB,Centos 6
i5-pc
x3470vm
e3-1220v2

————————————————————————
Benchmark Run: Thu Sep 22 2016 06:06:49 – 06:35:41
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 41794589.8 lps (10.0 s, 7 samples)
Double-Precision Whetstone 3700.4 MWIPS (13.3 s, 7 samples)
Execl Throughput 5768.7 lps (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 852337.3 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 240052.1 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1963033.5 KBps (30.0 s, 2 samples)
Pipe Throughput 1845457.8 lps (10.0 s, 7 samples)
Pipe-based Context Switching 1.0 lps (10.0 s, 7 samples)
Process Creation 14123.6 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 6504.9 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 848.6 lpm (60.0 s, 2 samples)
System Call Overhead 2980547.2 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 41794589.8 3581.4
Double-Precision Whetstone 55.0 3700.4 672.8
Execl Throughput 43.0 5768.7 1341.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 852337.3 2152.4
File Copy 256 bufsize 500 maxblocks 1655.0 240052.1 1450.5
File Copy 4096 bufsize 8000 maxblocks 5800.0 1963033.5 3384.5
Pipe Throughput 12440.0 1845457.8 1483.5
Pipe-based Context Switching 4000.0 1.0 0.0
Process Creation 126.0 14123.6 1120.9
Shell Scripts (1 concurrent) 42.4 6504.9 1534.2
Shell Scripts (8 concurrent) 6.0 848.6 1414.3
System Call Overhead 15000.0 2980547.2 1987.0
========
System Benchmarks Index Score 539.8

Ubuntu 16.04 Dell i5-3470 16GB RAM