Skip to content

Instantly share code, notes, and snippets.

View neonexus's full-sized avatar

NeoNexus DeMortis neonexus

  • USA
  • 16:48 (UTC -06:00)
View GitHub Profile
@neonexus
neonexus / Git Shortcuts.md
Last active November 13, 2018 04:46
Git shortcuts

Git Shortcuts

What do they do?

The following blob is a set of basic setup configuration for Git, along with some shortcuts that I personally use.

Here we assume that you are working on your own, local branch (basically, not the master).

The shortcuts and what they do

@neonexus
neonexus / OpenSSL Commands.md
Last active May 17, 2016 14:24
AWS ELB OpenSSL commands list

Generate KEY and CSR:

openssl req -new -newkey rsa:2048 -nodes -keyout DOMAIN.key -out DOMAIN.csr

Echo the KEY in PEM format:

openssl rsa -in DOMAIN.key -outform PEM

Echo the CRT in PEM format:

@neonexus
neonexus / run_in_tmux.sh
Last active June 2, 2023 03:32
Start / stop / restart scripts in TMUX
#!/bin/bash
#if [[ $EUID -ne 0 ]]; then
# echo "Script MUST be run as a root user"
# exit 1
#fi
session="bg-apps"
logs_dir=~/tmux-logs
@neonexus
neonexus / state-pulldown.html.twig
Created August 7, 2014 20:41
Twig include file for state pulldown
{% set states = {
AL: 'Alaska',
AZ: 'Arizona',
AR: 'Arkansas',
CA: 'California',
CO: 'Colorado',
CT: 'Connecticut',
DE: 'Delaware',
DC: 'District of Columbia',
FL: 'Florida',
@neonexus
neonexus / 1ubuntu-server.md
Last active May 12, 2019 21:14
PHP, Nginx (configured for WP too), MySQL (connector and/or server)

Neo's AWS Guide for Nginx, PHP, MySQL

Foreword

This guide assumes you've created an EC2 instance on AWS, with 2 drives (1 for the OS, 1 where the actual site(s) live). The 2 drive system allows for easier replacement of the OS/software side if something breaks, while keeping site data intact.

Install PHP5-FPM, Nginx, MySQL, Git

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.6-fpm php5.6-mysql php5.6-gd php5.6-mcrypt nginx git ntp
@neonexus
neonexus / pem login.md
Last active August 29, 2015 14:13
Generate PEM login

cd ~/.ssh

Generate files: ssh-keygen -t rsa -b 2048 -v

Fix file names:

mv id_rsa id_rsa.pem
mv id_rsa.pub authorized_keys

cat hostname.key hostname.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > subsonic.crt

openssl pkcs12 -in subsonic.crt -export -out subsonic.pkcs12

sudo keytool -importkeystore -srckeystore subsonic.pkcs12 -destkeystore subsonic.keystore -srcstoretype PKCS12 -srcstorepass subsonic -srcalias 1 -destalias subsonic

sudo zip /var/subsonic/subsonic-booter-jar-with-dependencies.jar subsonic.keystore

@neonexus
neonexus / .bash_profile
Last active July 20, 2020 03:12
Git tools for the command line
source ~/.git-completion.sh
source ~/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\[\033[00;00m\] \w\[\033[00;32m\]$(__git_ps1)\[\033[00m\] ⚡ '
# A quick way to find the answer: `google "cat videos"` (Mac OSX / macOS)
function google() { open /Applications/Google\ Chrome.app/ "http://www.google.com/search?q=$1"; }
@neonexus
neonexus / fromUTF8Array.js
Last active September 25, 2019 20:06
Encode / decode UTF8 array in JavaScript (original: https://gist.github.com/joni/3760795)
function fromUTF8Array(data) { // array of bytes
let str = '',
i;
for (i = 0; i < data.length; i++) {
let value = data[i];
if (value < 0x80) {
str += String.fromCharCode(value);
} else if (value > 0xBF && value < 0xE0) {
@neonexus
neonexus / Sails Request Logging.md
Last active December 23, 2022 03:05
Sails config files to capture request logs. Replace "_" in filenames with "/". See https://github.com/neonexus/sails-react-bootstrap-webpack for a working example.

Sails Request Logging

This is a set of files to configure Sails.js v1, to log all requests / responses in the database.

Replace underscores "_" in filenames with forward slashses "/".