Skip to content

Instantly share code, notes, and snippets.

View jfqd's full-sized avatar

Stefan Husch jfqd

View GitHub Profile
@jfqd
jfqd / install_CUPS_all_defaults.sh
Created October 1, 2019 12:24 — forked from aweijnitz/install_CUPS_all_defaults.sh
Installing CUPS printer on Debian and add PDF printer
#!/bin/bash
sudo apt-get -y install cups
sudo apt-get -y install cups-pdf
# add pdf printer to cups
# - named files end up in ~/PDF/
# - unnamed files are stored in /var/spool/cups-pdf/ANONYMOUS/, such as PDF:s created by streaming bytes over an API
sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd
@jfqd
jfqd / usbupdate
Created May 28, 2019 12:41 — forked from sjorge/usbupdate
#!/usr/bin/bash
## CONFIG
# Lookup USBKEY: disklist -r
AUTO_REBOOT=1
MIRROR=us-east.manta.joyent.com
USBKEY=c1t0d0
## INIT
CURRENT_REFERENCE=$(curl -s -k https://${MIRROR}/Joyent_Dev/public/builds/smartos/ | grep release | tail -n 1 | json name)
@jfqd
jfqd / zfsbackup
Last active October 27, 2019 13:40
zfs backup solution
#!/usr/bin/env ruby
# install ruby requirements with:
# gem install terrapin
require 'terrapin'
require 'logger'
# Usage:
# DELETE_SNAPSHOTS=false DEBUG=true zfsbackup backup-storage.example.com local/pool remote/pool
@jfqd
jfqd / girosolution.rb
Last active December 19, 2018 12:11
ActiveMerchant Girosolution-Gateway
require 'openssl'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
#
# = Girosolution Gateway
#
# == Usage
#
# require 'active_merchant'
#

Use GnuPG to sign pkgsrc packages on SmartOS

I hope you have an public an private key already. If not there a lot of manuals out there who explain that very well.

Install the requirements

I would like to use gpg version 2 which supports gpg agent.

pkgin in gnupg2
#####################################
# Postfix
#
if [type] == "redis-input" and "postfix" in [@tags] {
grok {
match => [ "@message", "%{PF}" ]
add_tag => [ "postfix", "grokked" ]
patterns_dir => [ "/opt/logstash/patterns-extensions/" ]
}
@jfqd
jfqd / Spiegel-Adblocker-killer
Created September 26, 2017 20:05
I am not using the Adblock plugin, but spiegel.de shows me this Adblock hint and I cannot remove it. So I use this JavaScript snippet for it.
# Version for Safari 11
javascript:function%20startAdBlockDetectionWithDelay()%20{};$('.ua-detected').hide();$('#wrapper-content').css('opacity',1).css('filter','none').css('pointer-events','auto')
# Version for Safari 10
javascript:function%20startAdBlockDetectionWithDelay()%20{};$('.ua-detected').hide();
@jfqd
jfqd / com.qutic.backup_fms_databases.plist
Created July 12, 2017 10:11
launchd plist-Datei für das automatische Ausführen des backup_fms_databases-Skriptes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.qutic.backup_fms_databases</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
<array>
@jfqd
jfqd / export_contact_list_as_csv.applescript
Last active July 8, 2017 13:56
Export helper for macOS Contact application which creates a csv file
-- https://github.com/zopyx/addressbook2snom
set resultText to ""
set currentLine to ""
set numPhones to 0
tell application "Contacts"
-- Find the maximum number of phone numbers
repeat with x from 1 to the count of people
set thePerson to person x
@jfqd
jfqd / Snom.scpt
Last active October 5, 2018 07:30
This script enables the macOS Contact-Application to dial a phone-number via a SNOM hardware phone by clicking on the phone label
-- This script enables the macOS Contact-Application to dial a phone-number
-- via a SNOM hardware phone by clicking on the phone label.
--
-- (C) 2008 David Kreitschmann, K3com Kommunikationstechnik http://www.k3com.de
-- (C) 2017 Modification for SNOM 715 by Stefan Husch, https://qutic.com
--
-- Copy this script to ~/Library/Application\ Scripts/com.apple.AddressBook
-- on your macOS 10.11+ and change the phoneURL to your needs.
--
-- A chmod 0600 ~/Library/Application\ Scripts/com.apple.AddressBook/Snom.scpt