Skip to content

Instantly share code, notes, and snippets.

@axelbdt
axelbdt / django-postgresql-15.md
Last active November 12, 2024 17:36
# Django and PostgreSQL 15, the rules have changed

Django and PostgreSQL 15, the rules have changed

Postgres 15 is just out, and while there is a lot to love about this new release, you're in for a surprise if you try to set it up with Django following tutorials like this one.

The reason is stated in the release announcement:

Remove PUBLIC creation permission on the public schema (Noah Misch) The new default is one of the secure schema usage patterns that Section 5.9.6 has recommended...

Provided your web app doesn't access your database as a superuser (it shouldn't) and uses a dedicated user, it is not allowed to use the public schema anymore. You have to create one for this specific user, and the next section will

@cyrenity
cyrenity / compile-and-install-freeswitch-1.10.x-on-ubuntu.md
Last active November 13, 2024 17:36
Install FreeSWITCH 1.10.x on Ubuntu 18.04 | 20.04 | 22.04 LTS

Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | 20.04 | 22.04 LTS

Introduction

FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine

This guide demonstrates how to get it install FreeSWITCH and get it up and running on a Ubuntu 20.04 LTS machine

Prerequisites

To follow along with this guide, you need one Ubuntu 20.04 LTS server which has prerequisite packages installed and configured. In order to install required packages issue following command

@mariogasparoni
mariogasparoni / build-install-freeswitch-1.10-from-source.sh
Last active November 3, 2024 02:02
build-install-freeswitch-1.10-from-source.sh
#!/bin/bash
## Script for building/installing FreeSWITCH from source.
## URL: https://gist.github.com/mariogasparoni/dc4490fcc85a527ac45f3d42e35a962c
## Freely distributed under the MIT license
##
##
set -xe
FREESWITCH_SOURCE=https://github.com/signalwire/freeswitch.git
FREESWITCH_RELEASE=master #or set this to any other version, for example: v1.10.5
PREFIX=/usr/share/freeswitch
@Konstantinusz
Konstantinusz / magyar-szavak.txt
Created September 22, 2020 15:22
Magyar szavak listája
This file has been truncated, but you can view the full file.
abajgat
abakusz
abál
abált
abaposztó
abárol
abba
abbahagy
abbahagyat
abbahagyogat
@kjellskogsrud
kjellskogsrud / Empty commits
Created March 26, 2020 15:42
Why empty commits are good
I once read an https://bit-booster.com/doing-git-wrong/2017/01/02/git-init-empty/ , about why
you should start with an empty commit for a new repo. The page has since then dissapperard but I got
some of it out of the wayback machine and archive it here:
Always Start With An Empty Commit
Whenever you start a new git repo, pop an empty commit onto it before you do anything else!
git init new-repo
cd new-repo
git commit -m 'initial empty commit' --allow-empty
@davidak
davidak / gist:171f81f945f36d7fd88dce4e67af8a5d
Created March 21, 2020 08:33
Use older package version with Nix
This works with the package manager [Nix](https://nixos.org/nix/), available on NixOS and working on most linux distros and macOS (theoretically also BSD and Windows).
1. search for package definition on GitHub, for example ansible
https://github.com/NixOS/nixpkgs/search?p=1&q=ansible&unscoped_q=ansible
it is here https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/ansible/default.nix
2. search the history for the last commit with your preferred version, for example 2.5
@mendeza
mendeza / vim-sort-regex.md
Last active October 4, 2022 11:36
Vim Sort with RegEx

Vim Sort with RegEx

Vim Manual

See :help :sort.

:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
@573
573 / iso-config.nix
Last active January 17, 2024 21:32
Using a nixos qemu machine for fun and profit howto, as well creating iso files.
{ pkgs, lib, ... }:
with lib;
{
config = {
i18n.defaultLocale = "de_DE.UTF-8";
time.timeZone = "Europe/Paris";
services = {
@alpgarcia
alpgarcia / github-token-for-git.md
Last active February 5, 2024 11:40
Configure GitHub token with gnome-keyring
  1. git --version
git version 2.17.1
  1. sudo apt-get install libsecret-1-0 libsecret-1-dev
  2. cd /usr/share/doc/git/contrib/credential/libsecret
  3. sudo make
  4. git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
  5. Next time Git asks for your GitHub username and password, just write your username and paste your token and they'll be stored in your keyring.
with import <nixpkgs> {};
let
path = ./mwe;
string = "./mwe";
pathPath = path + /test/file.nix;
pathString = path + "/test/file.nix";
pathStringPath = path + "/test" + /file.nix;
stringPath = string + /test/file.nix;
stringPathWorking = string + /nix/var/nix/db/schema;