Skip to content

Instantly share code, notes, and snippets.

@jhass
jhass / archlinux.sh
Created November 18, 2015 23:30
VMM (http://vmm.localdomain.org/) DKIM configuration (only relevant parts shown)
sudo pacman -S opendkim
sudo cp /etc/opendkim/opendkim.conf{.sample,}
sudo mkdir /var/lib/dkim
sudo chown opendkim:mail /etc/opendkim/opendkim.conf /var/lib/dkim
sudo chmod 700 /var/lib/dkim
sudo chgrp mail /var/spool/postfix/private
sudo -u opendkim opendkim-genkey -D /var/lib/dkim -b 2048 -s mail
sudo usermod -a -G mail postfix
@jhass
jhass / 1-README.md
Last active November 5, 2015 00:58
ix.io helper function
  1. Add to your .${SHELL}rc.
  2. Replace user and password.
  3. Create cat foo | ixio.
  4. Update cat foo | ixio abc.
  5. View your pastes at ix.io/user/your_username.
@jhass
jhass / 1-Yubikey_session_lock.md
Last active June 12, 2024 09:16
Lock (Gnome) session when removing Yubico U2F key

Setup

  1. Copy 99-u2f_lock_screen.rules to /etc/udev/rules.d.
  2. Copy gnome_lock_all_sessions to /usr/local/bin.
  3. Mark gnome_lock_all_sessions as executable: chmod +x /usr/local/bin/gnome_lock_all_sessions
  4. Reload udev: udevadm control -R
@jhass
jhass / .gitignore
Last active June 5, 2017 11:27
bxctl - Small helper to manage my boxcars configuration
/.crystal/
/bxctl
/pkg/
/src/
*.tar.xz
@jhass
jhass / .gitignore
Last active July 24, 2022 23:15
powerdns remote backend for hashbang.sh
python/
*.log
@jhass
jhass / git-merge-diaspora-stable
Last active April 11, 2021 12:26
Little helper to merge pull requests to the stable for diaspora/diaspora. Handy alias: git config alias.mds merge-diaspora-stable
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "No PR given"
exit 1
fi
parts=(${1//\// })
pr=${parts[${#parts[@]}-1]}
@jhass
jhass / lib_c.cr
Last active November 12, 2015 19:54
Platform indepedent standard library for Crystal
lib LibC
# Common bindings go here
fun chdir(...)
fun printf(...)
fun wprintf(...)
fun atoi(...)
fun watoic(...)
end
ifdef windows
@jhass
jhass / RubyOnArch.md
Last active June 10, 2024 08:54
My Ruby setup on Archlinux

Ruby on Archlinux

I thought I would document my setup, since it's somewhat non-standard but working quite well for me.

What this does

  • Install major Ruby versions at their latest patch release
  • Allow to switch between them seamlessly
  • Use chruby
  • Encourage bundler usage
@jhass
jhass / .rubocop.yml
Last active December 15, 2023 22:23
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@jhass
jhass / vmm-change-password[slash]index.php
Last active August 29, 2015 14:07
Afterlogic WebMail VMM password change plugin
<?php
/*
* Afterlogic WebMail VMM password change plugin
* Based upon http://www.afterlogic.com/wiki/Password_change_for_ISPConfig_%28WebMail_Plugins%29
* VMM: http://vmm.localdomain.org/
* WebMail lite: http://www.afterlogic.org/webmail-lite
*
* The plugin calls doveadm pw.
*
* You should create a dedicated role and add it to the mailsys role.