Skip to content

Instantly share code, notes, and snippets.

View netsensei's full-sized avatar
👾
retro-wave driven development

Matthias Vandermaesen netsensei

👾
retro-wave driven development
View GitHub Profile
@netsensei
netsensei / libpq.md
Created March 20, 2024 12:33
pqsl, pg_dump and pg_restore via hombrew

Installing pqsl, pg_dump and pg_restore via hombrew

These instructions allow you to intall psql, pg_dump & pg_restore without a full installation of postgresql.

First, install libpq via homebrew

brew doctor
brew update
brew install libpq
@netsensei
netsensei / build_rpm.sh
Last active January 25, 2023 10:54
Create an RPM package from a .spec file
#!/bin/bash
DIR=$1
if [[ ! -d $DIR ]];then
echo "${DIR} does not exist."
exit 1
fi
BASENAME=$(basename $DIR)
UPDIR=$(cd $DIR/.. && pwd)
@netsensei
netsensei / stib.py
Created October 8, 2022 16:07
STIB/MIVB waiting times for a set of stops as a CLI script
#!/usr/bin/python3
#
# run it:
# STIBKEY=<apikey> ./stib.py
import os
import requests
import json
import datetime
from datetime import timedelta
@netsensei
netsensei / elasticsearchinstall.md
Created May 16, 2022 09:38
Installation and initial setup of Elasticsearch on Fedora

Installation and initial setup of Elasticsearch on Fedora

Installation of ES 6.8

$ sudo dnf install java-latest-openjdk
$ sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
$ cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
@netsensei
netsensei / postgresinstall.md
Last active December 19, 2023 09:25
Install PostgreSQL on Fedora Linux

Installation and initial setup of PostgreSQL for local use

Step 1: Installation of PostgreSQL

Add the YUM repo to your host:

$ sudo dnf install https://download.postgresql.org/pub/repos/yum/reporpms/F-37-x86_64/pgdg-fedora-repo-latest.noarch.rpm
flowchart LR
W((World)) --- TR
TR --- KC(Keycloak)
BB --- KC
subgraph Nomad
TR(Traefik proxy) --- BB
BB(Biblio backend) --- NATS{NATS}
NATS --- JB{JMS bridge}
JB --- F(Fedora repository)
NATS --- IDX(Indexer service)
@netsensei
netsensei / gist:7c71b3215bbf440746151aafc4cfd84f
Last active May 6, 2024 22:37
Setting up a PI-Hole FTL DNS on a local network

Setuping PI-Hole FTL DNS on a local network

pihole comes with it's own lightweight DNS server called FTL. It's geared towards easy of use. Even so, setting up this feature can be hard. Here are some lessons I've learned.

In this example:

  • Your network is setup on 192.168.1.0/24
  • 192.168.1.1 is your DHCP server and IP gateway. (usually your router)
  • 192.168.1.254 is the host running pi-hole
@netsensei
netsensei / columsinperl.md
Last active January 1, 2023 09:25
Compare columns in 2 files with Perl

Comparing two files each containing a single column dataset with Perl

Warning! One liners such as these are basically hacks. Please look into the comm program which is part of GNU Coreutils. It basically does all of this without any of the complexity below. See: https://www.gnu.org/software/coreutils/manual/html_node/comm-invocation.html

You have 2 text files, each containing rows of data each having 1 column (e.g. e-mail address, uuids, names, md5 hashes,...). You want to very quickly compare those, spending the least amount of time and energy, looking for ...

  • ... rows both files have in common (intersection)
  • ... rows which are in file A but not in file B.
  • ... rows which are in file B but not in file A.
@netsensei
netsensei / elastic.pl
Created June 16, 2020 13:56
Quick 'n dirty ElasticSearch via Catmandu/Perl (Part 1)
# assuming catmandu.yml in the same folder as this script
# Change bag("document") to the relevant bag name / document type in ES
# ensure camtandu.yml exists!
use Catmandu::Sane;
use Config::Onion;
use Catmandu;
use Path::Tiny;
use Data::Dumper;
@netsensei
netsensei / webpack.config.js
Created June 10, 2020 15:11
Compile plain SCSS with Webpack
// Easily compile plain SCSS or SASS if you want to use Webpack
// but you're not working on a JS project (React, Typescript, whathaveyou)
//
// Why? Webpack does what Grunt/Gulp does with half the configuration.
// See: https://alligator.io/tooling/webpack-gulp-grunt-browserify/
//
// You will need:
// npm install --save-dev autoprefixer
// npm install --save-dev css-loader
// npm install --save-dev file-loader