- display (list) all open TCP+UDP ports and grep for listening ones
sudo lsof -i -P | grep LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME launchd 1 root 11u IPv6 0x26dd73cb700390df 0t0 TCP *:22 (LISTEN) ....
This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.
- Download PuTTY & PuTTYgen
- Download WinSCP
- Have your application on a GitHub repo.
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 React from 'react'; | |
import ReactMarkdown from 'react-markdown'; | |
import { withStyles } from '@material-ui/core/styles'; | |
import Typography from '@material-ui/core/Typography'; | |
import Link from '@material-ui/core/Link'; | |
import Table from "@material-ui/core/Table"; | |
import TableContainer from "@material-ui/core/TableContainer"; | |
import Paper from "@material-ui/core/Paper"; | |
import {TableHead, TableRow, TableCell, TableBody} from "@material-ui/core"; |
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
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
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
// NOTE: time string must look like this 07:05:45PM or this 07:05:45AM and account for 12:00:00AM and convert 12:00:00pm to 12:00:00 | |
function timeConversion(s) { | |
const ampm = s.slice(-2); | |
const hours = Number(s.slice(0, 2)); | |
let time = s.slice(0, -2); | |
if (ampm === 'AM') { | |
if (hours === 12) { // 12am edge-case | |
return time.replace(s.slice(0, 2), '00'); | |
} | |
return time; |
I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.
Here is what I had messed up, which you also probably did:
- I had too many different python interpreters
- Too many different symlinks which I lost track of
- almost no package I installed with pip worked without a headache
- any attempt to fix using online resources made it worse.
This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
NewerOlder