Skip to content

Instantly share code, notes, and snippets.

View Erisa's full-sized avatar
💕

Erisa A Erisa

💕
View GitHub Profile
@Erisa
Erisa / seafile_trash.rb
Last active March 22, 2021 01:54
Restore everything from trash in seafile
# frozen_string_literal: true
require 'json'
require 'net/http'
libs = [
"aa3ffa6f-61d3-4cda-bf7d-89a856068fc3",
"563aa837-4865-4e4e-b0aa-6333c2634c64",
"385275da-c656-4f2f-918a-d4190828ae20",
'c50d9d60-5478-4c27-89d5-b3c6d1708438',
@Erisa
Erisa / hlg.cr
Created November 11, 2020 17:01
Hard Link Generator
#!/bin/env -S crystal build
# Hard Link Generator
# Generates hard links for all files in a given folder,
# while also finding and replacing strings in the filenames.
#
# The folder is created for you, but existing files (Running it twice?) will cause errors.
#
# Usage:
@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.
@Erisa
Erisa / cfd-termux.sh
Last active April 17, 2024 13:01
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 / 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 / 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 / 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 / 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 / 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 / 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)