Skip to content

Instantly share code, notes, and snippets.

View nrempel's full-sized avatar
🦀

Nick Rempel nrempel

🦀
View GitHub Profile
@nrempel
nrempel / jitsuerror
Created January 29, 2013 06:17
jitsu failed to install helloworld
info: Welcome to Nodejitsu nbrempel
info: jitsu v0.11.6, node v0.8.18
info: It worked if it ends with Nodejitsu ok
info: Executing command install helloworld
info: Installing helloworld locally
warn: Downloading packages from npm, this may take a moment...
error: Error running command install helloworld
error: EACCES, open '/home/nbrempel/.npm/d01b9e40-nodeapps-helloworld.lock'
error: Error: EACCES, open '/home/nbrempel/.npm/d01b9e40-nodeapps-helloworld.lock'
help: For help with this error contact Nodejitsu Support:
@nrempel
nrempel / api.js
Created October 14, 2013 06:49 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@nrempel
nrempel / replace-debian-with-arch.txt
Created January 28, 2016 16:54 — forked from m-ou-se/replace-debian-with-arch.txt
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget http://ftp.nluug.nl/os/Linux/distr/archlinux/iso/2016.01.01/archlinux-bootstrap-2016.01.01-x86_64.tar.gz
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-2016.01.01-x86_64.tar.gz --strip-components=1
'use strict';
/*
|--------------------------------------------------------------------------
| HTTP Server Setup
|--------------------------------------------------------------------------
|
| Here we join different pieces and start the HTTP server. It will be
| a matter of seconds to start your shiny Adonis application.
|
'use strict';
/*
|--------------------------------------------------------------------------
| Application Providers
|--------------------------------------------------------------------------
|
| Here we configure the providers required to run adonis application. They
| are registered only once and can be used inside any file using `use`
| keyword.
@nrempel
nrempel / postgres_queries_and_commands.sql
Created August 31, 2016 04:10 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
const SimpleCron = require('simple-cron');
const cron = new SimpleCron();
const amqp = require('amqplib/callback_api');
cron.schedule('* * * * *', () => {
amqp.connect(process.env.RABBIT_URL, (err, conn) => {
conn.createChannel((err, ch) => {
const q = 'clock';
ch.assertQueue(q, { durable: false });
ch.sendToQueue(q, Buffer.from('hi.'));
version: '3'
services:
###############################
# Built from local Dockerfile #
###############################
web:
# Build the Dockerfile in this directory.
build: .
# Mount this directory as a volume at /app
volumes:
# Inherit from node base image
FROM node
# This is an alternative to mounting our source code as a volume.
# ADD . /app
# Install Yarn repository
RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list