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
using System; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using System.Runtime.Serialization; | |
using System.IO; | |
namespace ConsoleApp | |
{ | |
[Serializable] | |
class MyClass | |
{ |
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 | |
{ | |
$username = $env:UserName | |
$computer = $env:ComputerName | |
$currentFolder = (Get-Item -Path .).Name | |
$isGitFolder = (git rev-parse --git-dir 2> $null) | |
$currentTime = Get-Date -Format HH:mm | |
Write-Host "$username@$computer"-nonewline -foregroundcolor Green | |
Write-Host "[$currentTime]" -nonewline -ForegroundColor Gray | |
Write-Host " $currentFolder"-nonewline -foregroundcolor Cyan |
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
param( | |
[Parameter(Mandatory=$true)][string]$VMName, | |
[Parameter(Mandatory=$false)][string]$ComputerName = $env:computerName | |
) | |
#based on http://serverfault.com/questions/619763/can-pxe-boot-of-hyper-v-vms-be-disabled | |
$old_boot_order = Get-VMFirmware -VMName $VMName -ComputerName $ComputerName | Select-Object -ExpandProperty BootOrder | |
$new_boot_order = $old_boot_order | Where-Object { $_.BootType -ne "Network" } | |
Set-VMFirmware -VMName $VMName -ComputerName $ComputerName -BootOrder $new_boot_order |
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
#based on po75558Manuel Patrone comment on https://forums.docker.com/t/how-can-i-ssh-into-the-betas-mobylinuxvm/10991/8 | |
#get a privileged container with access to Docker daemon | |
docker run --privileged -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker alpine sh | |
#run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff) | |
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh | |
#switch to host FS | |
chroot /host |
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
#!/bin/bash | |
set -o errexit | |
echo "Removing exited docker containers..." | |
docker ps -a -f status=exited -q | xargs -r docker rm -v | |
echo "Removing dangling images..." | |
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi |