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天。

使用Ubuntu Live CD在重装Windows系统时备份完整分区数据

C盘是一个128G SSD, windows在各种方法尝试均失败进不了系统时需要重装,但不确信C盘里还有哪些数据没有备份。

手头没有专业的备份软件,只有ubuntu live cd(USB),需要备份整个C盘,以防止以后想起来什么数据还能恢复出来

解决:使用dd命令

Ubuntu Live CD进入Terminal,首先找到windows分区挂载在哪里(sudo fdisk -l),然后:

dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image.img

x和y是源分区和目标分区,这样的话,等待半个小时或者更久,会在目标分区产生一个128G的image文件,这就是整个分区的数据了

如果希望压缩的话(需要花费很久,但是可以把空白空间识别出来并去掉,产生的文件会小很多):

dd if=/dev/hdx | gzip > /path/to/image.gz

之后重装好了系统,在windows下,可以安装免费的OSFmount软件来把image文件挂载成一个分区,和正常物理分区一样正常使用。

 

举一个具体用过的例子:

sudo dd if=/dev/sda bs=100M conv=notrunc | gzip -c > /media/ubuntu/external_usb_harddrive/sda_image.gz

or: sudo dd if=/dev/sda bs=100M conv=notrunc of=/media/ubuntu/external_usb_harddrive/sda_image.img

Continue reading 使用Ubuntu Live CD在重装Windows系统时备份完整分区数据

Dictionary Universal 使用 deb包的 StarDict 字典

iOS 上最好的开放字典莫过于 Dictionary Universal 和 MDict。

前者使用星际译王StarDict的词库,鉴于StarDict诸多字典的版权问题,原先的字典库下载地址已经无法访问了。

Dictionary Universal 6.0 (目前版本)安装stardict还是只支持tar,zip包的字典。

Google, Baidu上都比较难找到优秀的好用的包下载了。

鉴于linux上使用stardict的人还是很多,采用deb包的字典十分容易下载到(想找哪一部,直接搜索就基本能找到)

研究发现可以这样将deb包的字典在Windows上转化成Dictionary Universal支持的格式:

Continue reading Dictionary Universal 使用 deb包的 StarDict 字典

快速了解未知远程linux主机基本概况

现有未知配置及环境的远程主机一台,希望了解基本信息。

//For some common linux distributions
//without using sudo

//CPU info
more /proc/cpuinfo
cat /proc/cpuinfo

//RAM info
more /proc/meminfo
free -m    //units in MB

//Linux Version
cat /proc/version

//Distribution Version
cat /etc/*release

//close all the process
kill -9 -1

//network related:
more /etc/resolve.conf
more /etc/hosts

//redhat:
more /etc/sysconfig/network-scripts/ifcfg-eth0

Continue reading 快速了解未知远程linux主机基本概况

解决Lenovo yoga 13 fan noise 风扇噪音

(update: Feb 2, 2014 Fixed some links)

(Update Nov, 2013: Summary of this post: to fix fan noise problem, either to download lenovo updated BIOS EC file, or to get a tool named Notebook FanControl and select Yoga profile in this tool. All links are provided below)

 

Lenovo yoga 系列设计理念新颖,但是也有不少缺点;

机器内置的是USB 2.0的无线网卡,不支持5G,速度信号都十分糟糕;

触摸板比起其他笔记本的已经好不少了,但是和Apple的比,在手感和精确度上都还差一些,Synaptics的驱动实在不咋地;

(更新1: 无线网卡问题似乎暂时解决了, post了一片文章在这里)

(更新2: 最近Windows 8.1 出后,Synaptics的驱动也更新了,似乎稍微好点,可以从Lenovo官网下载)

最让人受不了的,就是风扇的噪音!

 

lenovo官方出了一个BIOS中Embedded Controller的额外选择,基本是延迟风扇的启动,改变原先的fan profile,实际测试效果不大,链接在此:

https://forums.lenovo.com/t5/IdeaPad-Slate-Tablets-Knowledge/Yoga-13-Fan-Noise/ta-p/1065093

需要做一个DOS的USB启动盘,可以google制作方法,不是很复杂。

 

Final Solutions:

今天突然发现了一个极好的小工具,有效的解决了Yoga的噪音,本质上可以自定义fan profile,甚至关掉fan

这个小工具叫Notebook FanControl,官网是德文的,下载链接:目前1.0.0.0 (update: 2/3/2014)

Continue reading 解决Lenovo yoga 13 fan noise 风扇噪音