Skip to content

Instantly share code, notes, and snippets.

View bitroniq's full-sized avatar

Piotr Kowalski bitroniq

View GitHub Profile
@nikAizuddin
nikAizuddin / podman-installation-on-ubuntu-2004-wsl2.md
Last active April 22, 2024 13:46
Podman Installation on Ubuntu 20.04 WSL2

Podman Installation on Ubuntu 20.04 WSL2

Execute the following command to install Podman:

sudo apt update
sudo apt install ca-certificates
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt update
@albasyir
albasyir / axios-cheatsheet.md
Created March 21, 2021 04:31
Axios much better now as....

GET

// Make a request for a user with a given ID
axios.get('/user?ID=12345')
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
@coderofsalvation
coderofsalvation / playaudio.ps1
Created October 28, 2020 10:16
hasslefree playing mp3 wav audio in Windows 10 WSL
#!/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -noexit
# Play a single file
# Usage:
# LINUX: timeout 5 ./playaudio.ps1 "c:\Users\Leon\Downloads\bensound-allthat.mp3" &>/dev/null &
# CMD.EXE: powershell.exe -noexit ./playaudio.ps1 "c:\Users\Leon\Downloads\bensound-allthat.mp3"
Add-Type -AssemblyName presentationCore
$mediaPlayer = New-Object system.windows.media.mediaplayer
$mediaPlayer.open( $args[0] )
$mediaPlayer.Play()
@danackerson
danackerson / post-ipsec-passthrough.sh
Created October 18, 2020 09:35
custom leftupdown IPSec script
#!/bin/sh
# default updown script
#
# Copyright (C) 2003-2004 Nigel Meteringham
# Copyright (C) 2003-2004 Tuomo Soini
# Copyright (C) 2002-2004 Michael Richardson
# Copyright (C) 2005-2007 Andreas Steffen <andreas.steffen@strongswan.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@fevangelou
fevangelou / Software RAID 1 setup on Ubuntu Server 20.04.md
Last active March 1, 2024 01:02
Software RAID 1 setup on Ubuntu Server 20.04 (or newer)

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration step of the installer.
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
@ianfinch
ianfinch / rpi4-usb.sh
Last active March 5, 2024 17:55
Raspberry Pi 4 USB Gadget
#!/bin/bash
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget
# Based on:
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/
# - https://pastebin.com/VtAusEmf
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then
echo "Add the line dtoverlay=dwc2 to /boot/config.txt"
exit
fi
@c-goes
c-goes / hyper-v-ubuntu.md
Last active February 18, 2021 14:22
Hyper-V: Install Ubuntu 19.10 including clipboard integration via xrdp
curl -O https://raw.githubusercontent.com/microsoft/linux-vm-tools/master/ubuntu/18.04/install.sh
chmod +x install.sh
sudo ./install.sh
reboot
sudo ./install.sh
shutdown -h now

Open PowerShell with Admin privileges

@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active May 4, 2024 00:19
Ubuntu and Debian Cloud images in Proxmox