Skip to content

Instantly share code, notes, and snippets.

@toygame
toygame / .gitlab-ci.yaml
Created April 19, 2021 02:07
Gitlab-ci and Semantic-release
image: node:latest
stages:
- release
deploy_production:
stage: release
only:
refs:
- master
@toygame
toygame / .releaserc.yaml
Last active January 17, 2023 23:20
Semantic-release configuration that deploys on Gitlab
branches: ['master']
ci: true
debug: true
dryRun: false
tagFormat: '${version}'
# Global plugin options (will be passed to all plugins)
preset: 'conventionalcommits'
gitlabUrl: 'https://gitlab.com/' # your gitlab url
# slackWebhook: 'https://slack.xxx.com/hooks/q3dabbqc6yjyg9x6616o3atgkkr'
const main = (app, client) => {
/* GET home page. */
app.get('/', function (req, res) {
res.render('index', {
title: 'nodejs-tasmota'
});
});
app.get('/control/on', function (req, res) {
const fullTopic = `tasmota/cmnd/tasmota-1/POWER`
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<link rel="stylesheet" href="/stylesheets/style.css" />
</head>
<body>
<h1><%= title %></h1>
<p>Welcome nodejs-tasmota</p>
<button id="butt_on">เปิด</button>
const createError = require('http-errors');
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
//------------MQTT section------------//
const mqtt = require('mqtt') // import mqtt connect
// mqtt configuration
const mqttConfig = {
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 16, 2019 at 06:38 PM
-- Server version: 5.5.42-1
-- PHP Version: 5.6.5-2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 16, 2019 at 06:38 PM
-- Server version: 5.5.42-1
-- PHP Version: 5.6.5-2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
var mqtt = require('mqtt');
const MQTT_SERVER = "Your Server Address";
const MQTT_PORT = "1883";
//if your server don't have username and password let blank.
const MQTT_USER = "";
const MQTT_PASSWORD = "";
// Connect MQTT
var client = mqtt.connect({
@toygame
toygame / TTN_ABP.ino
Created July 14, 2019 16:48
Sketch for Testing connect with LoRa Server Project
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
// LoRaWAN NwkSKey, network session key
// This is the default Semtech key, which is used by the early prototype TTN
// network.
static const u4_t DEVADDR = 0x018796ad;
//Set network session key
static const PROGMEM u1_t NWKSKEY[16] = { 0x5f, 0xe9, 0x61, 0x37, 0x4b, 0xe8, 0xaf, 0xb2, 0x1a, 0x7a, 0x44, 0xeb, 0x8d, 0xb5, 0xff, 0x07 };
@toygame
toygame / lora-app-server.toml
Created July 3, 2019 17:48
Configuration file for LoRa App Server
[general]
# Log level
#
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=4
# The number of times passwords must be hashed. A higher number is safer as
# an attack takes more time to perform.
password_hash_iterations=100000