Sunday, September 30, 2018

Can't open file on MacOS for reading/writing

  • First, Mount NTFS volumes as Read/Write

$ sudo umount /Volumes/NTFS
$ sudo mount -t ntfs -o rw,auto,nobrowse /dev/disk3s1 /Volumes/NTFS
Reference: https://mounty.app/



  • Second, if you can't open a file on MacOS because “this item is used by Mac OS X”, then
SetFile -c "" -t "" path/to/file

Reference:
https://apple.stackexchange.com/questions/136157/mov-file-in-external-hd-greyed-out-and-wont-open-this-item-is-used-by-mac-o

Tuesday, September 04, 2018

5 Tricks: Linux Shell How To Be Fast


1.
sudo !!

2.
ctrl + k (cut to the end of line), ctrl + y (paste)
ctrl + u (cut to the beginning of the line), sudo , ctrl + y

3.
less + F file.log (Ctrl + c, Shift + F)

4.
ctrl + x + e (pop up editor)
ping 8.8.8.8
mtr --cursor
Alt + . = !$

5. reset (unbork a terminal, i.e. Screen terminal screw up)

Reference:
My 5 Favorite Linux Shell Tricks for SPEEEEED
https://www.youtube.com/watch?v=V8EUdia_kOE

Sunday, September 02, 2018

国内免费公共 DNS 域名解析服务收集

国内免费公共 DNS 域名解析服务收集

以下收集的都是目前全球范围内 (更多数是国内的) 比较靠谱的免费公共 DNS 服务的 IP 地址。由于地区差异,同一组 DNS 服务器在不同国家不同地区的表现并不完全相同,解析速度、响应时间等都有所区别,所以建议大家以自行测速结果为准,多多对比再行选择咯。

★ DNSPod Public DNS+

Public DNS+ 是属于 腾讯云旗下的公共 DNS 服务。拥有 80 多条国内线路和 4 条海外线路,有 BGP Anycast 技术,也是国内首家支持谷歌 ECS (edns-client-subnet) 协议的公共 DNS 解析服务。它只使用一个 IP,但有三地集群容灾和秒级自动故障切换,在国内大多数地方的测速数据都非常好,值得推荐。
Public DNS+
IPv4 地址
首选:119.29.29.29

★ AliDNS 阿里公共 DNS 解析服务

阿里公共 DNS 是 阿里云 推出的免费 DNS 递归解析系统,宣称全球数百台服务器组成的集群,拥有充足的带宽资源,目标是成为国内互联网基础设施的组成部分,支持 BGP Anycast 以及 ECS 技术。
AliDNS 阿里公共 DNS
IPv4 地址
首选:223.5.5.5
备用:223.6.6.6

★ 114 DNS

114 DNS 在国内的用户量相当巨大,其 DNS 解析成功率高,与 ISP 的 DNS 相比,能访问更多的国内外网站;号称纯净、无劫持、无需再忍受被强插广告或粗俗网站之痛苦;114DNS 做得比较早,有一定的技术积累,稳定性不错,尽管速度比前两者差一点点,但也都能让人满意。它还有一个特色,就是根据不同用途可以选择不同的 DNS 组。
114 DNS
常规公共 DNS (干净无劫持)
首选:114.114.114.114 、备选:114.114.115.115
拦截钓鱼病毒木马网站 (保护上网安全)
首选:114.114.114.119、备用:114.114.115.119
拦截色情网站 (保护儿童)
首选:114.114.114.110、备用:114.114.115.110

★ 百度 BaiduDNS

百度 DNS 公共解析服务,支持 ipv4 和 ipv6。作为中国最大的搜索引擎,百度拥有一流的基础设施和强大技术实力,国内速度相当快!该服务快速稳定无劫持,智能拦截恶意网站,支持 BGP Anycast 和 ECS 技术。
百度 BaiduDNS
IPv4 地址:180.76.76.76
IPv6 地址:2400:da00::6666

360 DNS 派 (DNSpai Public DNS)

