Skip to content

Instantly share code, notes, and snippets.

View marek-saji's full-sized avatar
:shipit:

Marek ‘saji’ Augustynowicz marek-saji

:shipit:
View GitHub Profile
@marek-saji
marek-saji / dev-tld.md
Last active February 26, 2024 16:12
Configure local DNS server to serve #dev #TLD #ubuntu #linux

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq
  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo restart network-manager.
  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=127.0.0.1.
  4. Create a new file in /etc/dnsmasq.d (eg. /etc/dnsmasq.d/dev), and add the line address=/dev/127.0.0.1 to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart.

source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns

@marek-saji
marek-saji / zoom.userscript.js
Last active February 1, 2024 08:30
userscript: Zoom Web Client with less clicking
// ==UserScript==
// @name Zoom Web Client with less clicking
// @description Make using Web Client in Zoom a default and require less clicking.
// @author Marek ‘saji’ Augustynowicz <marek.aug@gmail.com>
// @copyright ISC
// @version 1.0.3
// @icon https://st1.zoom.us/zoom.ico
// @supportURL https://gist.github.com/marek-saji/184024f096be7b9ddf54272d6d225af8
//
// @updateURL https://gist.githubusercontent.com/marek-saji/184024f096be7b9ddf54272d6d225af8/raw
@marek-saji
marek-saji / nx.completion.bash
Last active December 5, 2023 15:36
Bash autocompletion for nx
#!/usr/bin/env bash
# Very naive completion for nx <https://www.npmjs.com/package/nx>.
#
# - Requires jq(1) to be present for completion of targets.
# - Uses _get_comp_words_by_ref and __ltrim_colon_completions which are
# usully found in /etc/bash_completion
#
# Gist: https://gist.github.com/marek-saji/dee1df3cd7af3f6b74e608ab1d7ec473
#
#!/usr/bin/env -S node --experimental-import-meta-resolve
import { fileURLToPath } from 'node:url';
import { readFile } from 'node:fs/promises';
import hyphenopoly from 'hyphenopoly';
const hyphenator = hyphenopoly.config({
exceptions: {
'en-us': 'en-han-ces',
},
@marek-saji
marek-saji / link.sh
Created May 4, 2022 10:49
Script for linking dotfiles using stow(8)
I am attesting that this GitHub handle marek-saji is linked to the Tezos account tz1d3J15MX3hWjEkT447G1Lzdrh7hqXmQRbU for tzprofiles
sig:edsigu5Dhfptkbx2Zr1dzt12WySVUYbEfBXuQyFsFK7PJNJ7xkYpX4Q2CcDf84xgHdsBqUCkgFDuifzsbkmfwvfvy2JYgGQajeH
@marek-saji
marek-saji / .bashrc
Last active October 1, 2020 13:02
df across hosts
MY_HOSTS="list of hosts I own"
_dff ()
{
local df
df="$(
TAIL=+1
{
echo /
echo /tmp
#!/bin/sh
#
# Display a summary of what you’ve been working on since yesterday
# Copyright 2020 Marek Augustynowicz
# Licensed under ISC license <https://opensource.org/licenses/ISC>
#
# https://gist.github.com/marek-saji/fd107bbd01d5436ca751effec335dae4
# GistID: fd107bbd01d5436ca751effec335dae4
set -e
#!/bin/sh
#
# Display a summary of what you’ve been working on since yesterday
#
set -e
HEADER_FORMAT="\n\033[34m# %s\033[0m\n"
GIT_LOG_FORMAT="$( git config --get pretty.me --default="%C(green)(%cd) %C(reset)%s%C(yellow)%d %C(red)%h%C(reset)" )"
#!/bin/sh
foo ()
{
echo stdout
echo stderr 1>&2
return 1
}
{