Skip to content

Instantly share code, notes, and snippets.

View anders0l's full-sized avatar

Andrei Solovev anders0l

View GitHub Profile
@ajumalp
ajumalp / Install Mosquitto MQTT on Synology NAS Server.txt
Last active May 2, 2024 03:00
Install Mosquitto MQTT on Synology NAS Server
From https://synocommunity.com add http://packages.synocommunity.com to your NAS package sources.
For that, go to NAS->Package Cnter->Click Settings->Package Sources tab.
Then from the community, you can see Mosquitto. Install it.
After installing, please stop the Mosquitto service before updating configuration. You can start service after changes.
Enable Admin login for Synology
Enable SSH in NAS
Download putty and connect to NAS Server
Login using admin
Change to root user [sudo -i, {use admin password}]
Find mosquitto.conf file [find / -name mosquitto.conf]
@gwillz
gwillz / draft-js-plugins.d.ts
Created July 5, 2018 08:53
Naive TypeScript support for draft-js-plugins
/// <resources type="react" />
/// <resources type="draft-js" />
declare module "draft-js-plugins-editor" {
export type PluginsEditorProps = Draft.EditorProps | {
plugins: any,
}
export default class PluginsEditor
extends React.Component<PluginsEditorProps, Draft.EditorState> {}
@yandzee
yandzee / index.js
Last active September 3, 2020 02:35
Code retry with promises
// Author: Renat Tuktarov (renat@sourcerer.io)
const retry = function(fn, prev) {
return new Promise((current, reject) => {
const resolve = _ => (prev && prev()) || current();
fn(resolve, delay => {
setTimeout(_ => {
retry(fn, resolve);
}, delay);
@edsiper
edsiper / kubernetes_commands.md
Last active April 4, 2024 03:27
Kubernetes Useful Commands
@sid24rane
sid24rane / net.js
Last active February 7, 2024 08:05
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@jeka-kiselyov
jeka-kiselyov / index.js
Last active October 4, 2018 09:28
CloudWatch to AWS Lambda to Slack Channel Alerts and Charts. Posts CloudWatch Alerts via SNS topic via Lambda function to Slack channel. And draws charts for CPUUtilization metrics(both for EC2 abd RDS).
////// Save as index.js and upload it to Lambda as zip archive with node_modules directory. After:
////// npm install aws-cloudwatch-chart
////// npm install request
////// no need to upload aws-sdk module
////// Don't forget to change API keys here.
////// License: MIT
////// Docs: