Skip to content

Instantly share code, notes, and snippets.

View alexxroche's full-sized avatar
💭
🦀 Rust

Alexx Roche alexxroche

💭
🦀 Rust
View GitHub Profile
@krschmidt
krschmidt / head.html
Last active July 12, 2024 10:40
Set Canonical URL via Javascript
<script type='text/javascript'>
var link = !!document.querySelector("link[rel='canonical']") ? document.querySelector("link[rel='canonical']") : document.createElement('link');
link.setAttribute('rel', 'canonical');
link.setAttribute('href', location.protocol + '//' + location.host + location.pathname);
document.head.appendChild(link);
</script>
@indrayam
indrayam / create-jwt-using-unix-commands-on-mac.md
Last active September 21, 2022 08:08
Create JWT Token Header Using Unix Command line tools ONLY!

Pseudocode:

Y = Base64URLEncode(Header) + ‘.’ + Base64URLEncode(Payload)
JWT = Y + ‘.’ + Base64URLEncode(HMACSHA256(Y))

The steps called out here should work on a Mac as well. The only thing that might be different is the sed command used below. Instead of using -E, you will have to use -r to run sed with extended regular expression support

Use data from this tutorial:

scotch.io

@janstuemmel
janstuemmel / rc.xml
Created December 20, 2017 22:46
openbox keyboard media keys
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- config ... -->
<keyboard>
<!-- in section keyboard add following: -->
<keybind key="XF86AudioLowerVolume">
<action name="Execute"><execute>amixer -q sset Master 3%-</execute></action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute"><execute>amixer -q sset Master 3%+</execute></action>
</keybind>
@csamsel
csamsel / logrotate.conf
Last active March 2, 2023 15:42
use lzma for logrotate instead of gzip for better compression
# ...
# compress rotated log files.
compress
compresscmd lzma
uncompresscmd lzmadec
compressext .xz
delaycompress
# ...
@tmonjalo
tmonjalo / list-fftabs.py
Last active April 8, 2025 21:02
List all Firefox tabs with title and URL
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""