This file contains hidden or 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
rem Get the date and time in a locale-agnostic way | |
for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x | |
rem Leading zeroes for everything that could be only one digit | |
set Month=0%Month% | |
set Day=0%Day% | |
rem Hours need special attention if one wants 12-hour time (who wants that?) | |
if %Hour% GEQ 12 (set AMPM=PM) else (set AMPM=AM) | |
set /a Hour=Hour %% 12 | |
if %Hour%==0 (set Hour=12) | |
set Hour=0%Hour% |
This file contains hidden or 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
$table = get-childitem -recurse | where {! $_.PSIsContainer} | |
foreach ($row in $table) | |
{ | |
Get-FIleHash $row.FullName -Algorithm SHA1 | |
} | |
pause |
This file contains hidden or 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 dbo.fn_UnderscoreCase('HelloWorld') | |
-- | |
-- Input HelloWorld | |
-- | |
-- Output hello_world | |
-- | |
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'fn' AND name = | |
'fn_UnderscoreCase') | |
DROP function fn_UnderscoreCase | |
GO |
This file contains hidden or 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
/* | |
The script only effect on https://histock.tw/stock/dividend.aspx | |
add warrant link below the financial link. | |
*/ | |
for (r = 0; r < document.getElementsByClassName('tb-msci').length; r++) { | |
var table = document.getElementsByClassName('tb-msci')[r]; | |
for (i = 0; i < table.rows.length; i++) { | |
if (table.rows[i].cells[2]) { | |
//before https://histock.tw/stock/financial.aspx?no=0056&t=2 | |
//after https://histock.tw/stock/warrant.aspx?no=0056 |
This file contains hidden or 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
~$ for ((i=1;i<=1000;i++)); do curl "https://test.com/test.html" && sleep 3; done |
This file contains hidden or 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
Import-Module ServerManager | |
Add-WindowsFeature RSAT-AD-PowerShell | |
$DLName = "DL_Name" | |
$ADServer = "AD_Server_Name" | |
$ResultList = @() | |
$Groups = Get-ADGroup -Properties * -Filter{name -like $DLName} -Server $ADServer |Select Name, ManagedBy| | |
Foreach-Object{ | |
$Group = $_ |
This file contains hidden or 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
Import-Module ServerManager | |
Add-WindowsFeature RSAT-AD-PowerShell | |
Get-ADUser "user_name" -Properties * |
This file contains hidden or 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
nslookup -type=srv _ldap._tcp.{your_domain_name} | |
e.g. | |
nslookup -type=srv _ldap._tcp.tw.server.org | |
nslookup -type=srv _ldap._tcp.us.server.org | |
nslookup -type=srv _ldap._tcp.cn.server.org |
This file contains hidden or 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
/* | |
* Query user name | |
*/ | |
DECLARE @name SYSNAME = N' input your query account '; | |
/* | |
* For Server Roles | |
*/ | |
;with ServerPermsAndRoles as | |
( |
This file contains hidden or 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 OBJECT_SCHEMA_NAME(T.[object_id],DB_ID()) AS [Schema], | |
T.[name] AS [table_name], AC.[name] AS [column_name], | |
TY.[name] AS system_data_type, AC.[max_length], | |
AC.[precision], AC.[scale], AC.[is_nullable], AC.[is_ansi_padded] | |
FROM sys.[tables] AS T | |
INNER JOIN sys.[all_columns] AC ON T.[object_id] = AC.[object_id] | |
INNER JOIN sys.[types] TY ON AC.[system_type_id] = TY.[system_type_id] AND AC.[user_type_id] = TY.[user_type_id] | |
WHERE T.[is_ms_shipped] = 0 | |
ORDER BY T.[name], AC.[column_id] |
NewerOlder