Skip to content

Instantly share code, notes, and snippets.

@onli
onli / Lightpack.ini
Created July 2, 2015 20:54
Lightpack.ini
[General]
IsBacklightEnabled=true
LightpackMode=Ambilight
[Device]
Brightness=100
ColorDepth=128
Gamma=2
RefreshDelay=100
Smooth=100
@onli
onli / hyperion.config.json
Created August 5, 2015 10:12
hyperion config for lightpack in andromeda configuration
// Automatically generated configuration file for 'Hyperion daemon'
// Generated by: HyperCon (The Hyperion deamon configuration file builder
{
/// Device configuration contains the following fields:
/// * 'name' : The user friendly name of the device (only used for display purposes)
/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp8806',
/// 'lpd6803', 'sedu', 'adalight', 'lightpack', 'test' and 'none')
/// * 'output' : The output specification depends on selected device. This can for example be the
/// device specifier, device serial number, or the output file name
@onli
onli / tarsnap_outage.txt
Created July 28, 2016 08:41
Tarsnap outage 2016-07-24 10:15:19--11:40:04
At approximately 2016-07-24 10:15:19 UTC, the Tarsnap service went offline
due to a sequence of events culminating in a filesystem becoming full. All
Tarsnap customer data remained safely stored for the duration, but archives
which were in the process of being created at that time would have failed
("too many network failures") and no further archives could be created or
retrieved until the service came back online 85 minutes later at approximately
2016-07-24 11:40:40 UTC.
While Tarsnap does not have any formal SLA, I have a (rather ill-defined)
policy of issuing credits to Tarsnap users affected by outages or bugs in
@onli
onli / izulu
Created September 5, 2016 11:02
izulu 1.1
#!/bin/bash
# izulu - Change the wallpaper according to the weather
#
# Copyright (C) 2009 Malte Paskuda
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
@onli
onli / make.log
Created October 4, 2016 21:08
radeon-profile build fail
onli@Fallout:~/.../radeon-profile/radeon-profile$ qmake && make
/usr/lib64/qt4/bin/uic radeon_profile.ui -o ui_radeon_profile.h
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o radeon_profile.o radeon_profile.cpp
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/u
# mol: A maybe ordered list, by preserving some order on merge
#
# Concept:
# We have an ordered list with values. If another list shall be merged in,
# merge each new item below an item known in both lists that has a higher
# value (=big brother), or above one that has a smaller value. If there
# exists no such item, use the item value to find a higher item, and
# insert below. When adding an item that exists already, average its value
# and reposition as if it were a new item.
#
require './maybeOrderedList.rb'
mol = MaybeOrderedList.new()
itemsA = [['a', 10], ['c', 1], ['b', 5]]
itemsA.each do |item, value|
mol.add(item, value)
end
puts 'mol'
class ElectedOrderedListItem
# subitem: the item itself, the payload
# lowerItems: A list of items that were seen before this item
# seen: How often it was seen before
# rating: rating to store if there is no other way
attr_accessor :payload, :rating, :seen, :lowerItems
def initialize(payload, rating)
@onli
onli / izulu-1.1
Created April 23, 2017 14:22
izulu with KDE plasma detection
#!/bin/bash
# izulu - Change the wallpaper according to the weather
#
# Copyright (C) 2009 Malte Paskuda
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
@onli
onli / mysqli.inc.php
Created March 23, 2020 14:58
Before my changes, with charset debug output
<?php
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/**
* Tells the DB Layer to start a DB transaction.
*
* @access public
*/
function serendipity_db_begin_transaction(){