Skip to content

Instantly share code, notes, and snippets.

View Erisa's full-sized avatar
💕

Erisa A Erisa

💕
View GitHub Profile
@Erisa
Erisa / pwsh-u1804.sh
Last active December 28, 2019 11:10
Install Powershell on Ubuntu 18.04 x64
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1804
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
rm -v packages-microsoft-prod.deb
# Update the list of products
@Erisa
Erisa / prompt.ps1
Last active January 1, 2020 10:03 — forked from Ovyerus/prompt-preview.png
Hot powershell prompt
function prompt {
$lastCmdFailed = !$?;
$asciiSymbols = $true # If your terminal doesn't display unicode properly
# Cause $IsWindows and shit doesn't exist on current Windows Powershell version
$windows = $IsWindows -or $env:OS -eq 'Windows_NT'
if ($windows) {
$admin = [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match 'S-1-5-32-544')
$name = $env:UserName
@Erisa
Erisa / config.fish
Created February 16, 2020 01:12 — forked from Ovyerus/config.fish
Sexy fish prompt
set -g symb '▲'
set -g leading_brace 0
set -g has_launched 0
function git_info
set -l branch (git rev-parse --abbrev-ref HEAD 2> /dev/null)
printf "%s(%s%s%s)" $c0 $c1 $branch $c0
set -l changes (git status --porcelain --ignore-submodules 2> /dev/null)
@Erisa
Erisa / debian64pi-headers.sh
Last active August 9, 2020 23:22
headers for debian64pi
# assuming 4.19.93-v8-9ee95326a181-p4+ / 4.19.93.20200107
wget https://codeload.github.com/raspberrypi/linux/tar.gz/9ee95326a1811c97f505f00aa7328e81dfdbd01b -O 9ee95326a1811c97f505f00aa7328e81dfdbd01b.tar.gz
tar -xvf 9ee95326a1811c97f505f00aa7328e81dfdbd01b.tar.gz
cd linux-9ee95326a1811c97f505f00aa7328e81dfdbd01b
wget https://raw.githubusercontent.com/sakaki-/bcm2711-kernel/ad799827a051f068a4000c97e914fec07ea644b2/config -O .config
sudo apt-get -y install build-essential flex libssl-dev
make -j4 prepare
make -j4 modules_prepare
sudo ln -s $PWD /lib/modules/4.19.93-v8-9ee95326a181-p4+/build
@Erisa
Erisa / ssh.bat
Last active October 26, 2021 20:56
WSL wrapper that runs commands in WSL context with paths converted. For PERSONAL use.
@echo off
REM change this files filename to the name of the program you want to launch.
REM for example if its called 'ssh.bat' it will run ssh in wsl when launched.
REM w.exe is w.js but built with 'npm i -g pkg' and 'pkg w.js -t host'
REM you could also just use node normally but i'm weird.
\path\w.exe %~n0 %*
@Erisa
Erisa / wgi.ps1
Created May 30, 2020 06:31
wgi: install multiple winget packages at once
$numOfArgs = $args.Length
for ($i=1; $i -le $numOfArgs; $i++)
{
$target = $($args[$i-1])
write-host "Trying: $($target)"
winget install $args[$i-1]
write-host "Finished trying: $($target)"
}
@Erisa
Erisa / kr-alpine.sh
Created September 25, 2020 19:34
Install krypton's kr client on Alpine Linux
#!/bin/sh
if [ $(id -u) -ne 0 ]
then echo "-- This script only works when run as root. --"
exit
fi
echo "-- installing dependancies: go make sudo git"
apk add go make sudo git
@Erisa
Erisa / kr-termux.sh
Last active June 26, 2021 02:05
Install krypton's kr client on Termux
#!/bin/sh
echo "--upgrading packages" &&
pkg update -y &&
echo "-- installing dependancies: golang git debianutils make" &&
pkg install golang git debianutils make -y &&
echo "-- installing fake sudo binary (no root needed, just to appease kr's build script)" &&
echo '#!/bin/sh
@Erisa
Erisa / cfd-termux.sh
Last active May 13, 2024 06:24
Install the Cloudflare Daemon (cloudflared) in Termux
#!/bin/sh
echo 'NOTE: You can now install cloudflared directly from Termux repos.'
echo 'NOTE: To install it from source instead, open the script and comment out the next two lines.'
pkg install cloudflared
exit
# ^ comment out these lines to proceed with the script
echo "--upgrading packages"
yes "" | pkg update
@Erisa
Erisa / tunnel.cr
Last active December 24, 2020 02:08
A small wrapper around Cloudflared that creates a tunnel based on the given local and remote(optional) endpoints.
###########################################################################
# A small wrapper around Cloudflared that creates #
# a tunnel based on the given local and remote(optional) endpoints. #
# License: https://unlicense.org/ #
###########################################################################
## Config
# Under Windows+WSL you'll want to use .exe here.
# Since that's what I use personally it's the default.