Skip to content

Instantly share code, notes, and snippets.

@toraritte
toraritte / nix_pin_version_of_individual_packages.md
Last active March 22, 2024 15:30
(work in progress) State of affairs on how to pin versions of individual Nix packages (or how to refer to a specific package version with Nix)

Yes, there are several ways to do this, but none of them are as direct and simple as git v2.1.2; htop v1.2.3 and come with a lot of caveats.

aside
Specifying versions for programming language packages are possible too, but that topic seems to be even messier. The most promising standardization effort to date is [dream2nix][1].

0. Methods

That is, available at the time of this writing:

0.1 "versioned" attribute paths (if available)

@toraritte
toraritte / azure_storage.erl
Last active February 13, 2024 02:40
Make authorized Azure Blob Storage REST requests.
%% @author toraritte
%% @doc Make authorized Azure Storage REST requests.
-module(aaa).
-export(
[ azure_storage_request/0
, azure_storage_request/1
, azure_storage_request/4
, azure_storage_request/6
@toraritte
toraritte / mxroute-add-email-subdomain.md
Last active February 12, 2024 01:48
Add email subdomains - MXROUTE email service provider and DirectAdmin control panel

The Setting up SPF and DKIM records of a subdomain thread on StackExchange goes more into the details.

1. Log in to DirectAdmin

In the [MXroute] Important Account Information email there is a section titled "Login Info:", similar to

=====
===== Login Info:
=====
@toraritte
toraritte / add_user_and_reset_password_with_Firebase_admin_on_node.md
Last active October 12, 2023 23:29
Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

1. Install Firebase's Node modules

Install the Firebase Node modules:

$ npm install firebase firebase-admin --save
@toraritte
toraritte / configure-postgres-to-allow-remote-connection.md
Last active September 4, 2023 01:06
Configure PostgreSQL to allow remote connections

Configure PostgreSQL to allow remote connections

NOTE: This post is a personal update to Neeraj Singh's post. [PostgreSQL must also be configured to allow remote connections][1], otherwise the connection request will fail, even if all firewalls rules are correct and PostgreSQL server is listening on the right port.

Steps

Outline

Couldn't create links, but this is a rather long answer so this may helps.

@toraritte
toraritte / github_issues_to_docx.md
Last active May 23, 2023 01:23
A long and stupid way to save GitHub issues in Word DOCX format

The long and stupid way is listed below, but hoping that someone has a way quicker and nicer solution. (Didn't have time to come up with a proper Node or Deno solution, so I spent better part of the day on this abomination.[quote][1])

  1. "Install" [GitHub CLI][gh] and [Pandoc]

    nix-shell -p gh pandoc
    
  2. Export GitHub issues in JSON

@toraritte
toraritte / FreeSWITCH-notes.md
Last active May 13, 2023 06:06
FreeSWITCH notes (and Stackoverflow backup)

TODO Start saving posts off Stackoverflow, and only contribute conservatively.

What is the purpose of FreeSWITCH's mod_esl?

There is [another question][1] trying to figure out the connection between mod_event_socket and the Event Socket Library (ESL).

The [Event Socket Library][2] itself is a C library ([libesl][3]) that can be used to build external C applications to control FreeSWITCH via its [event system][4].

As far as I understand, [mod_esl][5] is only a FreeSWITCH module wrapper around [libesl][3], used to extend programming languages with the same functionality (i.e., to control a FreeSWITCH instance). The [documentation][5] doesn't mention this, but basing this assumption on the quoted sources below, and on the fact that I couldn't find anyone ever using it directly (i.e., found no mailing list question, nothing on slack, no SO questions, no blog posts, [the books][6] also barely mention it, and so on). Are there any other use cases that I'm missing?

@toraritte
toraritte / re-worked_fetchGit_docs.md
Created August 1, 2022 02:02
Re-imagining the documentation for Nix's `builtins.fetchGit`
@toraritte
toraritte / azure-managed-identity-MSI.md
Last active March 31, 2023 10:49
What are Azure managed identities (MSI)?

1. Definition

A managed identity (MSI1) is [a special kind of service principal][1] that is assigned to [an Azure resource that supports wielding managed identities][2] to access other Azure services / resources without credentials.

2. Terms

Going to use the following terms (some arbitrarily chosen) here:

  • MSI resource: [an Azure resource that support having (or endowed with) managed identities][2]

Is it a good practice to unset all variables at the end of a shell script?1

(See other opinions in this Unix & Linux thread with the same title.)

It depends on your use case(s) and intention(s) because a shell script can be run in different ways (see "1. Ways to call shell scripts" section below) which affect whether the variables are retained by the origin shell (the shell the script is called from) or not.

For example, a couple of cases for and against unsetting variables:

  • Bad, if the point of the script is to set environment variables3

Then again, this also depends on how the shell script is called (see section 1.).