Skip to content

Instantly share code, notes, and snippets.

View klein0r's full-sized avatar
🏠
Working on my smart home

Matthias Kleine klein0r

🏠
Working on my smart home
View GitHub Profile
@jauderho
jauderho / gist:6b7d42030e264a135450ecc0ba521bd8
Last active April 29, 2024 13:48
HOWTO: Upgrade Raspberry Pi OS from Bullseye to Bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
@coenraadhuman
coenraadhuman / inotify.md
Last active April 23, 2024 09:09
Increasing the amount of inotify watchers

Increasing the amount of inotify watchers

Take note this is my personal edited version and the command related to Arch has been changed to work on my Arch system.

Increase inotify watchers

@tobi-pb
tobi-pb / archive.php
Created November 2, 2015 16:49
Repack Magento Extension after running `tar xfvz extension.tgz`
<?php
require_once 'abstract.php';
//
//
// PLEASE SET EDIT packages.xml and update md5 hashes!
class Mage_Shell_Archive extends Mage_Shell_Abstract
{
@mam08ixo
mam08ixo / data-upgrade-0.1.67-0.1.68.php
Last active October 30, 2015 22:02 — forked from avoelkl/upgrade-0.1.67-0.1.68.php
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
<?php
/**
* @category Namespace
* @package Namespace_Module
* @author Anna Völkl
* @author Christoph Aßmann
* @author Fabian Schmengler
*/
/** @var Mage_Core_Model_Resource_Setup $installer */
@rfox90
rfox90 / clock.cgi
Created October 19, 2015 02:55
Simple example of an lametric endpoint in perl.
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use JSON;
my $json = JSON->new->pretty->allow_nonref;
my $q = CGI->new;
@raybogman
raybogman / SupportDesk_FixAcl.php
Last active July 6, 2018 19:00
SupportDesk_FixAcl
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@ScreamingDev
ScreamingDev / sendmail
Last active July 12, 2016 19:11
PHP local send mail (/usr/local/bin/sendmail)
#!/usr/bin/php
<?php
$input = file_get_contents('php://stdin');
preg_match('|^To: (.*)|', $input, $matches);
$filename = tempnam('/var/log/mail', date('ymd-his-') . $matches[1] . '.');
file_put_contents($filename, $input);
@messageagency
messageagency / pconnect.sh
Last active March 30, 2021 21:47
Pantheon DB Connection Script
#!/bin/sh
# exit on any errors:
set -e
if [ $# -lt 1 ]
then
echo "Usage: $0 @pantheon-alias"
exit 1
fi
@upvalue
upvalue / amazon.rb
Last active December 23, 2016 06:01
Amazon affiliate filters for jekyll.
# amazon.rb - amazon affiliate links for jekyll
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id
# usage: {{ asin | amazon_product_href }}
# returns url of a product
# usage: {{ asin | amazon_image_href: 'M' }}
# returns image of the product, size argument can be S, M, or L, default M
# usage: {{ asin | amazon_product: 'A Product' }}