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 | |
REM Remove files older than 14 days | |
forfiles /p "C:\Users\lmaciak\Downloads" /s /m *.* /c "cmd /c Del @path" /d -14 | |
forfiles /p "C:\Users\lmaciak\Downloads" /s /d -14 /c "cmd /c if @isdir == TRUE RMDIR /S /Q @path" |
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 | |
for /f "skip=1" %%a in ( | |
'wmic bios get serialnumber' | |
) do echo %%a & goto next | |
:next |
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 | |
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a | |
echo %NetworkIP% |
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 | |
for /f "tokens=1* delims=: " %%A in ( | |
'nslookup myip.opendns.com. resolver1.opendns.com 2^>NUL^|find "Address:"' | |
) Do set ExtIP=%%B | |
echo %ExtIP% |
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 Run CMD.EXE as Admin, then | |
assoc .py=Python.File | |
rem Assuming you installed Python via the Microsoft use below | |
rem If yuou installed Python via an installer, substitute the absolute path to the python executable | |
ftype Python.File=%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe "%1" %* |
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
if "%1" == "elevated" goto start | |
powershell -command "Start-Process %~nx0 elevated -Verb runas" | |
goto :EOF | |
:start | |
rem your code goes here |
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
#!/bin/bash | |
# This script defines environment variables which allow you to | |
# easily colorize your scripts. | |
# | |
# At the start of your bash script simply source this file like this: | |
# | |
# [ -f "$HOME/scripts/colors" ] && source $HOME/scripts/colors | |
# | |
# Then you can use all the variables to colorize output like this: |
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
#!/bin/bash | |
die() { | |
echo>&2 " Usage: makefile <filename> <size>" | |
echo>&2 " size is in format <number><unit> where unit can be K,M,G, etc... Example: 256K, 10M, 1G." | |
exit 1 | |
} | |
[ "$#" -eq 2 ] || die | |
dd if=/dev/urandom of=$1 bs=$2 count=1 |
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
#!/bin/bash | |
# Script to tunnel to a remote server from a firewall using a third | |
# server in the middle. | |
[ -f "$HOME/scripts/colors" ] && source $HOME/scripts/colors | |
USAGE="USAGE:\n\t tunnel-create $Color_Blue BOUNCE_SERVER DESTINATION$COlor_Off $Color_Cyan[BOUNCE_PORT] [DEST_PORT]$Color_Off\n\n" | |
USAGE+="\t $Color_Blue BOUNCE_SERVER$Color_Off\t - Server through which you will be tunneling\n" | |
USAGE+="\t $Color_Blue DESTINATION$Color_Off\t - Server you want to ssh into.\n" |
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
<!doctype html> | |
<html> | |
<head> | |
<title>System Status</title> | |
<style> | |
body { | |
margin-top: 50px; | |
margin-left: 25%; | |
margin-right: 25%; |