Skip to content

Instantly share code, notes, and snippets.

@RafaelKa
RafaelKa / Modbus_RTU_Relay_16CH.items
Last active March 28, 2024 18:14
OpenHab : WAVESHARE Modbus RTU Relay 16CH
// WAVESHARE Modbus RTU Relay 16CH : OpenHab : items
Switch RTU_16CH_01 "DC-Relay 01" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_01:switch"}
Switch RTU_16CH_02 "DC-Relay 02" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_02:switch"}
Switch RTU_16CH_03 "DC-Relay 03" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_03:switch"}
Switch RTU_16CH_04 "DC-Relay 04" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_04:switch"}
Switch RTU_16CH_05 "DC-Relay 05" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_05:switch"}
Switch RTU_16CH_06 "DC-Relay 06" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_06:switch"}
Switch RTU_16CH_07 "DC-Relay 07" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_07:switch"}
Switch RTU_16CH_08 "DC-Relay 08" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_08:switch"}
Switch RTU_16CH_09 "DC-Relay 09" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_09:switch"}
@RafaelKa
RafaelKa / JWTProvider.php
Created February 2, 2016 23:27
Garbage collection for one-time JWTs in voryx/Thruway apps. Note: No validation and sign verification included here.
<?php
namespace Acme\Package\Security\Authentication\Provider;
use Lcobucci\JWT\Parser;
use Lcobucci\JWT\Signer;
use Lcobucci\JWT\Signer\BaseSigner;
use Lcobucci\JWT\Token;
use Lcobucci\JWT\ValidationData;
use React\EventLoop\LoopInterface;
use Thruway\Authentication\AbstractAuthProviderClient;
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
nginx
Reading changelogs...
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/461 kB of archives.
After this operation, 1023 kB of additional disk space will be used.
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 46399 files and directories currently installed.)
....
Hit http://mirror.1und1.de jessie/non-free Translation-en
Fetched 595 kB in 4s (127 kB/s)
W: Failed to fetch http://packages.openmediavault.org/public/dists/erasmus/Release.gpg Unable to connect to packages.openmediavault.org:http:
W: Failed to fetch http://packages.openmediavault.org/public/dists/erasmus/main/i18n/Translation-en_US Unable to connect to packages.openmediavault.org:http:
W: Failed to fetch http://packages.openmediavault.org/public/dists/erasmus/main/i18n/Translation-en Unable to connect to packages.openmediavault.org:http:
W: Failed to fetch http://packages.openmediavault.org/public/dists/erasmus/main/binary-amd64/Packages Unable to connect to packages.openmediavault.org:http:
@RafaelKa
RafaelKa / power_supply.sh
Last active August 28, 2015 15:36
This script shows power_supply properties from AXP209 from cubietruck
#!/usr/bin/env bash
# This script shows power_supply properties from AXP209
# You can run it without arguments or with ALL as argument to show all available properties.
# Or you can specify a list of properties as argument, which you want to show.
# If you want only one property, this script prints it without property name!
declare -A POWER_SUPPLY_PROPERTIES
# 0x80 0x40 0x20 0x10 0x08 0x04 0x02 0x01
@RafaelKa
RafaelKa / TYPO3.Neos.Untranslated-Strings.txt
Last active August 29, 2015 14:26
A list with untranslated strings from TYPO3.Neos project
clickToDelete
clickToEdit
clickToView
users.accountsAndRoles
users.createNew
users.name
users.youCannotDeleteYourself
module.administration.packages.index.legend
Package.Name
<?php
namespace Your\Package\ViewHelpers\Format;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* ViewHelper rendering the given HTML string through HTMLPurifier
*/
class PurifyViewHelper extends AbstractViewHelper {
@RafaelKa
RafaelKa / README.md
Last active February 20, 2016 18:44
Jetson TK1 integrated RTC WakeUp demo

download wake_jetson_up_in.c file and compile with following command:

wget https://gist.githubusercontent.com/RafaelKa/b1cbb4990a04134dcc03/raw/wake_jetson_up_in.c
gcc -s -Wall -Wstrict-prototypes wake_jetson_up_in.c -o wake_jetson_up_in

run

sudo ./wake_jetson_up_in 180
@RafaelKa
RafaelKa / README.md
Last active August 29, 2015 14:01 — forked from progandy/README.md

mod_proxy_handler

This module for apache 2.4 allows you to use e.g. mod_proxy_fcgi in AddHandler or SetHandler directives.

Compile and install the module with apxs:

apxs -i -a -c mod_proxy_handler.c

Example:

@RafaelKa
RafaelKa / Routes.yaml
Created April 1, 2014 12:45
econics subfolders for actioncontroller
##
# subfolder, controller and action with optional format
-
name: 'subfolder, controller and action with optional format'
uriPattern: '{@cf}/{@cn}/{@action}(.{@format})'
defaults:
'@package': 'Foo.Bar'
'@controller': '{@cf}\{@cn}'
'@format': 'html'