In case you have a requirement to automate the certificate installation without docker and you have installed certificate on
Ubuntu Machine 18.04 using.
sudo apt install software-properties-common
.
sudo apt update
.
sudo add-apt-repository ppa:certbot/certbot
.
sudo apt update
.
sudo apt-get install python-certbot-nginx
.
sudo apt install python3-pip
.
sudo pip3 install certbot-dns-route53
.
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
string selectedPrinter = ""; | |
selectedPrinter = BilzoLogs.ReadValueFromRegistry("PrinterName"); | |
m_prefPaperSize = BilzoLogs.ReadValueFromRegistry("PaperSize"); | |
m_centerAlign = BilzoLogs.ReadValueFromRegistry("CenterAlign"); | |
m_printType = BilzoLogs.ReadValueFromRegistry("PrintType"); | |
int selectedIndex = -1; | |
int paperSizeSelIdx = -1; | |
int index = 0; | |
foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters) |
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
[user] | |
name = <Your Name> | |
email = <your email id> | |
[init] | |
defaultBranch = main | |
[pull] | |
rebase = true | |
[fetch] | |
prune = true | |
[push] |
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
// Given a list of integers, determine if the product of all of the integers is even or odd. | |
// Return the sum of all of the integers if the product of all of the integers is even. | |
// Return 0 if the product of all of the integers is odd. | |
// Note that 0 is considered even. | |
// Examples: | |
// Input: [1,2,3,4] | |
// Output: 10 | |
// Explanation: 1 * 2 * 3 * 4 = 24. This is an even number. The sum of all of the integers is 10 | |
// Input: [5,7,9] |
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
// https://github.com/ai/nanoid/blob/030bf5dc47759a6199619b332937ba3e7a91db03/index.browser.js#L79 | |
function nanoid(size = 21) { | |
let id = ""; | |
const arr = new Uint8Array(size); | |
const bytes = crypto.getRandomValues(arr); | |
// A compact alternative for `for (var i = 0; i < step; i++)`. | |
while (size--) { | |
// It is incorrect to use bytes exceeding the alphabet size. | |
// The following mask reduces the random byte in the 0-255 value |
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
// Node version 10.x AWS Lambda Serverless framework | |
const Sentry = require('@sentry/node'); // sentry version "@sentry/node": "^5.5.0", | |
Sentry.init({ | |
dsn: 'https://randomstuff@sentry.io/1234567', | |
async beforeSend(event) { | |
console.log('\n Caught an exception \n'); | |
return event; | |
}, |
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
"dev" : "nodemon --watch src/* --exec yarn sls offline --stage local" | |
Run it using yarn dev | |
Thank me later. |
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
ssh -i ~/Desktop/your-key-name.pem ubuntu@ec2-xx-xxx-xxx-xxx.ap-south-1.compute.amazonaws.com | |
Post which you will get a popup saying WARNING: UNPROTECTED PRIVATE KEY FILE! | |
To fix this error chmod 700 ~/Desktop/your-key-name.pem | |
1. Use this guide to setup a different user - https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04 |
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
const NEWER = Symbol("newer"); | |
const OLDER = Symbol("older"); | |
class LRU { | |
constructor(limit = 10) { | |
this.limit; | |
this.size; | |
this.cache = new Map(); | |
this.newest = undefined; | |
this.oldest = undefined; |
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
const rp = require('request-promise'); | |
const urls = ['https://jsonplaceholder.typicode.com/todos/1', 'https://jsonplaceholder.typicode.com/todos/2']; | |
const newUrls = urls.map(url => () => rp(url)); | |
Promise.resolve() | |
.then(x => newUrls[0]()) | |
.then(x => newUrls[1]()); | |
console.log(newUrls); |
NewerOlder