Skip to content

Instantly share code, notes, and snippets.

@psy-q
psy-q / hslu_authentication_controller.rb
Created October 24, 2017 07:41
Authentication controller with some logging statements
# require 'net/ldap'
class LdapHelper
# Needed later on in the auth controller
attr_reader :unique_id_field
# Based on what string in the field displayName
# should the user be assigned to the group "Video"?
attr_reader :video_displayname
attr_reader :base_dn
@psy-q
psy-q / gitlab.rb
Last active August 29, 2017 17:54
Mattermost with external PostgreSQL
mattermost_nginx['redirect_http_to_https'] = true
mattermost_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.example.com.crt"
mattermost_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.example.com.key"
mattermost['service_use_ssl'] = true
mattermost['email_enable_sign_in_with_username'] = true
mattermost['email_enable_sign_in_with_email'] = false
mattermost['email_enable_sign_up_with_email'] = false
mattermost['email_send_email_notifications'] = true
mattermost['email_connection_security'] = nil
@psy-q
psy-q / .mpdconf
Last active June 26, 2021 07:56
HTTP stream turning silent in mpd
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
@psy-q
psy-q / .mpdconf
Created April 7, 2017 12:45
mpd stream audio stops while song continues playing
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
@psy-q
psy-q / random_picker_2000.rb
Created December 23, 2016 16:29
Random Picker 2000
filename = ARGV[0]
if !filename || filename == ''
puts 'Give the path to JSON comments file as downloaded from e.g. https://www.reddit.com/r/RandomActsOfGaming/comments/4ijyqj.json'
exit 1
end
comment_json = JSON.parse(File.read(filename))
comment_nodes = comment_json.last['data']['children']
openconnect https://vpn1.zhdk.ch
POST https://vpn1.zhdk.ch/
Attempting to connect to server 195.176.29.132:443
SSL negotiation with vpn1.zhdk.ch
Server certificate verify failed: signer not found
Certificate from VPN server "vpn1.zhdk.ch" failed verification.
Reason: signer not found
Enter 'yes' to accept, 'no' to abort; anything else to view:
X.509 Certificate Information:
set nocompatible
filetype off
call plug#begin('~/.vim/plugged')
" Color schemes
"Plug 'zeis/vim-kolor'
"Plug 'altercation/vim-colors-solarized'
"Plug 'chriskempson/base16-vim'
Plug 'NLKNguyen/papercolor-theme'
@psy-q
psy-q / context.xml
Last active June 16, 2016 07:07
Not able to use MariaDB JDBC DataSource name in midPoint
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@psy-q
psy-q / backtrace.txt
Created June 10, 2016 08:16
WINE crashing during Divine Divinity installation with POL
Unhandled exception: page fault on read access to 0x00001dd0 in 32-bit code (0x00001dd0).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:00001dd0 ESP:0f4dd97c EBP:7c432cc0 EFLAGS:00010212( R- -- I -A- - )
EAX:ffd7a264 EBX:00000000 ECX:ffd7a264 EDX:7c432f24
ESI:00000004 EDI:ffd7a264
Stack dump:
0x0f4dd97c: f76f4a85 00000004 ffd7a264 ffd7a278
0x0f4dd98c: 7be57964 00000000 f7709000 00000000
0x0f4dd99c: 00000001 00000032 00000010 f76f49eb
require 'rubygems'
require 'json'
require 'pry'
require 'open-uri'
filename = ARGV[0]
if !filename || filename == ''
puts 'Give the path to JSON comments file as downloaded from e.g. https://www.reddit.com/r/RandomActsOfGaming/comments/4ijyqj.json'
exit 1