Skip to content

Instantly share code, notes, and snippets.

View interglobalmedia's full-sized avatar
🎯
Looking for work

Maria Campbell interglobalmedia

🎯
Looking for work
View GitHub Profile
@rollwagen
rollwagen / lsof_netstat_on_macos.md
Last active August 28, 2024 15:45
lsof / netstat on macos

lsof / netstat on macos

lsof - list open files

  • 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)
      ....
@carlssonk
carlssonk / deploy_node_do.md
Last active October 25, 2024 21:38
Deploy node.js app to DigitalOcean

Deploy Node.js Application to DigitalOcean

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.

Prerequisites

Create Droplet & Generate SSH Key

@karlhillx
karlhillx / macos_big_sur_homebrew_apache_php_mariadb_2020.md
Last active October 20, 2024 02:33
macOS Big Sur 11.0 Setup: Homebrew + Apache + PHP + MariaDB (Regularly updated)

macOS Big Sur 11.0 Setup: Homebrew + Apache + PHP + MariaDB

This document helps get your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, and MariaDB.

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";
@mlent
mlent / social-sharing-buttons.html
Last active February 24, 2023 08:22
Social sharing buttons
<ul>
<li>
<a href="https://twitter.com/share?text=TITLE OF YOUR POST via @YOUR_USERNAME&url=HTTPS://YOUR_WEBSITE.COM" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235'); return false;">
Share on Twitter
</a>
</li>
<li>
<a href="https://news.ycombinator.com/submitlink?u=HTTP://YOUR_URL.COM&t=YOUR CONTENT" onclick="window.open(this.href, 'hn-share', 'width=550,height=350'); return false;">
Share on Hacker News
</a>
@jagdeepsingh
jagdeepsingh / README.md
Last active September 19, 2024 10:41
Set up macOS Catalina 10.15 with development tools | Git | Homebrew | rbenv | bundler | Atom | Databases | Node.js | Yarn | kubectl | Elastic Stack
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active October 16, 2024 14:20
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/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
@apolopena
apolopena / JSConvert12to24Time.js
Last active July 5, 2024 08:05
JavaScript: convert 12 hours time string to 24 hour time string
// 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;
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active October 30, 2024 07:08
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

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.

What the hell?

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.