Skip to content

Instantly share code, notes, and snippets.

View c0ns0le's full-sized avatar
:octocat:
I may be slow to respond.

c0ns0le c0ns0le

:octocat:
I may be slow to respond.
View GitHub Profile
@c0ns0le
c0ns0le / Hyper-V PCI-Passthroug.ps1
Created February 17, 2022 14:46 — forked from Ruffo324/Hyper-V PCI-Passthroug.ps1
Hyper-V PCIe passthrough CheatSheet
# Change to name of TARGET-VM.
$vm='CHANGE_ME'
# Change to PCI device location (💡 Location).
$Location = 'CHANGE_ME'
# Enable CPU features.
Set-VM -GuestControlledCacheTypes $true -VMName $vm
# Host-Shutdown rule must be changed for the VM.
Set-VM -Name $vm -AutomaticStopAction TurnOff
@c0ns0le
c0ns0le / PowerShell Customization.md
Created November 2, 2021 20:28 — forked from ronokdev/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@c0ns0le
c0ns0le / gist-backup.py
Created May 31, 2021 22:16 — forked from ChristopherA/gist-backup.py
Clone or update all the GitHub gists of the current GitHub user into working directory
#! /usr/bin/env python
# Clone or update all the GitHub gists of the current GitHub user into working directory
# Originally forked from
# https://gist.github.com/joneskoo/1480022
# via https://gist.github.com/nicerobot/1622504
# https://gist.github.com/fedir/5466075
# https://gist.github.com/proski/a31d49380a38d2c45b2f
# Specify GitHub username in the GITHUB_USER environment variable, i.e.
@c0ns0le
c0ns0le / github_mirror.py
Created May 31, 2021 22:16 — forked from mgedmin/github_mirror.py
Mirror all my github repositories and gists
#!/usr/bin/env python3
# See http://stackoverflow.com/questions/3581031/backup-mirror-github-repositories/13917251#13917251
# You can find the latest version of this script at
# https://gist.github.com/4319265
import os
import sys
import json
import urllib.request
import subprocess
[wsl2]
kernel=C:\\Users\\JAKA\\vmlinux
@c0ns0le
c0ns0le / .wslconfig
Created May 15, 2021 01:53 — forked from abiosoft/.wslconfig
wsl2 config
[wsl2]
kernel= # An absolute Windows path to a custom Linux kernel.
memory= # How much memory to assign to the WSL2 VM.
processors= # How many processors to assign to the WSL2 VM.
swap= # How much swap space to add to the WSL2 VM. 0 for no swap file.
swapFile= # An absolute Windows path to the swap vhd.
localhostForwarding= # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).
# entries must be absolute Windows paths with escaped backslashes, for example C:\\Users\\Ben\\kernel
# entries must be size followed by unit, for example 8GB or 512MB
@c0ns0le
c0ns0le / setup_git.sh
Created May 15, 2021 01:52 — forked from theerebuss/setup_git.sh
Setup GitHub's SSH and GPG keys for WSL and ZSH environments
#!/bin/bash
# For WSL environments only
brew install git
password=""
echo "Please provide your Git commit info"
read -p "Full name: " fullName
read -p "Email: " email
@c0ns0le
c0ns0le / .wslconfig
Created May 15, 2021 01:49 — forked from asizikov/.wslconfig
Configure global WSL options.
#C:\Users\<yourUserName>\.wslconfig
# https://blog.cloud-eng.nl/2021/02/03/wsl2-limits-vmmem/
[wsl2]
memory=6GB # How much memory to assign to the WSL 2 VM.
processors=4 # How many processors to assign to the WSL 2 VM.
swap=1GB # How much swap space to add to the WSL 2 VM, 0 for no swap file.
localhostForwarding=true # ports bound to wildcard or localhost in the WSL 2 VM should be connectable from the host via localhost:port.
@c0ns0le
c0ns0le / .wslconfig
Created May 15, 2021 01:48 — forked from phamquocbuu/.wslconfig
Create a %UserProfile%\.wslconfig file and use it to limit memory assigned to WSL2 VM. WSL does use a really low amount of RAM but it is allocated about 4GB by default when it is started. If you think that’s too much and would like to decrease it, Windows Insider Build 18945 brough customizable settings for wsl. https://blog.simonpeterdebbarma.c…
[wsl2]
kernel=<path> # An absolute Windows path to a custom Linux kernel.
memory=<size> # How much memory to assign to the WSL2 VM.
processors=<number> # How many processors to assign to the WSL2 VM.
swap=<size> # How much swap space to add to the WSL2 VM. 0 for no swap file.
swapFile=<path> # An absolute Windows path to the swap vhd.
localhostForwarding=<bool> # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).
# <path> entries must be absolute Windows paths with escaped backslashes, for example C:\\Users\\Ben\\kernel
# <size> entries must be size followed by unit, for example 8GB or 512MB
@c0ns0le
c0ns0le / README.md
Created May 14, 2021 17:17 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp