Skip to content

Instantly share code, notes, and snippets.

View bestpika's full-sized avatar

観月唯 bestpika

  • やりたい事しかできない
View GitHub Profile
@bestpika
bestpika / Web.config
Last active November 5, 2015 01:09
檔案上傳限制
<configuration>
<system.web>
<!-- KBytes -->
<!-- 500MB -->
<httpRuntime maxRequestLength="512000" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<!-- Bytes -->
@bestpika
bestpika / Helper.cs
Created November 5, 2015 07:28
執行網頁內 js 的方法
public static void js(string func)
{
var page = HttpContext.Current.Handler as Page;
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "js", func, true);
// var script = new LiteralControl(string.Format("<script>{0}</script>", func));
// page.Controls.Add(script);
}
@bestpika
bestpika / Web.config
Last active November 10, 2015 00:35
Web.config 指定 httpErrors 行為
<configuration>
<system.web>
<customErrors mode="On">
<!-- 先移除 -->
<remove statusCode="401" subStatusCode="-1" />
<remove statusCode="403" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<!-- 再增加 -->
<error statusCode="401" path="https://google.com" responseMode="Redirect" />
<error statusCode="403" path="/403.html" responseMode="ExecuteURL" />
@bestpika
bestpika / ZyXEL.md
Last active November 20, 2015 07:16
ZyXEL switcher CLI command

設定遠端登入

ref.
在 config 模式底下輸入

# remote-management 1 start-addr <ip> end-addr <ip> service telnet http ssh https
@bestpika
bestpika / README.md
Last active December 15, 2015 09:22
@bestpika
bestpika / README.md
Last active January 8, 2016 01:32
JavaScript Maps
@bestpika
bestpika / README.md
Created January 11, 2016 00:36
系統安全軟體
@bestpika
bestpika / hack.cs
Last active April 19, 2016 07:39
功能筆記
// 清除空白、換行
public static string clear(string text)
{
var cls = new[] { "\r", "\n", " ", " " };
foreach (var cl in cls)
{
text = text.Replace(cl, string.Empty);
}
return text.Trim();
}
@bestpika
bestpika / README.md
Last active April 22, 2016 08:48
登入