Skip to content

Instantly share code, notes, and snippets.

View aluxian's full-sized avatar

Alexandru Rosianu aluxian

View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 14, 2025 06:52
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active May 11, 2025 15:15
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx

# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@mvasilenko
mvasilenko / terraform_cloudflare_import.sh
Created November 11, 2020 15:15
import Cloudflare DNS record into terraform state
# set your CloudFlare key & email
export auth_email=$CLOUDFLARE_EMAIL
export auth_key=$CLOUDFLARE_TOKEN
# list your DNS zones hosted at CloudFlare
curl -s -X GET "https://api.cloudflare.com/client/v4/zones/?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)"'
# expected output:
# a3c9c7d3861e52cf23c835102c258d63 example1.com
# f47d1debb65621ca89039b9fbfeb726a example2.com
@salrashid123
salrashid123 / cos_gcp_direct.md
Created October 20, 2020 15:32
Create LUKS mount on GCP COS image (direct)

Stage Disk with LUKS (direct)

Procedure to mount a LUKS encrypted device into a Container Optimized OS.

  • Create a disk and attach to a plain VM
  • Create format and mount as LUKS
  • Write file to LUKS mount path
@rsms
rsms / foo.service
Created October 3, 2020 00:18
Example go http server with systemd socket activation and zero-downtime restart
[Unit]
Description = Foo HTTP server
Requires = foo.socket
After = multi-user.target
[Service]
User = www-data
Group = www-data
WorkingDirectory = /var/foo
ExecStart = /var/foo/bin/foo-server
#!/usr/bin/awk -f
function line(x1, y1, x2, y2) {
printf(" <line x1='%d' y1='%d' x2='%d' y2='%d'/>\n",
x1, y1 + rand() * 5, x2, y2 + rand() * 10)
}
function path(d) {
printf(" <path d='%s'/>\n", d)
}
@jsloat
jsloat / Bear.Backlinks.js
Last active December 27, 2022 23:27
Generate backlinks for Bear notes in Scriptable on iOS
@johnnypea
johnnypea / useful-one-liners.sh
Last active May 13, 2025 06:01
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@al45tair
al45tair / gist:73be245ab87a66a885742b98be91ac14
Last active April 10, 2024 09:00
Files installed by Zoom for mac OS

The Zoom install package for macOS is mad. Rather than actually using the installer to install things, it does everything in the preinstall script. That's bonkers, and also means that the system won't have a list of the files it installed, because it's doing it using shell script.

The script appears to install two items, namely:

/Applications/zoom.us.app
~/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin

If the user opening the package isn't an administrator, it looks like it will install the app in the user's home folder instead. If they are an administrator, Zoom will delete the ZoomUsPlugIn.plugin from /Library if it's there, but it still installs to ~/Library.

It also adds Zoom to your Dock automatically, without asking.