http://james.padolsey.com/javascript/get-document-height-cross-browser/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRANCH_CURRENT=$(git rev-parse --abbrev-ref HEAD) | |
BRANCH_TARGET= | |
DELETE_CURRENT=0 | |
DEPLOY_COMMAND= | |
usage() { | |
echo "Usage: $0 target_branch [options]" 1>&2 | |
echo "Options:" 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
using namespace std; | |
long Fibonacci(unsigned int n) | |
{ | |
if(n == 0) | |
return 0; | |
else if(n == 1) | |
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
# Controls IP packet forwarding | |
net.ipv4.ip_forward = 0 | |
# Controls source route verification | |
net.ipv4.conf.default.rp_filter = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SET NP_PATH=%~dp0 | |
SET NP_PATH=%NP_PATH:\=\\% | |
> ".\OpenWith.reg" ECHO Windows Registry Editor Version 5.00 | |
>>".\OpenWith.reg" ECHO. | |
>>".\OpenWith.reg" ECHO [HKEY_CLASSES_ROOT\*\shell\np2open] | |
>>".\OpenWith.reg" ECHO @="Open with Notepad2" | |
>>".\OpenWith.reg" ECHO. | |
>>".\OpenWith.reg" ECHO [HKEY_CLASSES_ROOT\*\shell\np2open\command] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
安装yum-utils: | |
yum install yum-utils开始清理: | |
清理不被当前系统任何软件所使用的依赖包(应多运行几次): | |
package-cleanup --leaves | |
清理当前软件仓库不再支持的孤儿包: | |
package-cleanup --orphans | |
清理旧内核: | |
package-cleanup --oldkernels | |
更多请man yum-utilsman package-cleanup | |
也可以利用yum插件删除依赖关系: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fallocate -l 512M /var/swapfile | |
chmod 0600 /var/swapfile | |
mkswap /var/swapfile | |
swapon /var/swapfile | |
echo "/var/swapfile swap swap sw 0 0" >> /etc/fstab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
:: ******************************************************* | |
:: Get values from action | |
:: ******************************************************* | |
set REPOS=%1 | |
set TXN=%2 | |
:: ******************************************************* | |
:: If the file doesn't have the correct amount of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 只支持新的TLS协议,旧的SSLv2、SSLv3协议有漏洞都不应该再使用 | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; | |
# 使用服务器握手密匙,密匙生成用以下命令 | |
# openssl dhparam -out dhparam.pem 4096 | |
# 生成4096位的密匙需要很长时间(数小时),但建议至少2048位 | |
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem; |
NewerOlder