Skip to content

Instantly share code, notes, and snippets.

View lopugit's full-sized avatar

Nikolaj lopugit

View GitHub Profile
@lopugit
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:
https://superuser.com/questions/366649/ssh-config-same-host-but-different-keys-and-usernames
Alternative Git configuration to automatically switch accounts depending on repo path:
Create a file ~/.config/git/config.user1 containing:
[url "github_username1:"]
insteadOf = git@github.com:
Create a config.user2 file that's the same except with "github_username2".
@lopugit
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
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
lopugit / gist:9b51101c958ef1d9a21936477e651cda
Created May 15, 2022 08:01
Nginx/Valet Homebrew config location
View gist:9b51101c958ef1d9a21936477e651cda
/opt/homebrew/etc/nginx/nginx.conf
@lopugit
lopugit / gist:21f5b55e0eb656c1d4dccccf89ec8310
Last active February 11, 2022 20:28
Setting the Mac hostname or computer name from the terminal
View gist:21f5b55e0eb656c1d4dccccf89ec8310
Summary
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.
Procedure
Perform the following tasks to change the workstation hostname using the scutil command.
Open a terminal.
@lopugit
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
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.
["2","1080","&c","10-point","10th","11-point","12-point","16-point","18-point","1st","2,4,5-t","2,4-d","20-point","2D","2nd","30-30","3D","3-D","3M","3rd","48-point","4-D","4GL","4H","4th","5-point","5-T","5th","6-point","6th","7-point","7th","8-point","8th","9-point","9th","a","a'","a-","A&M","A&P","A.","A.A.A.","A.B.","A.B.A.","A.C.","A.D.","A.D.C.","A.F.","A.F.A.M.","A.G.","A.H.","A.I.","A.I.A.","A.I.D.","A.L.","A.L.P.","A.M.","A.M.A.","A.M.D.G.","A.N.","a.p.","a.r.","A.R.C.S.","A.U.","A.U.C.","A.V.","a.w.","A.W.O.L.","A/C","A/F","A/O","A/P","A/V","A1","A-1","A4","A5","AA","AAA","AAAA","AAAAAA","AAAL","AAAS","Aaberg","Aachen","AAE","AAEE","AAF","AAG","aah","aahed","aahing","aahs","AAII","aal","Aalborg","Aalesund","aalii","aaliis","aals","Aalst","Aalto","AAM","AAMSI","Aandahl","A-and-R","Aani","AAO","AAP","AAPSS","Aaqbiye","Aar","Aara","Aarau","AARC","aardvark","aardvarks","aardwolf","aardwolves","Aaren","Aargau","aargh","Aarhus","Aarika","Aaron","Aaronic","Aaronical","Aaronite","Aaronitic","Aaron's-beard",
@lopugit
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/00-wsl2.systemd.sh.
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
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": [
"<node_internals>/**"
]
}
@lopugit
lopugit / set-up-chromium-keys.md
Created December 15, 2019 08:31 — forked from ezeeyahoo/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows
View set-up-chromium-keys.md

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 https://github.com/macchrome/chromium/releases (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 chromium-dev@chromium.org mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the C