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
Set-PSReadLineKeyHandler -Chord "Alt+k" -ViMode Insert ` | |
-ScriptBlock { | |
param($Key, $Arg) | |
$Level = 1 | |
[Microsoft.PowerShell.PSConsoleReadLine]::TryGetArgAsInt($Arg, ` | |
[ref]$Level,1) | |
Set-Location -Path (( 1..$Level |% { '..'}) -join '\') } ` | |
-Description "Move to Parent Directory" | |
Set-PSReadLineKeyHandler -Chord "Alt+k" -ViMode Command ` | |
-ScriptBlock { |
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
Set-PSReadLineKeyHandler -Chord "c,i" -ViMode Command -ScriptBlock { VIChangeInnerBlock } | |
Set-PSReadLineKeyHandler -Chord "c,a" -ViMode Command -ScriptBlock { VIChangeOuterBlock } | |
Set-PSReadLineKeyHandler -Chord "d,i" -ViMode Command -ScriptBlock { VIDeleteInnerBlock } | |
Set-PSReadLineKeyHandler -Chord "d,a" -ViMode Command -ScriptBlock { VIDeleteOuterBlock } | |
Set-PSReadLineKeyHandler -Chord "c,s" -ViMode Command -ScriptBlock { VIChangeSurround } | |
Set-PSReadLineKeyHandler -Chord "d,s" -ViMode Command -ScriptBlock { VIDeleteSurround } | |
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -ViMode Command ` | |
-ScriptBlock { VIIncrement $args[0] $args[1] } | |
Set-PSReadLineKeyHandler -Chord "Ctrl+x" -ViMode Command ` | |
-ScriptBlock { VIDecrement $args[0] $args[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
Set-PSReadLineKeyHandler -VIMode Command -Key $(@{$False="\";$True=$EditKey}[$(Test-Path Variable:EditKey)]) -ScriptBlock { | |
if( Get-Command $EDITOR){ | |
# Grab BufferLine | |
$Line = $Null | |
$Cursor = $Null | |
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$Line, [ref]$Cursor) | |
# Launch Editor with temporary file | |
$File = New-TemporaryFile | |
Set-Content -Path $File -Value $Line | |
if($EDITOR -match '[ng]?vim?'){ |
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
#requires -Version 2 -Modules posh-git | |
$Global:ThemeSettings.PromptSymbols.PromptIndicator = '%' | |
$Global:ThemeSettings.PromptSymbols.ElevatedSymbol = "#" | |
$Global:ThemeSettings.PromptSymbols.SegmentForwardSymbol = [char]::ConvertFromUtf32(0xE0B0) | |
$Global:ThemeSettings.Colors.PromptForegroundColor = [ConsoleColor]::White | |
$Global:ThemeSettings.Colors.PromptSymbolColor = [ConsoleColor]::White | |
$Global:ThemeSettings.Colors.PromptHighlightColor = [ConsoleColor]::DarkBlue | |
$Global:ThemeSettings.Colors.GitForegroundColor = [ConsoleColor]::Black | |
$Global:ThemeSettings.Colors.WithForegroundColor = [ConsoleColor]::DarkRed |
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
###################################################################### | |
# SCRIPT: Test-CodeQuality.ps1 # | |
###################################################################### | |
# Purpose # | |
# Script to check formatting and best practice before committing # | |
###################################################################### | |
# Author : Nicolas # | |
###################################################################### | |
# ChangeLog # | |
# 20201026 - Initial Release # |
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: Prompt # | |
############################################################ | |
# Redefine Prompt setting new color for new sessions # | |
# and setting username, servername, PID and WS as title # | |
# TODO: Customisable prompt FIXED/ # | |
# TODO: Add Domain Information #D DONE/ # | |
############################################################ | |
function Prompt { | |
<# |
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
pkg info | grep php | grep 5.4 | awk '{print $1}' | awk -F '-5.4' '{a = $1 ; sub("5","56",a) ; print "portmaster -y -D -o ` find /usr/ports -name "a" -print | sed \"s/\\/usr\\/ports\\///\"` "$1}' | 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
{ | |
"extractors": [ | |
{ | |
"condition_type": "string", | |
"condition_value": "activation request", | |
"converters": [], | |
"cursor_strategy": "copy", | |
"extractor_config": { | |
"regex_value": ".*0x[0-9a-f]+,\\d+,([^,]+),[0-9a-f\\-]+,[^,]+,\\d,\\d,\\d+,[0-9a-f\\-]+.*" | |
}, |
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
<html><head><title>Ajouter device par lot</title></head><body> | |
<?php | |
if(!isset($_POST['add']) && !isset($_FILES['csv']) && !isset($_POST['ds_add'])){ | |
?> | |
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> | |
<label>Fichier CSV</label> <input type="hidden" name="MAX_FILE_SIZE" value="204800" /><input type="file" name="csv"/><br/> | |
<input type="submit" name="ok" value="Envoyer"/> | |
</form> | |
<?php | |
}elseif(isset($_POST['add'])){ |
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
get-xaserver |% { | |
gwmi Win32_Service -ComputerNAme $_.ServerName -Filter 'Name="cpsvc"' |% { | |
if(sc.exe \\$($_.__SERVER) qfailure $($_.name) | select-string 'FAILURE'){ | |
"$($_.__SERVER) OK" | |
}else{ | |
sc.Exe \\$($_.__SERVER) failure $($_.name) reset= 86400 actions= restart/60000/restart/60000 | |
"$($_.SERVER) Set" | |
} | |
} |
NewerOlder