DNS 派是由 360 出品的免费公众 DNS 解析服务。它可以让网上冲浪更加稳定、快速、安全;为家庭拦截钓鱼网站,过滤非法网站,建立一个绿色健康的网上环境;为域名拼写自动纠错等。
DNS 派
首选(电信/移动/铁通):101.226.4.6
备选(电信/移动/铁通):218.30.118.6
首选(联通):123.125.81.6
备选(联通):140.207.198.6

CNNIC sDNS

sDNS  (SecureDNS,简称 sDNS) 是由中国互联网络信息中心 CNNIC 与国内外电信运营商合作推出的免费公共云解析服务,旨在为用户提供高速、安全、智能的上网接入解析服务。sDNS递归云解析服务采用 IP Anycast+BGP 技术跨区域、跨运营商的分布式异构部署,比运营商提供的 DNS 更快更稳定。
CNNIC sDNS
IPv4 地址
首选:1.2.4.8
备用:210.2.4.8

OneDNS

OneDNS 是一个安全、快速、免费的小众 DNS 服务。它能屏蔽恶意网站、摆脱无良 ISP 的DNS污染与劫持。同时横跨南北的高速线路加速您的网络连接。
OneDNS
IPv4 地址
首选:117.50.11.11
备用:117.50.22.22

国外 (美国) 免费公共 DNS 解析服务推荐:

顾名思义,国外的 DNS 当然是适合海外用户使用咯。而对于国内用户来说,尽管这些 DNS 服务器在国内访问速度不算快,但作用也不少,比如买了国外的 VPS 来搭建番·羽·土·啬相关的应用时,可以配置它使用国外的 DNS 等等。

★ Google Public DNS (8.8.8.8)

来自 Google 提供的免费全球公共 DNS 服务,主要为了改进网络浏览速度、改善网络用户的浏览体验。这个基本上不用多做什么介绍了,可能它也是目前全球范围内使用量最大的公共 DNS 了,老牌、稳定、技术强劲。
Google Public DNS
IPv4 地址
首选:8.8.8.8
备用:8.8.4.4
IPv6 地址
首选:2001:4860:4860::8888
备用:2001:4860:4860::8844

★ CloudFlare DNS (1.1.1.1)

CloudFlare DNS 是号称全球最快的 DNS 服务 (当然天朝不算在全球范围内 >_<), CloudFlare 是全球最大的 CDN / DDOS 防护服务提供商之一 (在国内与百度云加速合作),其遍布全球的基础设施资源极其丰富,资金和技术实力相当雄厚。在国外实测速度相当强劲,目前我已将海外的 VPS 全部换到此 DNS,解析速度非常快,相当值得推荐!
CloudFlare DNS
IPv4 地址
首选:1.1.1.1
备用:1.0.0.1
IPv6 地址:
首选:2606:4700:4700::1111
备用:2606:4700:4700::1001

IBM Quad9 (9.9.9.9)

IBM 、Global Cyber Alliance 和 Packet Clearing House 合作推出的免费 Quad9 公共 DNS 服务 (9.9.9.9),主打安全,它会智能屏蔽恶意网址、僵尸网络、钓鱼攻击和其它恶意主机相关联的域名,而且更注重隐私保护。对安全有需求的朋友可以使用这组 DNS。
IBM Quad9
IPv4 地址
首选:9.9.9.9
备用:149.112.112.112
IPv6 地址
首选:2620:fe::fe
备用:2620:fe::9

Cisco OpenDNS

OpenDNS 是一个老牌的免费公共 DNS 提供商,后来被 Cisco (思科) 全资收购。
OpenDNS
IPv4 地址
首选:208.67.222.222
备用:208.67.220.220
IPv6 地址
首选:2620:0:ccc::2
备用:2620:0:ccd::2

Hurricane Electric Public DNS (HE)

HE Public DNS (访问)
IPv4 地址
首选:74.82.42.42
备用:66.220.18.42
IPv6 地址
首选:2001:470:20::2
备用:2001:470:0:9d::2

科摩多 Comodo SecureDNS

