Skip to content

Instantly share code, notes, and snippets.

@drucko
drucko / Readme.md
Created November 18, 2021 12:11 — forked from bergantine/Readme.md
Vagrant config for Apache + mod_ssi
@drucko
drucko / RaspberryPi-RFID
Created October 3, 2019 23:33 — forked from mattgorecki/RaspberryPi-RFID
Python script to read RFID card from serial RFID reader attached to a Raspberry Pi. Also has a Exit button. The card swipe releases the maglock on the door.
#!/usr/bin/python2
import serial
import re, sys, signal, os, time, datetime
import RPi.GPIO as GPIO
BITRATE = 9600
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
@drucko
drucko / FruitComboApplication.java
Created February 16, 2018 20:27 — forked from jewelsea/FruitComboApplication.java
JavaFX fxml combo box selection demonstration app
package fruit;
import java.io.IOException;
import java.net.URL;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
@drucko
drucko / Ansible Let's Encrypt Nginx setup
Created December 14, 2017 12:53 — forked from mattiaslundberg/Ansible Let's Encrypt Nginx setup
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@drucko
drucko / letsencrypt_2017.md
Created November 20, 2017 16:41 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@drucko
drucko / post_acc_doc.rb
Created July 18, 2017 11:01 — forked from mydoghasworms/post_acc_doc.rb
Example of using Ruby nwrfc gem to post documents to an SAP ECC system using BAPI_ACC_DOCUMENT_POST
#!/usr/bin/ruby
require 'nwrfc'
require 'logger'
include NWRFC
# This is an example of a Ruby script using the nwrfc gem to post Accounting documents to
# an SAP ECC system using BAPI_ACC_DOCUMENT_POST. You can obviously easily adapt it to
# your needs
@drucko
drucko / ghe-lxc-image
Created September 7, 2016 20:00 — forked from ei-grad/ghe-lxc-image
Script to convert Github Enterprise OVA image to tar.gz for LXC.
#!/bin/bash
[ "`whoami`" != "root" ] && echo "Should be run by root!" && exit 1
[ -e *.vmdk ] || ( echo Extracting VMDK image from *.ova ... ; tar xf *.ova )
[ -e github.img ] || ( echo Converting *.vmdk to raw image ... ; qemu-img convert *.vmdk github.img )
echo Preparing mounts ...
losetup -f github.img -P
vgchange -ay enterprise-11
@drucko
drucko / fdisk.in
Created December 30, 2015 11:33 — forked from icopitg-fh/fdisk.in
Buildroot image install script. We use syslinux to boot the system. fdisk.in file is a necessary include that automates the creation of our partitions.
d
1
d
2
d
3
d
4
n
p
@drucko
drucko / DownloadStationAPI.py
Created November 25, 2015 17:18 — forked from harperreed/DownloadStationAPI.py
example script to sync/download/etc put.io downloads to your synology download station
import time
import requests
import json
class DownloadStationAPI():
def __init__(self, host=None, username=None, password=None):
self.name = 'DownloadStation'

1. Install dependencies

apt-get install automake avahi-daemon build-essential checkinstall db5.1-util db-util git-core libacl1-dev libavahi-client-dev libdb5.1-dev libgcrypt11 libgcrypt11-dev libpam0g-dev libtool pkg-config

2. Download and unpack source

cd /usr/src/
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.1.6.tar.gz
tar -xvzf netatalk-3.1.6.tar.gz