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 / 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 / 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:
-
options:
partialRootPaths: ['resource://My.FirstPackage/Private/Partials']
@RafaelKa
RafaelKa / SIDs_Apache_2.4.6-3.sh
Created September 13, 2013 21:59
So and in this order is it possible to install Apache HTTPD 2.4.6-3 from SID repository whitout addeng this to sources list.
mkdir -p DEBS_FROM_SID/apache2.4
cd DEBS_FROM_SID/apache2.4
wget http://ftp.de.debian.org/debian/pool/main/e/eglibc/locales_2.17-92_all.deb
wget http://ftp.de.debian.org/debian/pool/main/e/eglibc/libc6_2.17-92+b1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/a/apr/libapr1_1.4.8-1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/a/apr-util/libaprutil1_1.5.2-1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/a/apr-util/libaprutil1-dbd-mysql_1.5.2-1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/a/apr-util/libaprutil1-dbd-sqlite3_1.5.2-1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.2-1.3_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/u/unixodbc/libodbc1_2.2.14p2-5_amd64.deb

Lua script and VHost.conf for generating mass virtual hosting environment like "user_dir" with "auto-map" on PHP5-FPM

Create unix users and add www-data to theyr groups.

Chown directories /srv/projects/projectname/workingspace to users and crate fpm-pools and put ports for fpm dependent on projectname in fpm-socket-ports-by-project-name.txt

@RafaelKa
RafaelKa / Settings.yaml
Last active December 21, 2015 14:39
Using cboden/Ratchet with TYPO3 Flow
TYPO3:
Flow:
reflection:
ignoredTags: ['event', 'temporary', 'type', 'note']
@RafaelKa
RafaelKa / PropertyIntroductionAspect.php
Created August 19, 2013 15:09
You can put assignPropertiesToORM() method to your aspect class and modify rows 82-89.
<?php
namespace ..........
use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @Flow\Scope("singleton")
* @Flow\Aspect