View shrew-soft-shortcut.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
rem http://www.shrew.net/ | |
"C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r "VPN Profile Name" -u "Username" -p "Password" -a |
View spaceused.sql
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
declare @SpaceUsed table (TableName sysname, NumRows bigint, ReservedSpace varchar(50), DataSpace varchar(50), IndexSize varchar(50), UnusedSpace varchar(50)) | |
declare @str varchar(500) | |
set @str = 'exec sp_spaceused ''?''' | |
insert into @SpaceUsed | |
exec sp_msforeachtable @command1=@str | |
select TableName, | |
FORMAT(CAST(NumRows as bigint), 'N0') as NumRows, | |
FORMAT(CAST(REPLACE(ReservedSpace, ' KB', '') as bigint), 'N0') + ' KB' as ReservedSpace, |
View aws_console_sso_accountname.js
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
// ==UserScript== | |
// @name AWS Console - Show AWS Account Name | |
// @match https://*.console.aws.amazon.com/* | |
// @grant none | |
// @version 1.0 | |
// @description Shows AWS account name in upper right of menu bar for a quick view of current context. | |
// @author Bernd VanSkiver | |
// @homepage https://gist.github.com/bvanskiver/daf63ac7fe3cd22943f164f40d3daef6 | |
// ==/UserScript== |
View aws_console_sso_all.js
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
// ==UserScript== | |
// @name AWS Console - Open All SSO Accounts | |
// @match https://*.awsapps.com/start* | |
// @grant none | |
// @version 1.0 | |
// @author Bernd VanSkiver | |
// @description Open all accounts and roles on AWS Console SSO screen used by AWS IAM Identity Center. | |
// @homepage https://gist.github.com/bvanskiver/3093ded045b4c2db01fdc1601ef498ef | |
// ==/UserScript== |
View git-helpers.sh
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
# Pull latest on all repos | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git pull | |
else | |
echo "Not a git repository, skipping."; | |
fi | |
cd .. && echo | |
done |
View aws-subnet-usage.cmd
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
aws ec2 describe-network-interfaces --filters "Name=subnet-id,Values=[subnet-id]" --query "NetworkInterfaces[*].[PrivateIpAddress,Description]" |
View git-clean-merged-branches.sh
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
# Iterate through folders of git repos and show merged branches older than 3 months | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git fetch --prune --quiet origin && | |
for k in $(git branch -r --merged | egrep -v 'HEAD|main|master'); do | |
if [ -z "$(git log -1 --since='3 months ago' -s $k)" ]; then | |
echo -e `git show --format="%ci %cr %an" $k | head -n 1` \\t$k; | |
fi | |
done | sort -r |
View progress.sql
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 r.session_id as SPID, r.command, r.[status], | |
FORMAT(r.percent_complete, 'n0') + '%' as percent_complete, | |
FORMAT(r.start_time, 'MM/dd/yyyy hh:mm:ss tt') as start_time, | |
FORMAT(r.total_elapsed_time / 3600000 % 60, '00') + ':' + FORMAT(r.total_elapsed_time / 60000 % 60, '00') + ':' + FORMAT(r.total_elapsed_time / 1000 % 60, '00') as elapsed_time, | |
FORMAT(DATEADD(MILLISECOND, r.estimated_completion_time, GETDATE()), 'MM/dd/yyyy hh:mm:ss tt') as estimated_completion_time, | |
FORMAT(r.estimated_completion_time / 3600000 % 60, '00') + ':' + FORMAT(r.estimated_completion_time / 60000 % 60, '00') + ':' + FORMAT(r.estimated_completion_time / 1000 % 60, '00') as estimated_time_remaining, | |
FORMAT(DATEADD(MILLISECOND, r.estimated_completion_time, GETDATE()) - r.start_time, 'hh:mm:ss') as estimated_total_time | |
from sys.dm_exec_requests r |
View nuget-export.ps1
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
Find-Package -AllVersions -AllowPrereleaseVersions -Source "<Source URL>" | Install-Package -Destination "C:\tmp" -SkipDependencies |
View zip-folders.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
REM Package folder named .\1001\ in to zip file, use the * at the end to keep from creating a base folder in the zip file. | |
"C:\Program Files\7-Zip\7z.exe" a -tzip 1001.zip .\1001\* | |
REM Build single zip file for each folder in current directory. | |
for /D %d in (*) do "C:\Program Files\7-Zip\7z.exe" a "%d.zip" ".\%d\*" | |
REM Build single zip file for each folder in current directory and keep folder in root. | |
for /D %d in (*) do "C:\Program Files\7-Zip\7z.exe" a "%d.zip" ".\%d\" |
NewerOlder