科摩多公共 DNS 服务 (访问)
IPv4 地址
首选:8.26.56.26
备用:8.20.247.20

Verisign Public DNS

Verisign Public DNS (访问)
IPv4 地址
首选:64.6.64.6
备用:64.6.65.6
IPv6 地址
首选:2620:74:1b::1:1
备用:2620:74:1c::2:2

Neustar Recursive DNS

Neustar Recursive DNS (访问)
IPv4 地址
首选:156.154.70.1
备用:156.154.71.1
IPv6 地址
首选:2610:a1:1018::1
备用:2610:a1:1019::1

ORACLE Dyn Public DNS

Dyn Public DNS (访问)
IPv4 地址
首选:216.146.36.36
备用:216.146.35.35

Level3 Public DNS

Level3 Public DNS (访问)
IPv4 地址
首选:209.244.0.3
备用:209.244.0.4

Alternate DNS

Alternate DNS (访问)
IPv4 地址
首选:23.253.163.53
备用:198.101.242.72

香港地区公共 DNS 解析服务

香港宽频 / HKBN

香港宽频 DNS
IPv4 地址
首选:203.80.96.10

和记环球电讯 DNS

和记环球电讯 DNS
IPv4 地址
首选:202.45.84.58
备用:202.45.84.59

Pacific SuperNet  DNS

Pacific SuperNet  DNS
IPv4 地址
首选:202.14.67.4
备用:202.14.67.14

台湾地区公共 DNS 解析服务

中华电信 / HiNet

中华电信公共 DNS
IPv4 地址
首选:168.95.1.1
备用:168.95.192.1
IPv6 地址
首选:2001:b000:168::1
备用:2001:b000:168::2

数位联合电信 / Seednet

数位联合电信 DNS
IPv4 地址
首选:139.175.252.16
备用:139.175.55.244

台湾网路资讯  / TWNIC Quad101 Public DNS

台湾网路资讯 TWNIC Quad101 Public DNS (访问)
首选:101.101.101.101
备用:101.102.103.104
IPv6 地址
首选:2001:de4::101
备用:2001:de4::102

韩国免费公共 DNS 解析服务推荐:

KT olleh

KT olleh DNS
IPv4 地址:
首选:168.126.63.1
备用:168.126.63.2

SK Broadband

SK Broadband DNS
首选:210.220.163.82
备用:219.250.36.130

LG U+

LG U+ DNS
两者二选一
首选:164.124.101.2
备用:203.248.252.2
-
首选:164.124.107.9
备用:203.248.242.2

其他国家地区公共 DNS 解析服务:

俄罗斯 Yandex Public DNS

俄罗斯 Yandex Public DNS (访问)
IPv4 地址
首选:77.88.8.8
备用:77.88.8.1
IPv6 地址
首选:2a02:6b8::feed:0ff
备用:2a02:6b8:0:1::feed:0ff

俄罗斯 SafeDNS

俄罗斯 SafeDNS (访问)
IPv4 地址
首选:195.46.39.39
备用:195.46.39.40

德国 DNS.WATCH Public DNS

德国 DNS.WATCH Public DNS (访问)
IPv4 地址
首选:84.200.69.80
备用:84.200.70.40
IPv6 地址
首选:2001:1608:10:25::1c04:b12f
备用:2001:1608:10:25::9249:d69b

瑞士 xiala.net Public DNS

瑞士 xiala.net Public DNS (访问)
IPv4 地址
首选:77.109.148.136
备用:77.109.148.137
IPv6 地址
首选:2001:1620:2078:136::
备用:2001:1620:2078:137::

丹麦 UncensoredDNS

丹麦 UncensoredDNS (访问)
IPv4 地址
首选:91.239.100.100
备用:89.233.43.71
IPv6 地址
首选:2001:67c:28a4::
备用:2a01:3a0:53:53::

荷兰 Freenom World Public DNS

荷兰 Freenom World Public DNS (访问)
IPv4地址
首选:80.80.80.80
备用:80.80.81.81

写在后面:

