Skip to content

Instantly share code, notes, and snippets.

@niftylettuce
niftylettuce / .gitattributes
Created May 20, 2020 — forked from Yousha/.gitattributes
.gitattributes for Android(Java/C++) developers.
View .gitattributes
* text=auto
###### Git
.gitattributes text
.gitignore text
.gitconfig text
.gitmodules text
##### Windows
*.bat text eol=crlf
@niftylettuce
niftylettuce / README.md
Last active Sep 16, 2019
macOS - dnsmasq + dnscrypt-proxy + Cloudflare
View README.md

macOS - dnsmasq + dnscrypt-proxy + Cloudflare

  1. Install dnscrypt-proxy and dnsmasq:

    brew install dnscrypt-proxy
    brew install dnsmasq
  2. Replace contents of /usr/local/etc/dnscrypt-proxy.toml (see below file dnscrypt-proxy.toml)

@niftylettuce
niftylettuce / forwarder.js
Created May 5, 2019 — forked from andris9/forwarder.js
Process emails without data loss
View forwarder.js
'use strict';
// $ npm install nodemailer mailsplit libmime
// $ node forwarder.js
const nodemailer = require('nodemailer');
const mailsplit = require('mailsplit');
const libmime = require('libmime');
const Transform = require('stream').Transform;
@niftylettuce
niftylettuce / README.md
Created Jan 24, 2019
scraper for ImTheSushi
View README.md
npm install got cheerio

or

yarn add got cheerio
@niftylettuce
niftylettuce / file.js
Created Sep 25, 2018
I wrote a quick Node.js script to automate the conversion of password store naming conventions from `pass` (https://passwordstore.org) into a more organized format. This is especially useful when importing 🎉
View file.js
const fs = require('fs');
const { promisify } = require('util');
const childProcess = require('child_process');
const { URL } = require('url');
const exec = promisify(childProcess.exec, childProcess);
(async () => {
const ls = await exec(`ls -al ~/.password-store | grep '^-' | awk '{print $9}'`);
const lines = ls.stdout.trim().split('\n').filter(line => line.endsWith('.gpg')).map(line => line.replace('.gpg', ''));
@niftylettuce
niftylettuce / UPDATE.md
Last active Nov 15, 2018
Go to <https://github.com/BurntSushi/ripgrep> and search for "Debian", then follow script
View UPDATE.md
@niftylettuce
niftylettuce / how-to-enable-wifi-macbook-mac-mini-air-ubuntu-linux-debian-mint-mate-os.md
Last active Nov 16, 2020
How to Enable Wi-Fi on MacBook, Mac Mini, MacBook Air for Ubuntu/Linux/Debian/Mint/Mate OS ---- If you liked this, check out my email forwarding service at https://forwardemail.net 🎉 🎉 🎉
View how-to-enable-wifi-macbook-mac-mini-air-ubuntu-linux-debian-mint-mate-os.md

How to Enable Wi-Fi on MacBook, Mac Mini, MacBook Air for Ubuntu/Linux OS

By default older Mac computer models have driver issues with the Broadcom Wi-Fi chip. Most instructions online (such as this one from the official Ubuntu docs @ https://help.ubuntu.com/community/Macmini5-1/Precise) suggest to use sudo apt-get and install these packages from the PPA.

BUT you don't have Internet so you can't use apt-get! Instead you can use a different computer to download the packages, then transfer them over.

In the instructions below, you will need to replace sid in the download URL's with the proper version of Debian your version of Ubuntu/Linux is using. To find which version you should use, you can view the chart at https://askubuntu.com/questions/445487/what-debian-version-are-the-different-ubuntu-versions-based-on#445496. If you're using jessie for example, then replace all sid with jessie in the links below.

  1. Download b43-fwcutter @ https://packages.debian.org/sid/b43-fwcutter (*
@niftylettuce
niftylettuce / note.md
Created Sep 27, 2017
High CPU Usage on macOS from videosubscriptionsd Process
View note.md

I ran log and grepped for "videosubscriptionsd" process. I found that it seemed near every log output for it there was Dropbox referenced either above or below. After stopping Dropbox, the problem went away.

Dropbox: (LaunchServices) [http://com.apple .launchservices.default] Local database thinks system build version is <private>, but the OS really is <private>.

Right above that I got this line:

videosubscriptionsd: Received distnoted matching event
View .bashrc.patch
1,4c1,4
< case $- in
< *i*) ;;
< *) return;;
< esac
---
> # case $- in
> # *i*) ;;
> # *) return;;
> # esac
View ecosystem.json
{
"apps": [
{
"name": "app",
"script": "app.js",
"exec_mode": "cluster",
"instances": "max",
"env_production": {
"NODE_ENV": "production"
}
You can’t perform that action at this time.