Skip to content

Instantly share code, notes, and snippets.

View navossoc's full-sized avatar
🍕
It's always a good time for pizza

Rafael Cossovan navossoc

🍕
It's always a good time for pizza
View GitHub Profile
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@Plutor
Plutor / fnBase36.sql
Created April 27, 2012 17:33
BIGINT to base 36 conversion in T-SQL
ALTER FUNCTION dbo.fnBase36
(
@Val BIGINT
)
RETURNS VARCHAR(9)
AS
BEGIN
DECLARE @Result VARCHAR(9) = ''
IF (@Val <= 0)