Skip to content

Instantly share code, notes, and snippets.

View klan's full-sized avatar

Klaus Nielsen klan

View GitHub Profile
@klan
klan / hyperion.config.json
Last active August 29, 2015 14:08
hyperion.config.json for Lightberry (ws2801) curl -L --output /opt/hyperion/config/hyperion.config.json --get https://gist.githubusercontent.com/klan/cde160972e681c1a36ad/raw/16484aceffce6c253776cb458805b53a176c69e1/hyperion.config.json
// 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
Update and install requirements:
› sudo apt-get update
› sudo apt-get dist-upgrade
› sudo apt-get install matchbox chromium x11-xserver-utils ttf-mscorefonts-installer xwit sqlite3 libnss3
Curl to desktop, cat file and copy-paste into existing files:
› curl -L --output /home/pi/Desktop/config.txt --get https://gist.githubusercontent.com/klan/7482956/raw/ebe5b60527aad2bec93e23035cbc07ee5b6a3d9b/config.txt
› curl -L --output /home/pi/Desktop/rc.local --get https://gist.githubusercontent.com/klan/7482956/raw/33786a1c5c9448bf30cd037950169679a718fb79/rc.local
Curl new file to location:
@klan
klan / Google Power Search Class
Created October 22, 2013 11:46
Google Power Search Class
• define […]
- Defines a word, in english, also on the danish site
• #[…]
- Searches the web for hashtags
• +[…]
- Searches Google+
• $[…]
- Given a number, searches for a price
• @[…]
- Given a name, seaches for people (on mostly social networks)
@klan
klan / Installing Drupal with drush
Created October 22, 2013 09:20
Step-by-step Drupal install with drush. Includes installation of: Omega theme (and sub-theme), Adminimal theme, Adminimal admin menu, Module Filter, Views, Context, ctools, Devel, Diff, Features, Entity API, Entity Reference, jQuery Update, Pathauto and Token.
› drush dl drupal --drupal-project-rename="projectname"
• Install site
› cd projectname/sites/all/modules/
› mkdir contrib custom
› drush dl adminimal_theme adminimal_admin_menu module_filter
› drush en -y adminimal_admin_menu module_filter
› drush variable-set admin_theme adminimal
@klan
klan / drupal-bootstrap.php
Created July 21, 2013 16:33
Drupal bootstrap
<?php
// Get path of drupal install and strip path to module
$drupal_path = preg_replace('@\/sites\/[a-zA-Z_/]+@i', '', getcwd());
// Create a constant DRUPAL_ROOT that defines our path to the drupal install
define('DRUPAL_ROOT', $drupal_path);
// require bootstrap
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
@klan
klan / basic-regex
Created June 23, 2013 11:18
Basic regex
Metachar. Name Matches
. dot Any one character
[...] class Any character listed
[^...] negated class Any character NOT listed
-------------------------------------------------------------
^ caret Start of line
$ dollar End of line
\< backslash less-than Start of word
\> backslash greater-than End of word