Skip to content

Instantly share code, notes, and snippets.

@HQarroum
HQarroum / aws-iot-with-alpn.js
Last active May 4, 2020 15:05
Using the AWS IoT SDK with ALPN extensions to connect over MQTTS on port 443
const client = require('aws-iot-device-sdk');
// The options object to provision the MQTT client with.
// Update values between chevrons with the appropriate values.
const opts = {
host: "<aws-iot-endpoint>",
keyPath: "<path-to-private-key>",
certPath: "<path-to-device-certificate>",
caPath: "<path-to-root-ca>",
// We are specifying that we want to connect on the
@mac2000
mac2000 / webstorm.cmd
Last active September 1, 2020 18:46 — forked from amnuts/phpstorm.bat
Open with WebStorm context menu
@ECHO OFF
REM Remove registry if any
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /f
REM Get WebStorm executable path
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CLASSES_ROOT\Applications\WebStorm.exe\shell\open\command"`) DO (
SET WEBSTORM=%%A %%B
)
@nrollr
nrollr / Commands.sh
Last active January 10, 2023 11:55
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
## when installing on Amazon Linux AMI, use:
$ sudo yum install nginx -y
## when installing on Amazon Linux 2 AMI, use
$ sudo amazon-linux-extras install nginx1.12 -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y
@M1chaelTran
M1chaelTran / WebStorm.cmd
Created August 17, 2017 11:04
Add `Open with WebStorm` to Windows right click context menu
@echo off
:: change the path below to match your installed version
SET WebStormPath=C:\Program Files\JetBrains\WebStorm 2017.2.2\bin\webstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f