Notes from installing Ubuntu 18.04 on a Lenovo ThinkPad X1 Extreme, with nvidia graphics.
- Turn off secure boot in the BIOS.
type Constructor<T> = new (...args: any[]) => T; | |
type ModelType<T extends Model<T>> = Constructor<T> & typeof Model; | |
export interface IRepository<T extends Model> { | |
get(id: string): Promise<T| null>; | |
find(where: FindOptions<T>): Promise<T>; | |
create(model: T): Promise<T>; | |
update(key: any, model: T): Promise<T>; | |
} |
const echoPostRequest = { | |
url: 'https://<my url>.auth0.com/oauth/token', | |
method: 'POST', | |
header: 'Content-Type:application/json', | |
body: { | |
mode: 'application/json', | |
raw: JSON.stringify( | |
{ | |
client_id:'<your client ID>', | |
client_secret:'<your client secret>', |
#!/usr/bin/env node | |
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/ | |
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID | |
// CONFIGURATION ####################################################################################################### | |
const token = 'SLACK TOKEN'; | |
// Legacy tokens are no more supported. | |
// Please create an app or use an existing Slack App |
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda | |
# and can be used for developing/testing Python 3.6 Lambda functions | |
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python | |
# This is required because Amazon Linux does not come with Python 3.6 pre-installed | |
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime | |
# The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm) | |
# running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3 | |
# and was developed with the help of AWS Support |
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
# Load dynamic modules. See /usr/share/nginx/README.dynamic. |
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
/** | |
* (1)Get tweets by search keyword and (2)Stemming(Korean), (3)save to mysql finally | |
*/ | |
var Promise = require('bluebird'); | |
var TwitterKoreanText = require('twtkrjs'); | |
var twitterKoreanText = new TwitterKoreanText({ | |
stemmer: true, // (optional default: true) | |
normalizer: true, // (optional default: true) |
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous | |
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous | |
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous | |
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous | |
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous | |
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous | |
(android.permission-group.SMS) android.permission.SEND_SMS dangerous | |
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous | |
(android.permission-group.SMS) android.permission.READ_SMS dangerous | |
(android.permission-group.SMS) android.permission.RECEIVE_WAP_PUSH dangerous |
private static final DEBUG = false; | |
private static final SecureRandom SR; | |
static { | |
SR = new SecureRandom(); | |
SR.setSeed(System.currentTimeMillis()); | |
} | |
private byte[] getRequestNonce() { | |
byte[] output = new byte[16]; |