This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Receiving Phone Call: | |
--------------------- | |
By using Postman: | |
1. Get available Phone numbers: | |
Invoke: GET https://{{BASE_URL}}/PhoneNumbers/Available?is_sms=true&search_by=region&search_on=CA | |
Headers: X-Api-Key => ykFccAt1QpnJApkagGsLv4VkV8jbTODS | |
Number we pick: <Pick a number> | |
2. Provision selected phone number - if we have done it in prior step, skip this step: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create DockerMachine & deploy containers on it: | |
----------------------------------------------- | |
1. Run these command to create docker machine on AWS EC2: | |
docker-machine create --engine-install-url=https://web.archive.org/web/20170623081500/https://get.docker.com \ | |
--driver amazonec2 \ | |
--amazonec2-access-key AKI************* \ | |
--amazonec2-secret-key 7j****************************** \ | |
--amazonec2-instance-type t2.nano \ | |
--amazonec2-region ap-southeast-1 <docker-machine-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as aws from "aws-sdk"; | |
const kms = new aws.KMS({ region: "us-east-1" }); | |
async function doStuff() { | |
// Encrypt | |
const encrypted = await kms.encrypt({ | |
KeyId: "alias/test-key", | |
Plaintext: "abcd", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Given, `enp6s0` is the Router's LAN interface connected to Wired LAN. | |
# And `enxfcde56ff0106` is the Router's interface connected to WAN or internet devices (e.g. Phone in Tethering mode, Wireless/USB dongle modem) | |
# Reference: http://www.nairabytes.net/81-linux/418-how-to-set-up-a-nat-router-on-ubuntu-server-16-04 | |
# Enable NAT on interface enxfcde56ff0106, use enxfcde56ff0106 for outgoing packets | |
iptables -t nat -A POSTROUTING -o enxfcde56ff0106 -j MASQUERADE | |
# Forward IP-packets from enxfcde56ff0106 to enp6s0 where there is an established initial request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const aws = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const homeRegion = "us-east-1"; | |
const accessKeyId = "YOURACCESSKEYID"; | |
const secretAccessKey = "YOURSECRETACCESKEY"; | |
// load AWS SES | |
const ses_config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Instructions: | |
# ------------- | |
# 1. Save this script into an `.sh` file (e.g. cpuinfo.sh). | |
# 2. Make the `.sh` file to be executable by running `chmod` command. Example: chmod 755 cpuinfo.sh | |
# 3. Optionally, you could create a symbolic link to the `.sh` file. Example: ln -s cpuinfo.sh cpuinfo | |
# 4. An example of running the script on CLI terminal: `./cpuinfo.sh` or `./cpuinfo` if you created a symbolic link in prior step. | |
# 5. You can use `watch` command, in case you want to show the output of the script & refreshed periodically for each 2 seconds, 5 seconds, etc. | |
# Example: `watch -n 2 ./cpuinfo.sh` or `watch -n 2 ./cpuinfo` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# uname –a => Display linux system information | |
# uname –r => Display kernel release information (refer uname command in detail) | |
# cat /etc/redhat_release => Show which version of redhat installed | |
# uptime => Show how long system running + load (learn uptime command) | |
# hostname => Show system host name | |
# hostname -i => Display the IP address of the host (all options hostname) | |
# last reboot => Show system reboot history (more examples last command) | |
# date => Show the current date and time (options of date command) | |
# cal => Show this month calendar (what more in cal) | |
# w => Display who is online (learn more about w command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Redux from 'redux'; | |
// declare a function which takes state & action args (the reducer) | |
const reducer = (state = [], action) => { | |
// Act based on specific action.type | |
if (action.type === 'split_string') { | |
return action.payload.split(' '); | |
} | |
else if (action.type === 'add_char') { | |
return [...state, '!']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE USER_ACCOUNTS ( | |
ID NUMBER(10) NOT NULL, | |
EMAIL VARCHAR(30) NOT NULL, | |
PASSWORD VARCHAR(100) NOT NULL | |
); | |
ALTER TABLE USER_ACCOUNTS ADD ( | |
CONSTRAINT user_acc_pk PRIMARY KEY (ID) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App.js is the root component of the RN app. | |
import React, { Component } from 'react'; | |
import { View, } from 'react-native'; | |
// Your custom components | |
import { Header } from './components/common'; | |
import LibraryList from './components/LibraryList'; | |
// 1. Import redux's createStore function & react-redux's Provider component | |
import { createStore } from 'redux'; |
OlderNewer