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
/// <summary> | |
/// 转全角(SBC case) | |
/// </summary> | |
/// <param name="input">任意字符串</param> | |
/// <returns>全角字符串</returns> | |
public static string ToSBC(this string input) | |
{ | |
char[] c = input.ToCharArray(); | |
for (int i = 0; i < c.Length; i++) | |
{ |
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
/// <summary> | |
/// DateTime转Unix时间戳 | |
/// </summary> | |
/// <param name="time"></param> | |
/// <returns></returns> | |
public static long ToTimestamp(this DateTime time) | |
{ | |
return (time.ToUniversalTime().Ticks - 621355968000000000) / 10000000; | |
} |
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
-- ============================================= | |
-- Author: Mike Deng | |
-- Create date: 2014/05/14 | |
-- Description: 杀掉死锁进程 | |
-- ============================================= | |
DECLARE @toKill BIT = 0 --0 或 NULL 只显示, 1.杀掉 | |
BEGIN | |
DECLARE @sql NVARCHAR(MAX); |
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
//pads left | |
String.prototype.lpad = function(padString, length) { | |
var str = this; | |
while (str.length < length) | |
str = padString + str; | |
return str; | |
} | |
//pads right | |
String.prototype.rpad = function(padString, length) { |
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 | |
cd /d %~dp0 | |
set PATH=%CD%;%PATH% | |
start cmd.exe |
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
RewriteEngine On | |
RewriteBase / | |
### Force WWW ### | |
RewriteCond %{HTTP_HOST} ^example\.com | |
RewriteRule (.*) http://www.example.com/$1 [R=301,L] | |
## Force SSL ### | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://example.com/$1 [R,L] |
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 sc stop dnsforwarder > !register_as_server.bat | |
@echo sc delete dnsforwarder >> !register_as_server.bat | |
@echo sc create DNSForwarder binPath= "%cd%\srvany.exe" start= auto >> !register_as_server.bat | |
@echo sc description dnsforwarder "UDP to TCP DNS Forwarder" >> !register_as_server.bat | |
@echo reg add HKLM\SYSTEM\CurrentControlSet\Services\dnsforwarder\Parameters /v Application /d "%cd%\dnsforwarder.exe" >> !register_as_server.bat /f | |
@echo reg add HKLM\SYSTEM\CurrentControlSet\Services\dnsforwarder\Parameters /v AppDirectory /d "%cd%" >> !register_as_server.bat /f | |
@echo sc start dnsforwarder >> !register_as_server.bat | |
@echo sc stop dnsforwarder > !delete_dnsproxy_server.bat | |
@echo sc delete dnsforwarder >> !delete_dnsproxy_server.bat |
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
IPT="/sbin/iptables" | |
$IPT -delete-chain | |
$IPT -flush | |
$IPT -P INPUT DROP #1 | |
$IPT -P FORWARD DROP #1 | |
$IPT -P OUTPUT DROP #1 | |
$IPT -A INPUT -m state -state RELATED,ESTABLISHED -j ACCEPT #2 | |
$IPT -A INPUT -p tcp -m tcp -dport 80 -j ACCEPT #3 | |
$IPT -A INPUT -p tcp -m tcp -dport 22 -j ACCEPT #3 | |
$IPT -A INPUT -p tcp -m tcp -dport 21 -j ACCEPT #3 |
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
/// <summary> | |
/// DES3加密解密 | |
/// </summary> | |
public class Des3 | |
{ | |
#region CBC模式** | |
/// <summary> | |
/// DES3 CBC模式加密 | |
/// </summary> |
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
SELECT | |
TABLE_CATALOG AS [Database], | |
TABLE_SCHEMA AS Owner, | |
TABLE_NAME AS TableName, | |
COLUMN_NAME AS ColumnName, | |
ORDINAL_POSITION AS OrdinalPosition, | |
COLUMN_DEFAULT AS DefaultSetting, | |
IS_NULLABLE AS IsNullable, DATA_TYPE AS DataType, | |
CHARACTER_MAXIMUM_LENGTH AS MaxLength, | |
DATETIME_PRECISION AS DatePrecision, |
OlderNewer