Skip to content

Instantly share code, notes, and snippets.

View mchaker's full-sized avatar

M mchaker

View GitHub Profile
@zjeaton
zjeaton / _Google Analytics 4 with Hugo.md
Last active May 23, 2024 01:13
Google Analytics 4 (with Measurement ID) in Hugo

Google Analytics 4 in Hugo

Blog post with slightly more detail can be found here. If you want to just get to it, read on.

I (very) recently decided to reimplement GA in my site, and found that existing implementation in Hugo was not compatible with GA4's new Measurement ID. This is an easy way to drop your Measurement ID into your site. I'm not going to go into how to sign up for GA.

This implementation requires that you create a site parameter for analytics, create a partial, and call the partial. I tweaked the names of the parameters and files so they didn't collide with the built-in hugo code.

Place the GoogleAnalyicsID (Measurement ID) in config.toml within [params].

@geerlingguy
geerlingguy / increase-pci-bar-space.sh
Last active July 14, 2024 02:06
Increase the BAR memory address space for PCIe devices on the Raspberry Pi Compute Module 4
#!/bin/bash
# The default BAR address space available on the CM4 may be too small to allow
# some devices to initialize correctly. To avoid 'failed to assign memory'
# errors on boot, you can increase the range of the PCIe bus in the Raspberry
# Pi's Device Tree (a .dtb file specific to each Pi model).
#
# You should probably read up on Device Trees if you don't know what they are:
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
#
@CHTJonas
CHTJonas / UniFi Tunnelbroker.md
Last active April 26, 2022 00:49
Tunnelbroker config for UniFi Security Gateway

UniFi Tunnelbroker Configuration

This GitHub Gist details the manual configuration needed on a UniFi controller to enable IPv6 tunneling with Hurricane Electric's Tunnelbroker service.

Setup

This is what works for me personally. Stuff you'll need to do to adapt this to your ends:

  • Replace "local-ip" with your USG's public IPv4 address.
  • Replace "remote-ip" with the address of your Tunnelbroker tunnel server.
  • Replace "address" with the IPv6 address that your are allocated.
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@tkon99
tkon99 / guide.md
Last active June 13, 2024 21:53
Use Mosh on Windows from the Command Prompt

Hi all. After wanting true color support in Mosh (to use Brow.sh), I also wanted to integrate it more tightly with Windows. Since I reckon more people will be wanting to accomplish this, here is a guide.

  1. Install Linux Subsystem for Windows if you haven't already (https://docs.microsoft.com/en-us/windows/wsl/install-win10) (I use Ubuntu)
  2. Make sure you can execute bash from a CMD prompt.
  3. Go into the bash environment by executing bash ~ in CMD prompt
  4. Install Mosh-dev (for up-to-date version) from https://launchpad.net/~keithw/+archive/ubuntu/mosh-dev by doing sudo add-apt-repository ppa:keithw/mosh-dev then sudo apt-get update
  5. Create a new mosh.bat file on your Desktop with the following contents
@echo off
@AkdM
AkdM / Edit_Repack_ISO_tutorial.md
Last active June 15, 2024 14:40
Edit and repack .iso bootable image

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso

# vim: ft=gitconfig
[alias]
branch-name = rev-parse --abbrev-ref HEAD
last-tag = describe --tags --abbrev=0
log-commits-since-last-tag = "! f() { git log `git last-tag`..HEAD $@; }; f"
log-commits-since-last-tag-oneline = !git log-commits-since-last-tag --oneline
last-tag-dotdot-or-nothing = "! f() { git last-tag >/dev/null 2>&1 && echo $(git last-tag).. || echo ''; }; f"
last-tag-or-root = "! f() { git last-tag >/dev/null 2>&1 && echo tag $(git last-tag) || echo 'ROOT'; }; f"
date-of-last-commit-on-head = ! git rev-list --format=%ci HEAD^! | tail -1
count-commits-since-last-tag-or-root = "! f() { git rev-list $(git last-tag-dotdot-or-nothing)HEAD --count; }; f"
@jagrosh
jagrosh / WebhookTutorial.md
Last active December 4, 2023 20:28
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@jasonrm
jasonrm / reenable.sh
Last active March 13, 2022 17:13
Dell PowerEdge DRAC 5 KVM
# Original : http://en.community.dell.com/support-forums/servers/f/956/t/18394689
# Archive : http://archive.is/8LkJs
I was also facing this issue, but had to jump some more hurdles:
- In the Java Control Panel, add https://<server IP/hostname> to the exception site list. (not related to this issue, but needs to be done though)
- In the Advanced tab (this is on windows) enable the console, so I could check what java version was being used. (I have 5 versions installed)
- Edit the mentioned java.security for the correct version, but, I had to make an additional change. I also had to alter the "jdk.certpath.disabledAlgorithms" parameter, and remove MD5 there. Hence, enable MD5 support.
@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq