Skip to content

Instantly share code, notes, and snippets.

View valorad's full-sized avatar
🤕
è

Valorad the Oneiroseeker valorad

🤕
è
  • SCET
  • Dhirim
View GitHub Profile
@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 / mongoBackup.sh
Last active January 8, 2022 00:44
Mongo Backup Collection
mongoContainerOutput="/path/to/container/output/folder"
hostOutput="/path/to/host/output/folder"
mongoUser="root"
mongoPassword='mongo-db-user-password'
mongoHost="127.0.0.1:27017"
mongoCollectionAuth="admin"
mongoCollectionDB="dbCollectionName"
dockerContainer="mongo_5_1"
@valorad
valorad / deepMerge.ts
Created August 18, 2020 17:46
Deep Merge TypeScript
const isObject = (obj: any) => obj && typeof obj === 'object';
const deepMergeInner = (target: any, source: any) => {
Object.keys(source).forEach((key: string) => {
const targetValue = target[key];
const sourceValue = source[key];
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
target[key] = targetValue.concat(sourceValue);
} else if (isObject(targetValue) && isObject(sourceValue)) {
@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 / pwsh-nonroot.ps1
Created February 8, 2020 14:00
Windows non-root shell
RUNAS /trustlevel:"0x20000" powershell
@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 / 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 / 🤬.exe
Created August 28, 2019 03:46
🤬
🤬
@valorad
valorad / vMountSF.sh
Last active January 22, 2019 02:18
Mount Virtual Box Shared Folder to workspace as a non-root user (uid=1000, gid=1000)
sleep 5
sfs=`ls /media`
for folder in ${sfs[@]}; do name=${folder#*sf_}; mkdir -p /workspace/$name; mount -t vboxsf -o uid=1000,gid=1000 $name /workspace/$name; done
# usage
# - Create shared folders from virtualbox interface. No need to auto-mount
@valorad
valorad / pcProbe.ps1
Created November 3, 2018 23:53
Probe Windows PC Info
$output = "./awesomeLibLaptop.txt"
Get-CimInstance -ClassName Win32_Desktop -ComputerName . >> $output
Get-CimInstance -ClassName Win32_Desktop -ComputerName . >> $output
Get-CimInstance -ClassName Win32_BIOS -ComputerName . >> $output
Get-CimInstance -ClassName Win32_Processor -ComputerName . >> $output
Get-CimInstance -ClassName Win32_ComputerSystem >> $output
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName . >> $output
Get-CimInstance -ClassName Win32_LogicalDisk >> $output
Get-CimInstance -ClassName Win32_LogonSession >> $output