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
currentTime=$(date) | |
timeStampFile="lastrun.txt" | |
#check to see if there is a timestamp file | |
if [ -f "$timeStampFile" ]; then | |
#read in last run date | |
lastRun=$(date -f "$timeStampFile") | |
#excute command and exit if it fails (dont store time) | |
/usr/openv/netbackup/bin/admincmd/bperror -d "$(date -d "$lastRun" '+%D %T')" -e "$(date -d "$currentTime -1 second" '+%D %T')" | |
#write current to last run |
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
#this is all powershell, but its using the .net Escape() | |
#i've also made it use the .net match() with similar results. | |
#based on the MSDN docs it looks like it doesnt need to escape a ], which makes sense if there is no open | |
$chars = "abcd[]." | |
"a","b" | %{ $_ -match "[$([regex]::Escape($chars))]"} | |
[regex]::Match("a","[$([regex]::Escape($chars))]").Success | |
#output is all false |
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
@{ | |
NAME=@{ | |
template=@{ | |
type="abc" | |
generator="xyz" | |
} | |
block="block" | |
material="" | |
clusterSize=123 | |
numClusters=123 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$rawVirtual = $rawLTM | ? h1 -eq "virtual" | |
$virtualData = $rawVirtual | %{ | |
#$body = $_.body -split "\n" | |
$body = $_.body |?{$_ -match '(?ms)^(\S+.+?)\{(.+)\}' }|%{$Matches[2]} | |
$persist,$profiles,$rules,$address,$port = $null | |
#persist | |
$persist = $body |?{$_ -match "(?s)\s+persist\s+\{(.+?)\}.\s+\b"} | %{$matches[1]} | |
#profiles | |
$profiles = $body |?{$_ -match "(?s)\s+profiles\s+\{(.+?)\}.\s+\b"} | %{$matches[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
RenderDevice.TripleBufferingEnable 0 | |
Thread.MaxProcessorCount 8 | |
WorldRender.TransparencyShadowmapsEnable 0 | |
WorldRender.MotionBlurEnable 0 | |
WorldRender.MotionBlurForceOn 0 | |
WorldRender.MotionBlurFixedShutterTime 0 | |
WorldRender.MotionBlurMax 0 | |
WorldRender.MotionBlurQuality 0 | |
WorldRender.MotionBlurMaxSampleCount 0 | |
WorldRender.SpotLightShadowmapEnable 0 |
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 Show-Object{ | |
param( | |
## The object to examine | |
[Parameter(ValueFromPipeline = $true)] | |
$InputObject | |
) | |
#custom controls for treeview... found it on MSDN a while ago, lost link :-/ | |
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') |
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
root 5562 1 0 10:42 ? 00:00:01 /usr/bin/dockerd | |
root 5567 5562 0 10:42 ? 00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime docker-runc | |
root 5695 5567 0 10:42 ? 00:00:00 docker-containerd-shim e45554e5265ac406110260e161f5570e6d8e9ec8ea285427d4b6a2ccc6024150 /var/run/docker/libcontainerd/e45554e5265ac406110260e161f5570e6d8e9ec8ea285427d4b6a2ccc6024150 docker-runc | |
root 5712 5567 0 10:42 ? 00:00:00 docker-containerd-shim b7416353a8bb091a435f02e186816807b777cc7370cefb6bc3422d249866f50f /var/run/docker/libcontainerd/b7416353a8bb091a435f02e186816807b777cc7370cefb6bc3422d249866f50f docker-runc | |
root 5742 5567 0 10:42 ? 00:00:00 docker-containerd-shim ea45e8aa9b5c7e0bb179d64c49e9d935dfdd3997f4d4ae3800e111907f7e6f71 /var/run/docker/libcontainerd/ea45e8aa9b5c7e0bb179d64 |
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 Import-CurrentFileAsModule | |
{ | |
[cmdletbinding()] | |
param() | |
#get paths | |
$filePath = $psise.CurrentFile.FullPath | |
$folder = split-path $filePath | |
#save if not already saved | |
if($psise.CurrentFile.IsUntitled){Write-Error "Must save file first! Sorry didn't feel like implementing the dialog box!" -ErrorAction Stop} | |
if(-not $psise.CurrentFile.IsSaved){$psise.CurrentFile.Save()} |
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 ((int) rt == 3) | |
{ | |
Report3 report3 = new Report3(); | |
int num = 66560 / inputReportBuffer.Length; | |
do | |
{ | |
Thread.Sleep(3); | |
if (this._deviceDetected) | |
{ | |
inputReportBuffer[0] = rt; |
OlderNewer