This file contains hidden or 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-RandomHexString { | |
| param($count) | |
| $hex = '012345679ABCDEF'.ToCharArray() | |
| $array = foreach($number in 1..$count ){ $hex | Get-Random} | |
| return (($array) -join "").ToString().ToLower() | |
| } | |
| function Get-WikiType{ | |
| param($file) |
This file contains hidden or 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
| for file in *; do | |
| echo $file; | |
| yearmonth=$(echo $file | grep -o '[0-9][0-9][0-9][0-9]-[0-9][0-9]') | |
| newfilename=$(echo $file | grep -o '[0-9][0-9]-[a-z].*.md$') | |
| mkdir $yearmonth | |
| mv $file $yearmonth/$newfilename | |
| done |
This file contains hidden or 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
| # WSL2 network port forwarding script v1 | |
| # for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell, | |
| # for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter. | |
| # written by Daehyuk Ahn, Aug-1-2020 | |
| # Display all portproxy information | |
| If ($Args[0] -eq "list") { | |
| netsh interface portproxy show v4tov4; | |
| exit; | |
| } |
This file contains hidden or 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
| #!/usr/bin/env node | |
| var args = process.argv; | |
| const os = require('os'); | |
| console.log('Système :',os.platform(), args[2]) |
This file contains hidden or 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
| # check if git is installed | |
| hash git >/dev/null && /usr/bin/env git clone git://github.com/kaochenlong/eddie-vim.git ~/.vim || { | |
| echo "sorry, git is not installed in this machine." | |
| exit | |
| } |
This file contains hidden or 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
| write-host "`n ## NODEJS INSTALLER ## `n" | |
| ### CONFIGURATION | |
| # nodejs | |
| $version = "4.4.7-x64" | |
| $url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi" | |
| # git | |
| $git_version = "2.9.2" |
This file contains hidden or 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
| $ServiceExe = "MyService.exe" | |
| $ServiceName = "MyService" | |
| $ServiceDisplayName = "MyService DisplayName" | |
| $ServiceBinPath = [System.IO.Path]::GetFullPath($ServiceExe) | |
| & sc.exe delete $ServiceName | |
| & sc.exe create $ServiceName binPath= "`"$ServiceBinPath`"" DisplayName= "`"$ServiceDisplayName`"" | |
| & sc.exe start $ServiceName |
This file contains hidden or 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
| &{ | |
| (New-Object System.Net.WebClient).DownloadFile( | |
| "https://download.sysinternals.com/files/SysinternalsSuite.zip", | |
| "$env:TEMP\SysinternalsSuite.zip") | |
| $Shell = New-Object -com shell.application | |
| $Zip = $Shell.NameSpace("$env:TEMP\SysinternalsSuite.zip") | |
| New-Item -ItemType Directory -Force -Path "$env:ProgramFiles\SysinternalsSuite" | |
| $Shell.Namespace("$env:ProgramFiles\SysinternalsSuite").CopyHere($Zip.Items()) | |
| [Environment]::SetEnvironmentVariable( | |
| "Path", |
This file contains hidden or 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 PFX file dialog | |
| [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null | |
| $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
| $OpenFileDialog.Title = "Select SSL Certificate in PFX format" | |
| $OpenFileDialog.Filter = "Personal Information Exchange (*.pfx)|*.pfx" | |
| $OpenFileDialog.ShowDialog() | Out-Null | |
| $PFXFile = $OpenFileDialog.FileName | |
| # Get password dialog |
This file contains hidden or 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 | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Must be root" | |
| exit | |
| fi | |
| if [[ $# -lt 1 ]]; | |
| then echo "You need to pass a password!" | |
| echo "Usage:" |
NewerOlder