Skip to content

Instantly share code, notes, and snippets.

View Surreal9's full-sized avatar

John Arnold Surreal9

  • Hypergiant
  • Canada
View GitHub Profile
@Surreal9
Surreal9 / .bashrc
Created January 12, 2023 01:47
npm run alias with autocomplete
alias nr="npm run"
_npm_scripts() {
# check package.json file in current directory
if [ ! -f ./package.json ]; then
return
fi
local scripts="$(node -e 'const { scripts } = require(`./package.json`); if (!scripts) process.exit(); let a = Object.entries(scripts); for (let s in scripts) { console.log(s); }' | grep -E ^$2)"
local -a toks
@Surreal9
Surreal9 / README.md
Last active September 23, 2021 15:26
Postgres WAL continuous archiving
@Surreal9
Surreal9 / setup.sh
Last active June 23, 2021 23:35
ubuntu 20.10 setup
sudo apt-get install -y tilix build-essential autoconf curl xclip chrome-gnome-shell git apt-transport-https
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
#curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
#echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
#sudo apt update && sudo apt install --no-install-recommends yarn
# Check out https://apt.syncthing.net/ probably has instructions like:
@Surreal9
Surreal9 / home-end.ahk
Created August 14, 2020 22:24
autohotkey script for home/end/page up/page down
; Ensures a consistent starting directory.
SetWorkingDir %A_ScriptDir%
; -----------------------------------------------------------
; Sane Navigation Shortcuts with Alt
;
; An easier and more consistent way to send PgUp/PgDown/
; Home/End for laptops with no dedicated keys for these
; functions.
;
@Surreal9
Surreal9 / setup.sh
Created January 12, 2020 04:05
Ubuntu 19.10 setup
sudo apt-get install -y tilix build-essential autoconf curl xclip chrome-gnome-shell git
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
(then)
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn
@Surreal9
Surreal9 / chocolatey-commands.txt
Last active August 21, 2020 22:02
Chocolatey setup commands
Install chocolately, always use powershell admin mode:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Then allow choco install w/o having to confirm everything:
choco feature enable -n allowGlobalConfirmation
Then install stuff:
@Surreal9
Surreal9 / mount.sh
Created October 16, 2018 22:26
mount vmplayer shared folder in linux
sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
@Surreal9
Surreal9 / settings.json
Created May 30, 2018 15:47
vscode user settings
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"dist": true,
"**/node_modules": true,
"doc/schema": true,
@Surreal9
Surreal9 / gist:54b0321eb9f27b8609ca208a26c85f71
Last active May 23, 2018 03:27
New ubuntu 18.04 - box setup w/ psql 9.6
sudo apt-get install -y tilix build-essential autoconf curl xclip git vim
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn -y
echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
@Surreal9
Surreal9 / setup-mint.sh
Last active April 23, 2018 21:31
Setup Linux Mint 18 dev box
sudo apt-get install -y build-essential autoconf curl xclip git vim
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn -y
echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list