简易六分仪与夜晚纬度估测

一直想实践一下使用六分仪(Sextant), 简单估计一下纬度.

需要以下材料:

1. 30cm直尺一把 (至少16cm)

2. 量角器.  (没有怎么办? 我网上找了一个pdf打印了一个http://www.ossmann.com/protractor/)

3. 细绳子一条 (实践下来细一些,柔软的比较好)

4.重物 (硬币,回形针)

5. 胶带, 白纸

方法:

1.将绳子一端固定在量角器中央(90度与180度延长线交点),确保绳子能以量角器中央自由旋转(这点很重要,必须是绕着这一点旋转,不能高也不能低).

2. 绳子另一端用胶带固定一个重物

3.将量角器180度边与直尺一边对齐,将量角器倒着固定在靠近尺子左端约2-3cm处 (量角器刻度左边是0度,右边是180度). 量角器与直尺中间夹一张白纸

4. 在户外,找到北极星(北斗七星勺子末端延长5倍). 将尺子右端瞄准北极星, 从左端望去,确保直尺左端,右端,北极星成一条直线.

5.这时候绳子自由悬挂的角度,在量角器上读出z. 例如读出55度,那么90度减去这个度数,就是纬度了,这个例子中纬度就是35度

借用一张引用源的图片来说明:

sextant

Continue reading 简易六分仪与夜晚纬度估测

Windows 8.1 Event 10016 Fix: The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {D63B10C5-BB46-4990-A94F-E40B9D520160}

A year ago, I had such error message in the event viewer on the first day of fresh installation of Windows 8. I believed it was also the reason that I had a blue screen: MEMORY_MANAGEMENT error. It was caused by ntoskrnl.exe upon inspecting Windows Mini Dump, by a tool named BlueScreenView.  Now a year later, after I recently updated to Windows 8.1 Update 1, the problem came back again. I decide to log it here.

After inspecting Windows Event Viewer, the error is the same as before, which is:

Event 10016, DistributedCOM

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{D63B10C5-BB46-4990-A94F-E40B9D520160}
and APPID
{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}
to the user NT AUTHORITYSYSTEM SID (S-1-5-18) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.

Here is a way I found to fix it:

1.Go to Component Service: dcomcnfg  (in Windows 8.1, you may hit ‘Win’ + Q and enter dcomcnfg, and launch it by Admin)

At the left panel, go to ‘Component Service->Computers->My Computer->DCOM Config’, then at the right panel, find by name: ‘RunTimeBroker’ (This is {D63B10C5-BB46-4990-A94F-E40B9D520160})

Right click it, choose ‘Property’ -> ‘Security’.   Then I found everything was grey and unable to edit.

2. To enable editing ‘Security’, launch regedit (‘Win’ + Q and enter regedit, open the application by Admin)

Browse to Hkey_classes_rootAppID{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}, Right click it

Choose ‘Permissions’, -> Choose ‘Advanced‘ -> Change Owner to ‘Administrators’ of your PC -> Apply the change

Then change ‘SYSTEM’ and ‘Administrators’ ‘s permission to ‘Full Control’ under ‘Permission’ -> Apply the change

3. Go back to Component Service dcomcnfg

Now the Security section is able to edit.

In ‘Launch and Activation Permissions’, Add ‘SYSTEM’ and give it permission ‘Full Control’

4. DONE!

Continue reading Windows 8.1 Event 10016 Fix: The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {D63B10C5-BB46-4990-A94F-E40B9D520160}

Putty Color Scheme Tango & My Putty Settings

I use Putty w/ Xming Server to replace  X-win 32 and VNC.

Color Scheme

After searching, I found a decent color scheme for Putty.

To make it default for Putty, paste the following code and name the file PuttyConfig.PS1  (Windows Power Shell Script):  (I borrow the script from another site, see links at the end)

param([string]$puttyConf)

$sessionKey = "HKCU:SoftwareSimonTathamPuTTYSessions$puttyConf"
if ( test-path $sessionKey ) {
   $values = @{
      "Xterm256Colour" = 0x00000001
      "BoldAsColour" = 0x00000001
      "Colour0" = "187,187,187"
      "Colour1" = "255,255,255"
      "Colour2" = "8,8,8"
      "Colour3" = "85,85,85"
      "Colour4" = "0,0,0"
      "Colour5" = "0,255,0"
      "Colour6" = "46,52,54"
      "Colour7" = "85,87,83"
      "Colour8" = "204,0,0"
      "Colour9" = "239,41,41"
      "Colour10" = "78,154,6"
      "Colour11" = "138,226,52"
      "Colour12" = "196,160,0"
      "Colour13" = "252,233,79"
      "Colour14" = "52,101,164"
      "Colour15" = "114,159,207"
      "Colour16" = "117,80,123"
      "Colour17" = "173,127,168"
      "Colour18" = "6,152,154"
      "Colour19" = "52,226,226"
      "Colour20" = "211,215,207"
      "Colour21" = "238,238,236"
   }
   $values.Keys | %{
      set-itemproperty $sessionKey $_ $values[$_]
   }
} else {
   write-error "Profile '$puttyConf' does not exist in the Putty configuration"
}

Fonts & Window

Double click the file to run it.  I also set Font to “Courier New”, 12-point, Font quality: ClearType

I wish to have a transparent putty terminal window, so I use a modified version of Putty: PuttyTray.  Then set window opacity( in Colours section ) to 220.

Export Putty Session Settings

To export putty settings with session list: (This will generate a .reg file on the Desktop)

regedit /e "%userprofile%desktopputty.reg" HKEY_CURRENT_USERSoftwareSimonTatham

To export sessions only:

regedit /e "%userprofile%desktopputty-sessions.reg" HKEY_CURRENT_USERSoftwareSimonTathamPuTTYSessions

Continue reading Putty Color Scheme Tango & My Putty Settings

Connect iPhone/Laptop to Home Network via OpenVPN on Cisco E3000 w/ Tomato USB firmware

This is a log to try OpenVPN.

——————

Environment:

Router: Cisco E3000 w/ Tomato 1.28-116 K26 by Shibby

Phone: iOS 7

Computer: Windows 8.1 x64

——————-

1. Download OpenVPN at: http://openvpn.net/index.php/open-source/downloads.html

choose Windows Installer (64bit), then install with all the components.

2. Creating the Certificates and keys

Run Windows Command Prompt (cmd) as Administrator:

cd C:Program FilesOpenVPNeasy-rsa

init-config

This will copy vars.bat and openssl.cnf to easy-rsa folder

notepad vars.bat

Open notepad and edit vars.bat, fill the following at the end of file:

set KEY_COUNTRY=
set KEY_PROVINCE=
set KEY_CITY=
set KEY_ORG=
set KEY_EMAIL=

Save. Then type the following: (when at the 3rd command => build-ca, hit ‘Enter’ for everything except ‘Common Name Parameter’, enter something, eg:  MyName) Continue reading Connect iPhone/Laptop to Home Network via OpenVPN on Cisco E3000 w/ Tomato USB firmware

Code::Blocks installation in CentOS 6.5 x64_minimal

A log of installing Code::Blocks in CentOS 6.5 x64 Minimal edition. (It’s a server, and codeblocks will be accessed on clients via putty and Xming.)

#Install some necessary libraries
yum groupinstall "Development Tools"  

#install rpmforge, there are other ways, here I use wget to download rpm package and install
#install wget
yum install wget
mkdir ~/temp
cd ~/temp
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum install --enablerepo=rpmforge-extras

#Install wxGTK
yum install wxGTK-devel

#Install codeblocks from source
#ref:http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_RPM_based_distributions
cd ~
mkdir codeblocks
cd codeblocks
svn checkout svn://svn.berlios.de/codeblocks/trunk
cd trunk
./bootstrap
./configure
make
sudo make install

#Now Code::Blocks has installed, configure remote access
#enable X11 forwarding: ref:http://www.techotopia.com/index.php/Displaying_CentOS_Applications_Remotely_(X11_Forwarding)
sudo vi /etc/ssh/ssh_config
#Edit the file and make sure -> X11Forward yes
sudo yum xorg-x11-xauth.x86_64
sudo yum install xorg-x11-fonts

#Now on a Windows client, using Putty and Xming access the server
#On windows desktop, download and install Xming Server and Xming fonts
#in Putty, enable X11 Forwarding, set display to "Localhost:0"

#Type the following:
echo $DISPLAY
#It should return localhost:10.0

#Run Code::Blocks
codeblocks &

 

Charter IPv6 using 6rd with Cisco E3000 and Tomato 1.28-116 K26 by Shibby

My Local ISP – Charter is now offering IPv6 through 6rd relay.

Reference page: http://www.myaccount.charter.com/customers/Support.aspx?SupportArticleID=2665#ipv6prep

6RD Configuration Settings
As part of Charter's IPv6 Trials we have made available a Public 6rd Border Relay. 
If you are interested in participating in our early trials and own a device 
that supports 6RD use this configuration information to begin experiencing the Next Generation Internet:

6rd Prefix = 2602:100::/32
Border Relay Address = 68.114.165.1
6rd prefix length = 32
IPv4 mask length = 0
Primary DNS Address = 2607:f428:1::5353:1

Secondary DNS Address = 2607:f428:2::5353:1

I am using Cisco E3000 w/ Tomato 1.28-116 K26 by Shibby

After hours of researching, finally I can access ipv6 websites.

Steps:

1. In “Administration” -> “Scripts”->”Init”, add:

insmod tunnel4
insmod sit

2. In “Administration” -> “Scripts”->”WAN Up”, add:

WANIP=$(nvram get wan_ipaddr)
if [ -n "$WANIP" ]; then
    ip tunnel del tun6rd
    V6PREFIX=$(printf '2602:100:%02x%02x:%02x%02x' $(echo $WANIP | tr . ' '))
    ip tunnel add tun6rd mode sit local $WANIP ttl 64
    ip addr add ${V6PREFIX}::1/32 dev tun6rd
    ip addr add ${V6PREFIX}::1/64 dev br0
    ip link set tun6rd up
    ip -6 route add ::/0 via ::68.114.165.1 dev tun6rd
    service radvd restart
fi

route -A inet6 del default gw :: metric 1024 `nvram get wan_iface`

*Initially I didn’t have the last line, I couldn’t get ipv6 address. After searching on forums (I forgot the address), I added the last line, suddenly it works perfectly!

3. In “Basic”->”IPv6″-> Choose “Other”

in WAN interface, put: tun6rd

Leave Router IPv6 Address blank

In Static DNS, put Charter’s IPv6 DNS address

Save

4. All done

5.Test your network @ http://test-ipv6.com/

6. Try https://ipv6.google.com/

Reference:

http://kdwink.blogspot.com/2013/05/ipv6-with-charter-communications.html

http://tomatousb.org/forum/t-473266/howto-ipv6-using-6rd

Vim简明教程 (转载)

原文出处未知,最后见到在 CSDN 上,转载于此:

————————————————————–

vim的学习曲线相当的大(参看各种文本编辑器的学习曲线),所以,如果你一开始看到的是一大堆VIM的命令分类,你一定会对这个编辑器失去兴趣的。下面的文章翻译自《Learn Vim Progressively》,我觉得这是给新手最好的VIM的升级教程了,没有列举所有的命令,只是列举了那些最有用的命令。非常不错。

——————————正文开始——————————

你想以最快的速度学习人类史上最好的文本编辑器VIM吗?你先得懂得如何在VIM幸存下来,然后一点一点地学习各种戏法。

Vim the Six Billion Dollar editor

Better, Stronger, Faster.

学习 vim 并且其会成为你最后一个使用的文本编辑器。没有比这个更好的文本编辑器了,非常地难学,但是却不可思议地好用。

我建议下面这四个步骤:

  1. 存活
  2. 感觉良好
  3. 觉得更好,更强,更快
  4. 使用VIM的超能力

当你走完这篇文章,你会成为一个vim的 superstar。

在开始学习以前,我需要给你一些警告:

  • 学习vim在开始时是痛苦的。
  • 需要时间
  • 需要不断地练习,就像你学习一个乐器一样。
  • 不要期望你能在3天内把vim练得比别的编辑器更有效率。
  • 事实上,你需要2周时间的苦练,而不是3天。

图片二维码水印

(更新: 其实后来发现很多软件可以直接加二维码(QR code)的水印,比如iWatermark,还有用类似原理的Digimarc服务)

一直以来,多数人为了保护图片,照片版权,给照片打上了水印或者logo, 但其实这都破坏了图片本身,看起来总有贴上膏药的感觉.

近日测试显示器,遂Google一张全黑背景图, 输入关键词 All Black background image, 点击到Image搜索, 直接就下载了第一张图

就是这张: (Source link: click here Thanks!)

All black background image.jpg

 

看起来就是一张黑色图片, 但当我仔细靠近显示器, 却在中央发现了一个淡淡的二维码!

黑色背景是#000000, 这个二维码约莫是#040404, #050505, 非常淡

Photoshop cc处理: Continue reading 图片二维码水印

mini DV 录像带的数字化转换,转录

在10年前曾经大量使用mini DV带记录旅游,活动,日常生活. 使用的是Sony DCR-PC105E 录像机.

sonyminidv

这类录像的分辨率可能是VGA (640×480), 线性的声音记录. 但是以今天绝大多数视频素材已经达到Full HD (1080p)的标准看, 似乎前者已经落后了. 鉴于DV带不易于长期保存,回放也比较麻烦. 于是决定将所有带子数码化.

曾经尝试使用PC机以及USB线转录,效果不佳. 我没有1394卡, 所以作罢.

我sony的这台录像机有4pin的1394接口 ,联想到手头有的设备包含一台2010年的13寸Macbook Pro, 有Firewire 800的接口. (现在的新Mac已经没有了,可能需要买Thunderbolt to Firewire adapter). 于是决定用Mac转录, 并且Mac一向有影音处理方面独有的优势. (Final Cut Pro, iMovie, iDVD 这些App)

升级到了Mac OS X  10.9 Mavericks, 安装了iMovie 10.0.1. 并购买了Prolink 4pin to 9pin 1394 adapter:

Continue reading mini DV 录像带的数字化转换,转录

关于记忆QWERTY键盘的技巧

听来的一个口诀,方便记忆键盘

Source: Unknown, from internet source

————————–

Quiet Aunt Zeda—–QAZ

Want Something Extra—WSX

Every Dollar Counts—EDC

Run From Vicky—RFV

To Get Betty—TGB

You Have Nothing—YHN

Uncle Joe’s Mad—UJM

I’m King Comma (,)—IK,

Over Long Period (.)—OL.

Pretty—P