Skip to content

Instantly share code, notes, and snippets.

View lorenzschmid's full-sized avatar

Lorenz Schmid lorenzschmid

  • ACP Advanced Circuit Pursuit AG
  • Zurich, Switzerland
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import zipfile
from BeautifulSoup import BeautifulSoup, Tag # Better for HTML
from lxml import etree # Better for XML
@c18s
c18s / docker-compose-acme.yml
Last active April 24, 2019 08:54
acme.sh docker compose
## --- Docker Compose ---
version: '2'
services:
acme.sh:
image: neilpang/acme.sh container_name: acme.sh
restart: always
environment:
- Namecom_Username=
- Namecom_Token=
volumes:
@jaivikram
jaivikram / getVideoDetails.py
Last active April 18, 2020 13:02
Python gist to obtain video details like duration, resolution, bitrate, video codec and audio codec, frequency using 'ffmpeg'
#! /usr/bin/env python
import os
import sys
import re
import tempfile
def getVideoDetails(filepath):
tmpf = tempfile.NamedTemporaryFile()
os.system("ffmpeg -i \"%s\" 2> %s" % (filepath, tmpf.name))
lines = tmpf.readlines()
@matthewpizza
matthewpizza / install-composer.sh
Created February 13, 2014 03:55
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@matshofman
matshofman / gist:4145718
Created November 25, 2012 22:41
RA Dec to Alt Az converter
using System;
namespace RaDecToAltAz
{
/// <summary>
/// Explenation of the calculations at http://www.stargazing.net/kepler/altaz.html
/// </summary>
class RaDecToAltAz
{
double RA = 250.425; // 16 h 41.7 m * 15
@mattsches
mattsches / configuration.yaml
Created May 8, 2017 21:35
Beispiel für RESTful Sensor in Home Assistant zur Abfrage des luftdaten.info API
sensor:
- platform: rest
resource: http://api.luftdaten.info/v1/sensor/1777
value_template: >
{% if value_json is sequence %}
{% set sensor = value_json | last %}
{% else %}
{% set sensor = value_json %}
{% endif %}
{% for sdv in sensor.sensordatavalues %}
@guerrerocarlos
guerrerocarlos / htpasswd.py
Created July 27, 2012 23:55
Python script for generating htaccess passwords
#!/usr/bin/python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from optparse import OptionParser
# We need a crypt module, but Windows doesn't have one by default. Try to find
@mattrude
mattrude / GnuPG-2.1.md
Last active September 10, 2023 12:05
GnuPG 2.1.18 Build Instructions for Ubuntu 16.04 LTS

GnuPG 2.1.20 Build Instructions

Below you is my build instructions for GnuPG 2.1.20 released on 03-Apr-2017. These instructions are built for a headless Ubuntu 16.04 LTS server.

Or if you wish, you may use the install script to install GnuPG 2.1.20 by entring the following:

curl -sL "https://gist.github.com/mattrude/3883a3801613b048d45b/raw/install-gnupg2.sh" |sh

Install the needed depends

apt-get -y install libgnutls-dev bzip2 make gettext texinfo gnutls-bin \

@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@torarnv
torarnv / revert-windows-acl.sh
Created January 21, 2019 15:09
Disabling Windows ACL for a Synology share
#!/bin/bash
# Run in share directory, e.g. /volume1/foo
echo "Removing share '$1' without removing files..."
sudo synoshare --del FALSE $1
echo "Changing ownership of files..."
sudo chown -R $USER:users . *