Skip to content

Instantly share code, notes, and snippets.

View subfuzion's full-sized avatar

Tony Pujals subfuzion

View GitHub Profile
@subfuzion
subfuzion / README.md
Last active December 8, 2023 08:53
Log and review terminal sessions

Sometimes I have a number of terminal sessions open and I want to remember where I left off (for example, when rebooting). I'm sure there's a better way to automate this, but I haven't put thought into it.

For now, I just enter log-session to log the current directory, and later when I want to view previous sessions, I enter sessions.

@subfuzion
subfuzion / README.md
Last active February 29, 2024 17:53
Node.js 21.1.0 - build single executable application

Sharing my project's build script in case it's useful to others. I'm not testing for Windows, which is why the script reports an error, but just note that emitting Windows executables is actually supported by the Node API (see docs). Feel free to use and modify.

Notes

  • Webpack is used for bundling.
  • The entry point for the webpack config for my example is ./bin/app, which was an executable Node.js script with a shebang line. Update the config to point to whatever your app's entry point is.
  • The SEA config file uses disableExperimentalSEAWarning to suppress the experimental warning displayed when running a generated executable. This didn't work for Node 20.1.0 (see issue), but it has been tested and does work for 21.1.0.
@subfuzion
subfuzion / README.md
Created August 13, 2023 08:19
Restarting the display manager on Ubuntu Gnome

Sometimes the screen becomes unresponsive to the mouse, keyboard, or isn't painting correctly.

Press Ctrl-Alt-F3 to switch to terminal mode.

Enter:

sudo systemctl restart display-manager
@subfuzion
subfuzion / 1-remote.md
Last active August 13, 2023 08:27
Enable X11 forwarding on Ubuntu 23.04
# ensure `X11Forwarding yes` is set (or uncommented)
sudo vi /etc//etc/ssh/sshd_config

# confirm no mistakes in config
sudo sshd -t -f /etc/ssh/sshd_config

# restart sshd
sudo systemctl restart sshd.service
@subfuzion
subfuzion / README.md
Last active August 13, 2023 08:39
Enable VNC on Ubuntu 23.04 from the command line

Unfortunately, Ubuntu 23.04 no longer supports VNC out of the box, only RDP.

Previous support was based on vino. You can enable this from the command line with the following instructions.

Create a password that you want to use for logging into vnc and save it in a variable:

password=$(echo "some-password" | base64)
@subfuzion
subfuzion / README.md
Last active November 17, 2023 02:53
Lima template
  1. Create the following directories in your home directory:
mkdir -p lima/code

This mounts your local filesytem (under $/lima/code) to $/code in the Lima instance.

  1. Install Lima if you haven't already done so.
@subfuzion
subfuzion / deno-test.ts
Created May 26, 2023 21:11
Test Deno remote script
console.log("Hello, World!");
@subfuzion
subfuzion / .ideavimrc
Created September 6, 2022 21:17
My JetBrains vim configuration
sethandler <C-B> a:vim
sethandler <C-F> a:vim
sethandler <C-J> a:vim
sethandler <C-K> a:vim
sethandler <C-L> a:vim
sethandler <C-N> a:vim
sethandler <C-P> a:vim
sethandler <C-R> a:vim
sethandler <C-V> a:vim
sethandler <C-W> a:vim
@subfuzion
subfuzion / .vimrc
Last active August 15, 2023 23:29
My personal vim configuration
"====================================================================
" Leader key
"====================================================================
" Remap the leader key.
" let g:mapleader = "\<space>"
let g:mapleader = ";"
"====================================================================
" Edit and reload .vimrc
@subfuzion
subfuzion / README.md
Last active August 29, 2023 01:41
Node.js 18 Test Runner

Node.js 18 Test Runner

Node.js v18 introduces test runner support. This currently experimental feature gives developers the benefits of a structured test harness for their code without having to install a third party test framework, like Mocha or Jest, as a dependency. Using the test runner produces [TAP] output.

The [online reference] provides the most up-to-date, authoritative reference and have plenty of good testing examples. However, there are a few points that might not be immediately obvious from the reference, so those are highlighted here.