Skip to content

Instantly share code, notes, and snippets.

@sottam
Last active April 8, 2022 17:42
Show Gist options
  • Save sottam/8786a280f7ab0cf184915cea3ea2c55a to your computer and use it in GitHub Desktop.
Save sottam/8786a280f7ab0cf184915cea3ea2c55a to your computer and use it in GitHub Desktop.
Motd ascii art used on my ubuntu dev server e script para inicialização da máquina virtual | credits to @spcmd for the DeLorean ascii art!
__---~~~~--__ __--~~~~---__ ____ __
`\---~~~~~~~~\\ //~~~~~~~~---/' / __ \___ / / ____ ________ ____ _____
\/~~~~~~~~~\|| ||/~~~~~~~~~\/ / / / / _ \/ / / __ \/ ___/ _ \/ __ `/ __ \
`\\ //' / /_/ / __/ /___/ /_/ / / / __/ /_/ / / / /
`\\ //' /_____/\___/_____/\____/_/ \___/\__,_/_/ /_/
|| || Hey Doc! / __ \___ _ __
______--~~~~~~~~~~~~~~~~~~--______ / / / / _ \ | / /
___ // _-~ ~-_ \\ ___ / /_/ / __/ |/ /
`\__)\/~ ~\/(__/' /_____/\___/|___/
_--`-___ ___-'--_ / ___/___ ______ _____ _____
/~ `\ ~~~~~~~~------------~~~~~~~~ /' ~\ \__ \/ _ \/ ___/ | / / _ \/ ___/
/| `\ /' |\ ___/ / __/ / | |/ / __/ /
| `\ ______`\_ DMC _/'______ /' | /____/\___/_/ |___/\___/_/
| `\_~-_____\ ~-________________-~ /_____-~_/' |
`. ~-__________________________________-~ .'
`. [_______/------|~~|------\_______] .' Now, if my calculations are correct,
`\--___((____)(________\/________)(____))___--/' when this baby hits 88 miles an hour,
|>>>>>>|| ||<<<<<<| you're going to see some serious shit!
`\<<<<</' `\>>>>>/'
$searchresult = .\VBoxManage.exe showvminfo DeLorean --machinereadable | Select-String -List -Pattern 'VMState="running"'
$status = If ($null -eq $searchresult) {"stopped"} Else {"running"}
if ( ($action -eq 'on') -and ($status -eq 'running') )
{
Write-Host "Opa, $VmName já está a 88 MPH!"
}
elseif ($action -eq 'on') {
Write-Host "Dando partida na máquina do tempo..."
.\VBoxManage.exe startvm $VmName --type headless
}
elseif ($action -eq 'save') {
Write-Host "Opa, parando o tempo!"
.\VBoxManage.exe controlvm $VmName savestate
}
elseif ( ($action -eq 'off') -and ($status -eq 'stopped')) {
Write-Host "$VmName já tava estacionado..."
}
elseif ($action -eq 'off') {
Write-Host "Pára o $VmName AGORA!!!"
.\VBoxManage.exe controlvm $VmName acpipowerbutton
}
Set-Location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment