npm login
npm whoami
npm set init.author.email [email protected]
npm set init.author.name phongvu
npm init
npm config ls
npm version patch
npm publish
This file contains hidden or 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
| # The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/ | |
| # | |
| # It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here. | |
| yum upgrade | |
| reboot | |
| dnf install epel-release | |
| dnf install rpmconf | |
| dnf install yum-utils | |
| rpmconf -a # answer "n" to both things |
This file contains hidden or 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
| <?php | |
| namespace PHP81_BC; | |
| /** | |
| * Locale-formatted strftime using \IntlDateFormatter (PHP 8.1 compatible) | |
| * This provides a cross-platform alternative to strftime() for when it will be removed from PHP. | |
| * Note that output can be slightly different between libc sprintf and this function as it is using ICU. | |
| * | |
| * Usage: | |
| * use function \PHP81_BC\strftime; |
This file contains hidden or 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
| function isURL(str) { | |
| var urlRegex = '^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$'; | |
| var url = new RegExp(urlRegex, 'i'); | |
| return str.length < 2083 && url.test(str); | |
| } |
There are two main modes to run the Let's Encrypt client (called Certbot):
- Standalone: replaces the webserver to respond to ACME challenges
- Webroot: needs your webserver to serve challenges from a known folder.
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com.
HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.
This file contains hidden or 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
| function interval(duration, fn){ | |
| this.baseline = undefined | |
| this.run = function(){ | |
| if(this.baseline === undefined){ | |
| this.baseline = new Date().getTime() | |
| } | |
| fn() | |
| var end = new Date().getTime() | |
| this.baseline += duration |
This file contains hidden or 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
| function isURL(str) { | |
| var urlRegex = '^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$'; | |
| var url = new RegExp(urlRegex, 'i'); | |
| return str.length < 2083 && url.test(str); | |
| } |
This file contains hidden or 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
| function interval(duration, fn){ | |
| var _this = this | |
| this.baseline = undefined | |
| this.run = function(){ | |
| if(_this.baseline === undefined){ | |
| _this.baseline = new Date().getTime() | |
| } | |
| fn() | |
| var end = new Date().getTime() |