Skip to content

Instantly share code, notes, and snippets.

@utaani
utaani / tesseract_sample.json
Created Mar 29, 2021
node-red-contrib-tesseract sample flow with file inject node(node-red-contrib-browser-utils).
View tesseract_sample.json
[
{
"id": "4951fa21.d91c34",
"type": "tesseract",
"z": "3600b874.387198",
"name": "",
"language": "jpn",
"x": 140,
"y": 180,
"wires": [
@utaani
utaani / linenotifywithimage.json
Created Nov 23, 2019
LineNotify with Image sample (function node「メッセージ作成」のtokenstringsの部分をご自身のものに入れ替えてください)
View linenotifywithimage.json
[
{
"id": "f8520b99.0d75c",
"type": "inject",
"z": "fe7d9b9b.368ed8",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
@utaani
utaani / nrpiadminpass.sh
Last active Oct 2, 2019
admin password creator for Node-RED on Raspberry Pi
View nrpiadminpass.sh
#!/bin/bash
# password setter for Node-RED on Raspberry Pi
# auther: utaani@ueno.org
#
# usage: bash nrpiadminpass.sh password
#
# this script will change Pi default Node-RED file.
# after that, you need nodered restart with node-red-restart
# password
View sample-swith-with-without-recreate.json
[
{
"id": "34d42654.9be66a",
"type": "switch",
"z": "1f17baae.3051ed",
"name": "補正あり",
"property": "payload",
"propertyType": "msg",
"rules": [
{
@utaani
utaani / rPi3-ap-setup.sh
Last active Jan 5, 2017 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
View rPi3-ap-setup.sh
#!/bin/bash
#
# This version uses September 2016 rpi jessie image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
View node-red-google-cloud-vision-ocr.json
[
{
"id": "b9814cc7.854288",
"type": "template",
"z": "cec74554.ecbe",
"name": "JSON template",
"field": "payloadrule",
"fieldType": "msg",
"format": "json",
"syntax": "plain",
@utaani
utaani / get_cybozulive_access_taken.pl
Created Sep 2, 2013
get_cybozulive_access_taken.pl : サイボウズLive! にAPIでアクセスするのに必要なアクセストークンをxAuthで取得する。 OAuth::Lite::Consumer http://search.cpan.org/~lyokato/OAuth-Lite-1.31/ を使う。 Developer Center https://developer.cybozulive.com/ でデベロッパー登録した上で、アプリケーション登録をして Consumer Key/Consumer Secretを取得する。 SSLをProxy経由で用いるため、Net::SSLを使うように上書きする。 参考: https://developer.cybozulive.com/…
View get_cybozulive_access_taken.pl
#!/usr/bin/perl
use OAuth::Lite::Consumer;
use Data::Dumper;
$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$ENV{HTTPS_PROXY} = 'http://192.168.11.254:8080';
my $consumer = OAuth::Lite::Consumer->new(
@utaani
utaani / ltsv2tsv.pl
Created Jul 10, 2013
LTSVのラベルをはずしてTSVに変換。cutとかで処理しやすいように。
View ltsv2tsv.pl
#!/usr/bin/perl
my $line;
my $param;
my @params;
while($line=<STDIN>) {
my @keys;
my @vals;
chomp($line);
@params=split(/\t/,$line);
foreach $param (@params) {
@utaani
utaani / seteth1.sh
Created Mar 22, 2012
ifconfig eth1 with fixed IP address on Amazon-VPC ENI(Elastic Network Interface)
View seteth1.sh
#!/bin/sh
# set IP address with Amazon-VPC ENI(Elastic Network Interface) address and other.
# get eth0/1 MAC addresses
MACADDR0=`cat /sys/class/net/eth0/address`
MACADDR1=`cat /sys/class/net/eth1/address`
# get eth0/1 IP addresses on ENI
IPADDR0=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR0}/local-ipv4s/`;
IPADDR1=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR1}/local-ipv4s/`;
# ifconfig on eth1 (ENI)
/sbin/ifconfig eth1 inet ${IPADDR1} netmask 255.255.255.0 2>&1 >> /tmp/seteth1.log