你可以在路由器上设置公共 DNS,这将应用到你全部的设备。也可以根据需要只在某台电脑、手机上独立进行设置。Win、macOSLinux 等系统的配置方法可以很容易搜索得到。
而且不仅仅是电脑和手机,像 XBoxPS4 等游戏机或者任何网络设备,基本都可以设置 DNS 的。如果你玩游戏、下载游戏速度太慢太卡,也不妨试试更换一个 DNS 看看效果。
Credit: https://www.iplaysoft.com/public-dns.html

Wednesday, June 20, 2018

Stream DeepLens video over SSH

$ export IP=192.168.0.123 # replace with your own DeepLens ip address

# Raw video output
$ ssh aws_cam@${IP} cat /opt/awscam/out/ch1_out.h264 | mplayer -demuxer x264 - 2>/dev/null

# Processed (by model) video output
$ ssh aws_cam@${IP} cat /tmp/results.mjpeg | mplayer -demuxer lavf - 2>/dev/null

Reference
https://www.youtube.com/watch?v=HozP1t3usPM


Wednesday, June 06, 2018

vim go plugin install

On MacOS

1. Make sure go in available, if not
brew install golang

2. Update vim
brew install vim

3. Install Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

4. Install vim-go
git clone https://github.com/fatih/vim-go.git ~/.vim/plugins/vim-go

5. Modify ~/.vimrc, add the following line:
call vundle#begin('~/.vim/plugins')
     Plugin 'fatih/vim-go'
call vundle#end()

6. Initialize vim-go
:GoInstallBinaries





On Ubuntu, using vim-plug:
1. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

2. git clone https://github.com/fatih/vim-go.git ~/.vim/plugged/vim-go

3. Add to ~/.vimrc
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
call plug#end()

4. Done.


Reference
https://github.com/fatih/vim-go
https://github.com/fatih/vim-go-tutorial
https://github.com/fatih/vim-go-tutorial#quick-setup

git: ignore SSL certificate, set/unset http proxy

git config --global http.sslVerify false
git config --global http.postBuffer 1048576000

git config --global http.proxy http://user:pass@proxy.server.com:3128


git config --global --unset http.proxy



Workaround for "RPC failed; curl 56 GnuTLS recv error"

mkdir proj
cd proj
git init
git remote add -f origin https://github.com/user/proj
git fetch
git checkout -B master origin/master



Reference:
https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html
https://stackoverflow.com/questions/783811/getting-git-to-work-with-a-proxy-server
https://bugs.launchpad.net/ubuntu/+source/gnutls26/+bug/1111882




apt-get with proxy

sudo vim /etc/apt/apt.conf

Add the following lines:

Acquire::http::Proxy "http://user:pass@server:port";
Acquire::https::Proxy "http://user:pass@server:port";

Reference
https://askubuntu.com/questions/257290/configue-proxy-for-apt

tmux enable mouse mode

Before tmux 2.1

set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on

For tmux 2.1 and later

setw -g mouse on 

Reference

https://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/

Monday, June 04, 2018

Install LXDE on Ubuntu 14.04

On your ubuntu:
apt-get update
apt-get install xrdp
apt-get install lxde
echo lxsession -s LXDE -e LXDE > ~/.xsession

On your windows:
mstsc.exe /v:ubuntu.example.com /f /span /admin

Reference:
http://c-nergy.be/blog/?p=5357
http://techgenix.com/configuring-windows-remote-desktop-command-line/

Saturday, May 12, 2018

Compile latex sources with docker container

Someone maintains a great source over here:
https://hub.docker.com/r/blang/latex/

Comprehensive instructions are also available on the same web page.

Essentially, you will have to do:

# Change to your project
cd my_latex_project

# Download the command wrapper and make it executable
wget https://raw.githubusercontent.com/blang/latex-docker/master/latexdockercmd.sh
chmod +x latexdockercmd.sh

# Optional: Change the version (see above, default blang/latex:ubuntu)
edit ./latexdockercmd.sh

# Or use latexmk (best option)
./latexdockercmd.sh latexmk -cd -f -interaction=batchmode -pdf main.tex

