Skip to content

Instantly share code, notes, and snippets.

View A-725-K's full-sized avatar
🐢
It's a long (and slow) way to the top if you wanna rock'n'roll !

Andrea Canepa A-725-K

🐢
It's a long (and slow) way to the top if you wanna rock'n'roll !
View GitHub Profile
@A-725-K
A-725-K / the_day_I_understood_channels.go
Created July 19, 2023 07:56
eureka-about-golang-channels
package main
import (
"fmt"
"math/rand"
"time"
"flag"
)
const (
@A-725-K
A-725-K / docker_clean_none_images.sh
Created August 29, 2021 15:24
Utility to clean all the <none> images accumulated in docker
#!/bin/bash
images=$(docker image ls | tail +2 | grep '<none>' | awk '{print $3}')
echo -e "*** This script will remove the following <none> images: ***\n\n$images\n"
read -p 'Are you sure? [y/N] ' choice
if [[ $choice == "y" ]] || [[ $choice == "Y" ]]; then
echo -e "\nRemoving the images"
docker image rm $images
@A-725-K
A-725-K / VM-WSL_swithcer.ps1
Last active July 19, 2023 08:16
Utility to switch between WSL and Virtual Machines (it requires admin privileges)
#Requires -RunAsAdministrator
# getting the Hypervisor Launch type
$hypervType = $null;
(bcdedit /enum '{current}' | ForEach-Object -process {
$tmp = $($_.split(' ') | Sort-Object | Get-Unique);
If ($tmp.Count -eq 3 -And $tmp[1] -eq 'hypervisorlaunchtype') {
$hypervType = $($tmp[2]);
}
}