Skip to content

Instantly share code, notes, and snippets.

View njugunagathere's full-sized avatar

Njuguna Gathere, Tirus njugunagathere

View GitHub Profile
@njugunagathere
njugunagathere / unbound.conf
Created August 8, 2022 21:14 — forked from rohan-molloy/unbound.conf
Working unbound over TLS server; self-hosted. Does NOT answer UDP or unencrypted requests.
# d899b42486eb805b8e432c5758568db487c6bcfc067d6ca7e1292a5a66d66de6 unbound.conf
server:
# Listen on tcp 443,853
interface: 0.0.0.0@853
interface: 0.0.0.0@443
# Allow from anywhere
access-control: 0.0.0.0/0 allow
access-control: ::0/0 allow
@njugunagathere
njugunagathere / Dockerfile
Created March 26, 2022 11:39 — forked from avishayp/Dockerfile
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@njugunagathere
njugunagathere / wkhtmltopdf.sh
Created May 19, 2019 20:47 — forked from Rajeshr34/wkhtmltopdf.sh
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@njugunagathere
njugunagathere / fetchCoinPrice.scpt
Created January 13, 2018 13:55 — forked from cmikeb1/fetchCoinPrice.scpt
AppleScript to retrieve crypto currency prices
validate_sheet()
set coins to {}
-- retrieve the list of coins from number
tell application "Numbers"
tell table 1 of sheet 1 of document 1
set cntRow to count row
set cntCol to count column
@njugunagathere
njugunagathere / migrate_postgresql_database.md
Created December 10, 2017 05:14 — forked from olivierlacan/migrate_postgresql_database.md
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@njugunagathere
njugunagathere / gist:a0717bed641a1e7e1e7412671fe90f00
Created December 10, 2017 05:00 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@njugunagathere
njugunagathere / nginx.conf
Created October 5, 2017 19:54 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - freek@spatie.be</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/>
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>