Thursday, May 10, 2018

Google chrome keyboard shortcut on Mac for navigating "Previous|Next"

Open the previous page in your browsing history for the current tab⌘ + [ or ⌘ + Left arrow
Open the next page in your browsing history for the current tab⌘ + ] or ⌘ + Right arrow

For complete google chrome keyboard shortcuts reference, visit https://support.google.com/chrome/answer/157179?hl=en

How to install docker for mac Community Edition

到这个网址, 点击“Get Docker”:
https://store.docker.com/editions/community/docker-ce-desktop-mac

或者直接下载:
https://download.docker.com/mac/stable/Docker.dmg

Other ways of installation can be found here (I have NOT tried yet)
https://pilsniak.com/how-to-install-docker-on-mac-os-using-brew/

Tuesday, May 07, 2013

VS2010 build error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions

This is a known issue. The cause and the solution are stated on a MSDN forum.
Here is an excerpt from that online forum:
Starting from Windows Vista, including Vista, Win2008 Server, Windows7, build process cannot write to HKEY_CLASSES_ROOT (HKCR) hives unless the process is started as administrator. To be able to register in non-administrator mode, VS2008 and VS2010 offer the feature of "registrer per user". The registration information is written to HKEY_CURRENT_USER (HKCU). You can set Linker -> General -> Per User ReDirections to "true" if Linker -> General -> Register Output is set to "true". If you have your own custom registration step, you can use the per user registration command: regsvr32 /s /n /i:user "xxxx.dll". If VS2010 is installed on Windows XP, you don't need to have the elevated privilege or per user registration to register your application since the security requirement is OS specific.

Monday, May 06, 2013

Sub functions in windows command line script

