Skip to content

Instantly share code, notes, and snippets.

View lopugit's full-sized avatar

Nikolaj lopugit

View GitHub Profile
lopugit / gist:9e00dfee651269c20610d125fe51c0db
Created February 21, 2024 00:55
Multi SSH KEY config for same hosts based on directory
View gist:9e00dfee651269c20610d125fe51c0db
Finally, multi ssh key config for same host git repo's :exploding_head:
Alternative Git configuration to automatically switch accounts depending on repo path:
Create a file ~/.config/git/config.user1 containing:
[url "github_username1:"]
insteadOf =
Create a config.user2 file that's the same except with "github_username2".
lopugit / Marketing.txt
Last active February 20, 2024 00:47
Gmail text match OR filter for marketing/spam
View Marketing.txt
("unsubscribe" | "Unsubscribe" | "unsub" | "Unsub" | "Manage your subscription" | "Manage subscription" | "do not want to receive marketing emails" | "Click here if you wish to stop the distribution" | "opt out" | "Opt out" | "Click here and we'll never email you")
lopugit / gist:14f28b7e4db8225fcff32b990c19a2bb
Created September 4, 2018 01:14
Delete large file from github history when dealing with remote rejected pre-receive hook declined Large files detected this exceeds GitHub's file size limit
View gist:14f28b7e4db8225fcff32b990c19a2bb
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
lopugit / gist:9b51101c958ef1d9a21936477e651cda
Created May 15, 2022 08:01
Nginx/Valet Homebrew config location
View gist:9b51101c958ef1d9a21936477e651cda
lopugit / gist:21f5b55e0eb656c1d4dccccf89ec8310
Last active February 11, 2022 20:28
Setting the Mac hostname or computer name from the terminal
View gist:21f5b55e0eb656c1d4dccccf89ec8310
This article provides instructions on setting the hostname of a Mac OS X workstation from the terminal.
This can be useful when configuring your workstation remotely through ssh, or when you need to change the fully qualified hostname of the workstation (which can't be done from the UI).
Note: The following procedure is for informational purposes only and is not an Autodesk certified or supported workflow. Should issues arise with this procedure, they will not be addressed by Autodesk Customer Support.
Perform the following tasks to change the workstation hostname using the scutil command.
Open a terminal.
lopugit / postcodeToState.js
Created December 23, 2021 01:48
Get Victorian State code based on a postcode
View postcodeToState.js
const postcode = 9999
let state
if (
(postcode >= 1000 && postcode <= 2599) ||
(postcode >= 2619 && postcode <= 2899) ||
(postcode >= 2921 && postcode <= 2999)
) {
state = 'NSW'
} else if (
(postcode >= 200 && postcode <= 299) ||
lopugit / words.json
Created August 1, 2021 13:34
Just a JSON importable list of over 300,000 english dictionary words
View words.json
This file has been truncated, but you can view the full file.
lopugit / gist:dcff73fe104e5897599972bfcfd8aedd
Created January 29, 2021 04:28
run root command in wsl without starting user session, for recovering broke wsl init configs
View gist:dcff73fe104e5897599972bfcfd8aedd
If you only need to remove the script, try from cmd wsl.exe -u root -e rm /etc/profile.d/
If you have bad startup config in /etc/wsl.conf, perhaps you can run wsl -u root -e mv /etc/wsl.conf /etc/wsl.conf.bak.
EDIT: you know what -u root does, don't you ;) As for -e, it means do not invoke the default login shell and run the rm or mv binaries directly.
lopugit / Launch current node.js file VS code launch.json debugger debug
Created May 13, 2020 12:36
Launch current node.js file VS code launch.json debugger debug
View Launch current node.js file VS code launch.json debugger debug
"type": "node",
"request": "launch",
"name": "Current File",
"program": "${workspaceFolder}/${relativeFile}",
"skipFiles": [
lopugit /
Created December 15, 2019 08:31 — forked from ezeeyahoo/
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.[Unofficial/Unstable/Latest build] OR Download from (stable)
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the C