Skip to content

Instantly share code, notes, and snippets.

View JosefJezek's full-sized avatar

Josef Ježek JosefJezek

  • Heart of Europe
View GitHub Profile
@cluther
cluther / snmpindex_dct.py
Created March 7, 2013 18:11
snmpindex_dct example usage
from Products.DataCollector.plugins.CollectorPlugin import SnmpPlugin
from Products.DataCollector.plugins.CollectorPlugin import GetTableMap
class MyPlugin(SnmpPlugin):
relname = 'myrelation'
modname = 'ZenPacks.example.MyStuff'
snmpGetTableMaps = (
GetTableMap('sometable',
@makotot
makotot / Gruntfile.js
Last active December 19, 2015 13:49
grunt-contrib-watchでlivereload
module.exports = function (grunt) {
'use strict';
// grunt-contrib-watchのlivereloadオプションでlivereload
grunt.initConfig({
watch: {
html: {
files: '**/*.html',
tasks: [],
@thmsobrmlr
thmsobrmlr / restful_curl.sh
Created July 10, 2013 10:08
RESTFul Request with Curl.
# Set request method:
curl -X DELETE http://localhost:3000/books/1
# Set request parameters:
curl -d "book[title]=Test" -d "book[copyright]=1998" http://localhost:3000/books
# Set header:
curl -H "Accept: text/xml" http://localhost:3000/books/sections/1
@datenimperator
datenimperator / README.md
Last active September 7, 2016 09:47
Temporary fix for Gitlab sockets not working inside a LXC container on Proxmox 4.1

This is a temporary fix for a problem running Gitlab on Proxmox 4.1 inside a LXC container. Symptom: UNIX sockets created inside containers get wrong permissions. This seems to be related to AppArmor and the Debian kernel used by Proxmox. See this thread on the Proxmox forum for details.

Run apt-get install inotify-tools if you haven't installed inotifywait yet.

Place the first file in /usr/local/sbin/fix_gitlab.sh and make it executable: chmod 755 /usr/local/sbin/fix_gitlab.sh. Edit etc/rc.local to include it during boot.

@bsdlp
bsdlp / gist:5964937
Created July 10, 2013 09:42
owncloud nginx config
server {
listen 80;
server_name cloud.sjchen.net;
return 301 https://$server_name$request_uri; # enforce https
}
server {
server_name cloud.sjchen.net;
root /srv/owncloud;
var SHAKE_THRESHOLD = xxx;
var last_update = 0;
var x, y, z, last_x, last_y, last_z;
function deviceMotionHandler(eventData) {
var acceleration =eventData.accelerationIncludingGravity;
var curTime = newDate().getTime();
if ((curTime - lastUpdate)> 100) {
@fcoury
fcoury / txredns.py
Created July 10, 2011 07:17 — forked from gleicon/txredns.py
Python/Twisted/Redis backed DNS server.
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs
# fallback to google or any other DNS server to resolv domains not present on Redis
# to set a new domain on redis, just issue a SET domain.tld ip_addr
# run with twistd -ny txredns.tac
# gleicon 2011
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
from twisted.internet import defer
from twisted.python import log
@leifoolsen
leifoolsen / polymer-1.0-create-custom-element.md
Last active March 9, 2018 19:53
Polymer 1.0 : Custom elements

Polymer 1.0 : Custom elements

Simplest possible workflow

Minimal steps required to create a custom elemenet in Polymer 1.0, without any aid from tools like Yeoman and Gulp.

I have used the Quick tour of Polymer as a reference.

Prerequisites

@MichaelLawton
MichaelLawton / install-bluez-5.43.sh
Created February 11, 2017 02:53
How to use web bluetooth in Chrome/Opera on Ubuntu 16.04
# Download and install BlueZ 5.43 and libreadline7 packages
wget http://mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-0ubuntu2_amd64.deb
wget http://ftp.debian.org/debian/pool/main/b/bluez/bluez_5.43-1_amd64.deb
sudo dpkg -i libreadline7_7.0-0ubuntu2_amd64.deb
sudo dpkg -i bluez_5.43-1_amd64.deb
# Restart system or BlueZ service
# Enable chrome://flags/#enable-experimental-web-platform-features and restart Chrome
@briansalvattore
briansalvattore / api.js
Created March 16, 2018 22:42
Proxy to run Firebase Functions
'use strict';
const admin = require('firebase-admin');
module.exports = function (app) {
app.get('/api', function (req, res) {
res.json({ 'version': '0.1' })
});