useful windows commands

 

  • powercfg hibernate size 100

It actually sets the size of the hiberfil.sys file in percents of the RAM size. If I’m not mistaken, it should be 100% for hibernation mode to work.

Press Win+R and type this command, then reboot your PC. Hibernate should then appear in settings and you can follow current topic’s instructions.

AliYun Code And TortoiseGit

TortoiseGit默认使用TortoiseGitPlink作为ssh客户端(类似putty, 使用ppk格式的key),阿里云居然不支持。先把失败的尝试记录一下:

首先无论用哪个ssh客户端,必须先生成ssh key: id_rsa到默认users\…\.ssh目录下 ,并上传public key到阿里云:

但是git clone总是中途失败,可能网络不好或者别的原因,而且也想用GUI工具,所以拿出TortoiseGit

右键Setting模式用的是Plink:

转换open ssh key到ppk格式

然后用TortoiseGit创建本地Repo空目录, 新增remote配置:

但是fetch或者pull不下来(卡住一段时间后)。报错:fatal: protocol error: bad line length character: Welc, 网上查了一下还是git服务器 response不匹配。

看来阿里云的GitServer真的不支持ppk格式的ssh key。只能放弃, 把图二里的ssh client设定改为默认的C:\Program Files\Git\usr\bin\ssh.exe

然后TortoiseGit就满意了

 

Reference:

https://help.aliyun.com/document_detail/57904.html 官方

https://developer.aliyun.com/article/483601 改ssh client

https://help.cloudforge.com/hc/en-us/articles/215243143-Configure-TortoiseGIT-client-to-work-with-SSH-keys-on-Windows

 

iptables reference

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_%3a_Ch14_%3a_Linux_Firewalls_Using_iptables#Masquerading_.28Many_to_One_NAT.29

不仅介绍了基本的命令行参数和背后的含义,还说明了这个package运行的前置条件:别忘了设置:

#---------------------------------------------------------------
# Load the NAT module
#
# Note: It is best to use the /etc/rc.local example in this
#       chapter. This value will not be retained in the
#       /etc/sysconfig/iptables file. Included only as a reminder.
#---------------------------------------------------------------
 
modprobe iptable_nat
 
#---------------------------------------------------------------
# Enable routing by modifying the ip_forward /proc filesystem file
#
# Note: It is best to use the /etc/sysctl.conf example in this
#       chapter. This value will not be retained in the
#       /etc/sysconfig/iptables file. Included only as a reminder.
#---------------------------------------------------------------
 
echo 1 > /proc/sys/net/ipv4/ip_forward