Skip to content

Instantly share code, notes, and snippets.

View eknowlton's full-sized avatar
🐧

Ethan Knowlton eknowlton

🐧
View GitHub Profile
@eknowlton
eknowlton / nextjs-deploy.md
Created April 30, 2023 16:15 — forked from jjsquady/nextjs-deploy.md
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@eknowlton
eknowlton / .hyper.js
Created December 6, 2021 14:47
Hyper Config
"use strict";
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "stable",
// default font size in pixels for all tabs
@eknowlton
eknowlton / create-laravel.sh
Created September 15, 2020 19:19
Create laravel project with docker, no native php
#!/bin/bash
docker run --rm --interactive --tty \
--volume $PWD:/app \
--volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp composer composer create-project --prefer-dist laravel/laravel app
set exrc
set encoding=UTF-8
colorscheme brogrammer
set number
set relativenumber
set cursorline
set undofile
### Keybase proof
I hereby claim:
* I am eknowlton on github.
* I am iamepk (https://keybase.io/iamepk) on keybase.
* I have a public key ASBLjKBt-DSxIGYIF9DxxOmdL5yenLraz8ps6-JlHzPtOgo
To claim this, I am signing this object:
@eknowlton
eknowlton / imap.rs
Last active August 24, 2019 18:27
ima.rs error
Compiling actionmailbox-imap v0.1.0 (/home/ethan/projects/actionmailbox-imap-client)
error[E0597]: `messages` does not live long enough
--> src/main.rs:153:33
|
153 | let message = match messages.iter().next() {
| ^^^^^^^^-------
| |
| borrowed value does not live long enough
| argument requires that `messages` is borrowed for `'static`
...
@eknowlton
eknowlton / imap.rs
Last active August 24, 2019 18:25
imap.rs
extern crate config;
extern crate ctrlc;
extern crate native_tls;
extern crate serde;
extern crate threadpool;
mod configuration;
mod imap_client;
use std::sync::mpsc::channel;
PS C:\Users\Ethan\Projects\actionmailbox-imap> cargo build
Compiling signal-hook v0.1.10
error[E0433]: failed to resolve: could not find `unix` in `os`
--> C:\Users\Ethan\.cargo\registry\src\github.com-1ecc6299db9ec823\signal-hook-0.1.10\src\iterator.rs:55:14
|
55 | use std::os::unix::io::AsRawFd;
| ^^^^ could not find `unix` in `os`
error[E0433]: failed to resolve: could not find `unix` in `os`
--> C:\Users\Ethan\.cargo\registry\src\github.com-1ecc6299db9ec823\signal-hook-0.1.10\src\iterator.rs:56:14
// get `IDLE` handle
match session.idle() {
Err(error) => {
println!("Failed to send command: IDLE");
println!("IMAP server may not support IDLE command.");
println!("Error: {}", error);
std::process::exit(126);
}
Ok(idle) => {
println!("Waiting for Ctrl-C...");
@eknowlton
eknowlton / main.rs
Created June 10, 2019 14:52
Fun Log Parser
extern crate chrono;
extern crate regex;
use chrono::{NaiveDate, NaiveDateTime};
use regex::Regex;
use std::io::{self, BufRead};
struct Item {
date: NaiveDate,