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 / 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 / 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 / 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
@netsensei
netsensei / ssh-background.md
Last active September 14, 2023 20:42
Creating and managing an SSH session in the background
@netsensei
netsensei / dell-xps-9380.md
Last active June 23, 2023 17:58
Installing Fedora 30/31 on Dell XPS 13 9380

Installing Fedora 30/31 on a Dell XPS 13 9380 series in dual boot mode

This guide describes how to install Fedora 30/31 next to Windows 10 on a Dell XPS 13 9380 series in dual boot.

  • Keep the stock Windows 10 installation that came with the laptop.
  • Install Fedora 30 alongside Windows on the hard disk.
  • Install GRUB as the bootloader allowing you to choose which OS to boot from.

Authored: September 2019

@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 / 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 / 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
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)