Skip to content

Instantly share code, notes, and snippets.

Tree
/etc/puppet/environments/production/applications/myapplication
manifest/nginx.pp
templates/nginx/rewrites.erb
In the nginx class in nginx.pp
file { $nginx_rules_location:
mode => '0664',
owner => 'liferay',
@Alveel
Alveel / gist:d77cab359ec4d22787cc60f63452448b
Created December 9, 2016 11:57
vagrant-libvirt contains wrong library versions
alwyn@aristotle ~/dev/docker/vagrant % vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': incompatible library version - /opt/vagrant/embedded/gems/extensions/x86_64-linux/2.2.0/ruby-libvirt-0.7.0/_libvirt.so (LoadError)
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/vagrant/embedded/gems/gems/ruby-libvirt-0.7.0/lib/libvirt.rb:11:in `<top (required)>'
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/vagrant/embedded/gems/gems/fog-libvirt-0.3.0/lib/fog/libvirt.rb:4:in `<top (required)>'
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/
@Alveel
Alveel / gist:44ce63471a3b44fbd8aef0a187996134
Created December 9, 2016 15:52
Can't install vagrant plugin; rubygems version conflict
alwyn@aristotle ~ % vagrant plugin install libvirt
Installing the 'libvirt' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:2100:in `check_version_conflict': can't activate ffi-0.6.4, already activated ffi-1.9.14 (Gem::LoadError)
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:1276:in `activate'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:323:in `block in activate_solution'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `activate_solution'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:248:in `internal_install'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:98:in `install'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/lib/vagrant/plugin/manager.rb:62:in `block in install_plu
@Alveel
Alveel / gist:2b88b422a9262107b65e99b223f3635a
Created December 23, 2016 09:07
Error when bringing up vagrant box with libvirt provider.
alwyn@aristotle ~/dev/vagrant % vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': incom
0.7.0/_libvirt.so (LoadError)
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `re
from /opt/vagrant/embedded/gems/gems/ruby-libvirt-0.7.0/lib/libvirt.rb:11:in `<top (req
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `re
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `re
from /opt/vagrant/embedded/gems/gems/fog-libvirt-0.3.0/lib/fog/libvirt.rb:4:in `<top (r
from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `re
@Alveel
Alveel / gist:a5b92444a8910733dfca13e68528a67b
Created January 5, 2017 13:53
libinput-list-devices touchpad info
Device: AlpsPS/2 ALPS DualPoint TouchPad
Kernel: /dev/input/event11
Group: 8
Seat: seat0, default
Size: 35.14x32.68mm
Capabilities: pointer
Tap-to-click: disabled
Tap-and-drag: enabled
Tap drag lock: disabled
Left-handed: disabled
[ 4002.390395] traps: vivaldi-bin[8012] trap int3 ip:55eaa6902298 sp:7ffe016e3db0 error:0
[ 4009.099043] traps: vivaldi-bin[8019] trap int3 ip:55eaa45c0094 sp:7ffe016e3c90 error:0
[ 7024.449478] traps: vivaldi-bin[14308] trap int3 ip:5590babdd094 sp:7ffc37a7be90 error:0
[ 7024.451630] traps: chrome[14305] trap invalid opcode ip:561d99e94612 sp:7fffe2636ff8 error:0 in chrome[561d95f28000+5a95000]
[ 7352.126899] traps: vivaldi-bin[15042] trap int3 ip:5590babdd094 sp:7ffc37a7be90 error:0
[ 7355.075505] traps: vivaldi-bin[15063] trap int3 ip:5590bcf1f298 sp:7ffc37a7bfb0 error:0
[ 7355.097354] traps: chrome[15069] trap int3 ip:561d964dea0d sp:7fffe2639220 error:0
[ 7361.002050] traps: vivaldi-bin[15110] trap int3 ip:5590bcf1f298 sp:7ffc37a7bfb0 error:0
[ 7671.627295] traps: vivaldi-bin[15486] trap int3 ip:5590bcf1f298 sp:7ffc37a7bfb0 error:0
[ 7690.845855] traps: chrome[15502] trap int3 ip:561d97a63901 sp:7fffe26395a0 error:0
@Alveel
Alveel / my.patch
Created May 29, 2019 09:38
Patch for AUR package kubernetes-helm to use the release tarball instead of raw git repo
diff --git a/.SRCINFO b/.SRCINFO
index 1de7c00..a23e1cc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -15,8 +15,8 @@ pkgbase = kubernetes-helm
optdepends = kubectl: check cluster status
optdepends = kubectl-bin: check cluster status - binary package
conflicts = kubernetes-helm-bin
- source = https://github.com/helm/helm/archive/v2.14.0.tar.gz
- sha256sums = 5ee68580431254044996da0d2347a394e917e18a81047cc1b0f3d8949a371d75
@Alveel
Alveel / otpmenu.sh
Last active August 1, 2019 08:20
passmenu for pass-otp
#!/usr/bin/env bash
shopt -s nullglob globstar
otp_dir=totp
prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/"$otp_dir"/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
@Alveel
Alveel / zfs.md
Last active February 18, 2022 15:04
My ZFS setup for backuppc

Partitioning

# Logical volume is on an SSD/NVMe
lvcreate <vgname> --size 4G --name slog

zpool create tank raidz2 -o ashift=12 -O atime=off -O canmount=off -O compression=lz4 -O normalization=formD -O mountpoint=/opt/backups -O xattr=sa \
    /dev/vdb /dev/vdc /dev/vdd /dev/vde /dev/vdf /dev/vdg
zfs create tank/backuppc
zfs create tank/incoming
@Alveel
Alveel / regex-test.py
Last active January 3, 2020 19:19
Multiline regex, end of string anchor and newlines
#!/usr/bin/env python3
import re
volume_statistics_pattern = re.compile(r'''
^Starting\ time\ of\ crawl:\ (?P<crawl_start>\w{3}\ \w{3}\s+\d{1,2}\ \d{2}:\d{2}:\d{2}\ \d{4})\s+
Ending\ time\ of\ crawl:\ (?P<crawl_end>\w{3}\ \w{3}\s+\d{1,2}\ \d{2}:\d{2}:\d{2}\ \d{4})\s+
Type\ of\ crawl:\ (?P<crawl_type>\w+)\s+