During my day-to-day work, I find myself frequently changing some environment variables on my Windows machine to compile my various projects. For example, some of them are targeted for visual studio 2008 and some are targeted for visual studio 2010 (don't ask me why this is the case).

Because I am lazy, I don't want to always click "Start"->Right click "Computer"->"Properties"->"Advanced system settings"->"Environment Variables..." to changes the environment variables that I care about (and there are so many variables to change). Instead, I prefer to open a command line windows and just execute one script that properly set all the variables for me, including the PATH environment variable.

Initially, I created a simple script (called dev.cmd) like below:
REM: file content for dev.cmd
set PATH=%PATH%:c:\mypath1
set PATH=%PATH%:c:\mypath2
...
set MYVAR1=myvar1
set MYVAR2=myvar2
...

However, when I have multiple command line windows open in front of me at the same time, I easily forgot whether or not I have executed dev.cmd in a particular windows when I switch to it. So I just blindly run the script again when I feel it is needed.

This approach gives me a little problem: when I need to look at my %PATH% later on to debug the cryptic build error message, resulted from running a binary from an unexpected location/path, the result is something like:
%SYSTEM_PREDEFINED_PATHS%:c:\mypath1:c:\mypath2:c:\mypath1:c:\mypath2:c:\mypath1:c:\mypath2:c:\mypath1:c:\mypath2:c:\mypath1:c:\mypath2:c:\mypath1:c:\mypath2

That is simply because I have executed my dev.cmd so many times.

So I find myself in the need of functionality that I can use to determine if mypath1 is already part of my %PATH%.

OK, that means sub functions in command line scripts. Fortunately I found it is supported. Unfortunately, I found it really hard to understand/remember.

So, I decide to paste a slighted modified version of my dev.cmd here, just for my reference (and for yours, if you find it useful). The interesting part is not the "set" statements, it is instead the three sub functions at the end, i.e., "add_path", "substring", and "dequote".

REM file content for dev.cmd

@echo off
set WS=c:\xxx\workspaces
set TCROOT=%WS%\build\toolchain
set BUILDAPPS=%WS%\build\apps\bin

set LOTUS_COMPCACHE=%WS%\lotus\main\gobuild\compcache
set GOBUILD_PTHREADS_W32_291_ROOT=%LOTUS_COMPCACHE%\pthreads-w32-291\ob-1005657\publish
set GOBUILD_DCERPC_WIN32_11_ROOT=%LOTUS_COMPCACHE%\dcerpc-win32-11\ob-1053621\publish
set GOBUILD_PTHREADS_W32_291_ROOT=%LOTUS_COMPCACHE%\pthreads-w32-291\ob-1005657\publish
set GOBUILD_BOOST1470_WIN64_VC90SP1_ROOT=%LOTUS_COMPCACHE%\boost1470_win64_vc90sp1\ob-811341\windows
set GOBUILD_AUTHENTICATION_FRAMEWORK_ROOT=%LOTUS_COMPCACHE%\authentication-framework\ob-1096390\windows-2008
set GOBUILD_PLATFORM_SDK_WINDOWS_ROOT=%LOTUS_COMPCACHE%\platform-sdk-windows\ob-1086025\publish

set JAVA_HOME=%TCROOT%\win64\jdk-1.7.0_09
set ANT_HOME=%TCROOT%\noarch\ant-1.7.1

set HTMLHELP_PATH=%TCROOT%\win32\htmlhelp-1.32
set GAWK_PATH=%TCROOT%\win32\gawk-3.1.6
set SED_PATH=%TCROOT%\win32\sed-4.1.4
set PERL_PATH=%TCROOT%\win32\perl-5.8.8
set WINSDK_PATH=%TCROOT%\win32\winsdk-7.0.7600
set WIX_PATH=%TCROOT%\win32\wix-3.5.2519.0
set VC_PATH=%WINSDK_PATH%\VC
set FRAMEWORK_PATH=%windir%\Microsoft.NET\Framework\v3.5
set CPU=AMD64

set INCLUDE=%VC_PATH%\atlmfc\Include;%VC_PATH%\Include;%WINSDK_PATH%\Include;
set LIB=%VC_PATH%\atlmfc\Lib\amd64;%VC_PATH%\lib\amd64;%WINSDK_PATH%\Lib\x64;
set LIBPATH=%FRAMEWORK_PATH%;%VC_PATH%\atlmfc\Lib\amd64;%VC_PATH%\lib\amd64;%WINSDK_PATH%\Lib\x64;

rem call :add_path %TCROOT%\win32\bin
call :add_path %WINSDK_PATH%\bin
call :add_path %VC_PATH%\bin
call :add_path %VC_PATH%\bin\amd64
call :add_path %VC_PATH%\bin\x86_amd64
call :add_path %VC_PATH%\vcpackages
call :add_path c:\python27
call :add_path "c:\Program Files (x86)\Windows Resource Kits\Tools"
call :add_path %BUILDAPPS%
call :add_path %ANT_HOME%\bin
call :add_path %JAVA_HOME%\bin
call :add_path %TCROOT%\win32\make-3.81
call :add_path %TCROOT%\win32\perl-5.8.8\bin
call :add_path %TCROOT%\win32\cygwin-1.5.19-4\bin
call :add_path %WIX_PATH%
call :add_path %HTMLHELP_PATH%
call :add_path %GAWK_PATH%\bin
call :add_path %SED_PATH%\bin
call :add_path %PERL_PATH%\bin
call :add_path %SystemRoot%\system32
call :add_path %SystemRoot%
call :add_path %SystemRoot%\SysWOW64\wbem
call :add_path %SystemRoot%\system32\wbem
call :add_path %WINSDK_PATH%\dll\amd64\Microsoft.VC90.DebugCRT
call :add_path "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE"

cd /d %WS%
goto :eof

  :add_path
  setlocal
  set p1=%1
  call :dequote p1
  call :substring "%p1%" "%PATH%"
  if errorlevel 1 endlocal & call set PATH=%PATH%;%p1%& setlocal
  rem echo.new PATH is "%PATH%"
  endlocal
  goto :eof

  :substring
  setlocal
  set s1=%1
  set s2=%2
  call :dequote s2
  call :dequote s1
  echo."%s2%" | findstr /iC:"%s1%" 1>nul
  if errorlevel 1 (
    rem echo.%2 does NOT contain %1
  ) ELSE (
    rem echo.%2 contains %1
  )
  endlocal
  goto :eof

  :dequote
  for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
  goto :eof




Thursday, April 25, 2013

Vim tip: Show ^M and remove it


Vim tip: Show ^M and remove it

-- or replace CRLF with LF
-- or replace 0d0a with 0a
-- or replace DOS line ending with Linux line ending

Display CRLF as ^M:

:e ++ff=unix

Substitute CRLF for LF:

:1,$ s/\r\n/\r/g

Wednesday, April 17, 2013

Visual studio 2008: fatal error LNK1000: Internal error during IncrBuildImage

This is a known issue. Microsoft provided a hotfix:
https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=11399

Install VS2008 SP1 should also fix this problem.
http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

Friday, March 08, 2013

VI tip: Copy/Paste using named buffers


Action Key strokes
Copy 3 lines into buffer "a" "ay3
Paste from buffer "a" "ap

There is also a more "GUI"ish way of doing Copy/Cut/Paste listed on vim wiki.

Tuesday, August 02, 2011

PowerShell script to determine if a machine has two or more local interfaces

First, create a txt file (e.g. d:\server.txt) containing a list of servers:

10-2411A0407
10-2411A0408
10-2411A0409

Second, run the following script block:

$Servers = Get-Content D:\Server.txt
foreach ($s in $Servers)
{
  $Interfaces = Invoke-Command -ComputerName $s -Command {Get-WmiObject Win32_NetworkAdapterConfiguration}
  $NumInterfaces = $Interfaces.Length
  $LocalInterfaces = 0
  $LocalIP = ""
  foreach ($If in $Interfaces)
  {
    $IsLocal = $False
    foreach ($ip in $If.IPAddress)
    {     
      if ($ip.StartsWith("10.10."))
      {
        $IsLocal = $True
        break;
      }
    }
    if ($IsLocal)
    {
      $LocalInterfaces++
      $LocalIP += $ip + " "
    }
  }
  if ($LocalInterfaces -ge 2)
  {
    $s
    $LocalIP   
  }
}

Finally, here is what I got out of it:

10-2411A0407
10.10.11.43 10.10.10.87
10-2411A0408
10.10.11.30 10.10.10.83
10-2411A0409
10.10.10.107 10.10.11.28

Wednesday, March 15, 2006

MPI-2 IO 学习笔记

学习内容:MPI2 standart ,
资料来源:http://www.mpi-forum.org/docs/mpi2-report.pdf

要点:MPI2 IO 标准
etype 基本类型
filetype 由一个或多个etype组成,中间允许由空洞

displacement:以字节为单位,从文件第一个字节开始
offset:以etype为单位,从displacement开始
view:文件视图?现在还不是很理解,详见Page 232, Figure9.3

Data access routines:
Data is moved between files and processes by issuing
read and write calls. There are three orthogonal aspects
to data access:
1. positioning (explicit offset vs. implicit file pointer),
2. synchronism (blocking vs. nonblocking and split collective), and
3. coordination (noncollective vs. collective).

重点要掌握P220 的那张data access routines列表,非常详尽。

Monday, March 13, 2006

PVFS2 components

1. pvfs2-server
2. system interface
3. management interface
4. Linux kernel driver
5. pvfs2-client
6. ROMIO PVFS2 device

PVFS2 objects:
1. directory
2. metafile
3. datafile
4. symbolic link

Handles and its range, an example:

Name pvfs2-fs
ID 584761686
RootHandle 1048576

Range cse-wang-server 4-715827885
Range cse-wang05b 715827886-1431655767
Range cse-wang11 1431655768-2147483649


Range cse-wang-server 2147483650-2863311531
Range cse-wang05b 2863311532-3579139413
Range cse-wang11 3579139414-4294967295


TroveSyncMeta yes
TroveSyncData no
AttrCacheKeywords datafile_handles,metafile_dist
AttrCacheKeywords dir_ent, symlink_target
AttrCacheSize 4093
AttrCacheMaxNumElems 32768