A Pen by Karl Danninger on CodePen.
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
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>" | |
# Start Script | |
Set-ExecutionPolicy RemoteSigned | |
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine | |
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath) | |
{ | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null |
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
#https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md | |
# Install IIS (with Management Console) | |
Install-WindowsFeature -name Web-Server -IncludeManagementTools | |
# Install ASP.NET 4.6 | |
Install-WindowsFeature Web-Asp-Net45 | |
# Install Web Management Service | |
Install-WindowsFeature -Name Web-Mgmt-Service |
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
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
cinst -y --ignore-checksums` | |
choco feature enable -n=allowGlobalConfirmation | |
choco install googlechrome | |
choco install firefox | |
choco install brave | |
choco install greenshot | |
choco install microsoft-teams | |
choco install octopustools | |
choco install flashplayerplugin |
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
USE BizActorMDBImport | |
DECLARE @SearchStr nvarchar(100) = '90_120' | |
DECLARE @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) | |
SET NOCOUNT ON | |
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) | |
SET @TableName = '' | |
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''') |
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
@ECHO off | |
SETLOCAL | |
:: DateMath, a general purpose date math routine | |
:: If DateMath detects an error, variable _dd_int is set to 999999. | |
SET v_dd_int=0 | |
SET v_mm_int=0 | |
SET v_yy_int=0 | |
SET v_ymd_str= | |
SET v_mm_str= |
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
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux |
aws cloudformation create-stack --stack-name hogehoge --template-body file://conf.yaml --region ap-northeast-1 --parameters file://param.yaml
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
## Snagged from https://stackoverflow.com/a/20983251 | |
# Black 0;30 Dark Gray 1;30 | |
# Red 0;31 Light Red 1;31 | |
# Green 0;32 Light Green 1;32 | |
# Brown/Orange 0;33 Yellow 1;33 | |
# Blue 0;34 Light Blue 1;34 | |
# Purple 0;35 Light Purple 1;35 | |
# Cyan 0;36 Light Cyan 1;36 | |
# Light Gray 0;37 White 1;37 |
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
# snagged from https://stackoverflow.com/a/30988704 | |
# Use the mapfile command: | |
mapfile -t myArray < file.txt | |
# The error is using for -- the idiomatic way to loop over lines of a file is: | |
while IFS= read -r line; do echo ">>$line<<"; done < file.txt |