Skip to content

Instantly share code, notes, and snippets.

View valorad's full-sized avatar
🤕
è

Valorad the Oneiroseeker valorad

🤕
è
  • SCET
  • Dhirim
  • 20:51 (UTC -04:00)
View GitHub Profile
@valorad
valorad / This site is built with _____?.url
Last active December 10, 2019 02:45
This site is built with _____?
javascript:window.open(`https://builtwith.com/${(new URL(location.href)).hostname}`, "_blank");
@valorad
valorad / configuration.nix
Created December 31, 2019 19:52
nix configs
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@valorad
valorad / pwsh-nonroot.ps1
Created February 8, 2020 14:00
Windows non-root shell
RUNAS /trustlevel:"0x20000" powershell
@valorad
valorad / copyKernelToEFI.sh
Created September 29, 2020 21:15
Copy Kernel To ESP
filesToCopy=("initramfs-linux-lts-fallback.img" "initramfs-linux-lts.img" "vmlinuz-linux-lts")
for file in ${filesToCopy[@]}; do
cp /boot/$file /boot/efi/EFI/arch/
done
@valorad
valorad / mountWinVolume.sh
Last active October 23, 2020 04:35
Windows Linux Subsystem mount NTFS folder volume
directory="/mnt/c/workspace"
fileEntries=`ls $directory`
for file in ${fileEntries[@]}
do
if [[ -L "$directory/$file" ]]
then
sudo mkdir -p /mnt/$file
sudo mount -t drvfs C:\\workspace\\$file /mnt/$file -o metadata,uid=1000,gid=1000,umask=22,fmask=002
fi
@valorad
valorad / setNestedKey.ts
Created October 23, 2020 21:40
TypeScript set nested key
/**
* Sets a value of nested key string descriptor inside a Object.
* It changes the passed object.
* Ex1:
* let obj = {a: {b:{c:'initial'}}};
* setNestedKey(obj, ['a', 'b', 'c'], 'changed-value');
* assert(obj === {a: {b:{c:'changed-value'}}});
*
* Ex2:
* let obj = null;
@valorad
valorad / docker_mongo_Init.md
Last active October 23, 2020 21:44 — forked from wcxaaa/docker_mongo_Init.md
Dockerized mongoDB initialization

First, create a mongod config file. e.g.

# Where and how to store data.
storage:
  dbPath: /data/db
  journal:
 enabled: true
@valorad
valorad / linkOn.ps1
Created October 31, 2020 00:37
Link Windows user directory folders to somewhere else
Write-Host "==============================================================="
Write-Host "=========================== Link On ==========================="
Write-Host "==============================================================="
# Configs -->
$linkConfig = [ordered]@{
"originFolder1" = "D:\test\targetFolder1"
"originFolder2" = "D:\test\targetFolder2"
}
@valorad
valorad / fishReadProfile.md
Last active November 13, 2020 23:25
Help fish user desktop find those installed flatpak/snapd apps

Help fish user desktop find those installed flatpak/snapd apps

Fish (friendly interactive shell) users find themselves losing their installed snapd/flatpak apps after restarting the desktop.

These apps can be run with respective commands. However, they are unable to be found at the desktop menu. They cannot associate default apps either.

What's happening?

If you are also a fish user, when you run flatpak update, you get this:

@valorad
valorad / sysVolumeCheckIn.sh
Last active March 27, 2021 13:31
Mount BTRFS volumes and make a read-only system volume BTRFS snapshot on backup volume
#!/bin/sh
set -e
# Snapshot @targetSubvolume to @storageSubvolume/path/to/checkpoints/folder
UUID='76186cef-780f-4a80-9c0f-19fcc3a53ee6'
targetSubvolumeName='@arch-root'
storageSubvolumeName='@workspace'
mountPath="/mnt/$UUID"