A Pen by Sascha Trebbin on CodePen.
A Pen by Sascha Trebbin on CodePen.
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
# Append to ~/.bash_history instead of overwriting it -- this stops terminals | |
# from overwriting one another's histories. | |
shopt -s histappend | |
# Only load the last 1000 lines from your ~/.bash_history -- if you need an | |
# older entry, just grep that file. | |
HISTSIZE=1000 | |
# Don't truncate ~/.bash_history -- keep all your history, ever. | |
unset HISTFILESIZE | |
# Add a timestamp to each history entry. | |
HISTTIMEFORMAT="%Y/%m/%d %H:%M:%S " |
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
setlocal EnableDelayedExpansion | |
REM Script für Backup von einer "Windows XP Mode" VM unter Windows 7 | |
vm-diff-sourcedir="" | |
vm-base-sourcedir="" | |
target-dir="" | |
IF %1 EQU "backup" GOTO backup | |
IF %1 EQU "restore" GOTO restore | |
:backup |
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
function Get-NetworkStatistics | |
{ | |
[OutputType('System.Management.Automation.PSObject')] | |
[CmdletBinding(DefaultParameterSetName='name')] | |
param( | |
[Parameter(Position=0,ValueFromPipeline=$true,ParameterSetName='port')] | |
[System.String]$Port='*', | |
[Parameter(Position=0,ValueFromPipeline=$true,ParameterSetName='name')] |
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
# Store string for computer name | |
$Computer = read-host "Enter Computer Name:" | |
# Query computer using WMI and return selected values | |
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $Computer | Select-Object -Property PSComputerName,IPAddress,DefaultIPGateway,DNSServerSearchOrder,DHCPEnabled,DHCPServer,DNSHostName,IPSubnet,MACAddress |
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 | |
echo Stopping print spooler. | |
echo. | |
net stop spooler | |
echo deleting temp files. | |
echo. | |
del %windir%\system32\spool\printers\*.* /q | |
echo Starting print spooler. | |
echo. | |
net start spooler |
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
$newName = "NewName" | |
$oldName = gc env:computername | |
$Computer = Get-WmiObject Win32_ComputerSystem -ComputerName $oldName | |
$r = $Computer.Rename($newName, "Pa55w0rd", "DOMAIN\adminuser") | |
echo "Exit code: " $ret.ReturnValue | |
exit $r.ReturnValue |
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
mode con:cols=90 lines=25 | |
@echo off | |
title=Remote Kill ^| © 2012 Ryan Jones v0.01 | |
:start | |
set sessionid= | |
set host= | |
:enterhn | |
color 0F | |
cls | |
echo. |
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
Function Start-CountDown | |
{ <# | |
.SYNOPSIS | |
Simple sleep function with a visual countdown. | |
.DESCRIPTION | |
Simple function that will sleep the script for the designated time, and give | |
a visual countdown to the user. You can specify the countdown message and | |
time in seconds. The current number of seconds left will be displayed at the | |
end of your message. | |
NewerOlder