Skip to content

Instantly share code, notes, and snippets.

View X0nic's full-sized avatar

Nathan Lee X0nic

View GitHub Profile
@X0nic
X0nic / commands.md
Created June 1, 2017 17:04
Helpful Habitat commands

Execute binary from package

# Exec inside studio
hab pkg exec myorigin/package <binary> <flags>
// I got tired of checking the webpage periodically.
var webPage = require('webpage');
var page = webPage.create();
page.onConsoleMessage = function(msg) {
console.log(msg);
}
page.open('http://www.memoryexpress.com/Products/MX64875', function(status) {
@X0nic
X0nic / application.rb
Last active October 12, 2018 04:33
How can I make the rails console prompt standout in production?
# config/application.rb
class Application < Rails::Application
console do
console_settings = File.join(Rails.root, "lib/console.rb")
if File.exists?(console_settings)
puts "Loading lib/console.rb ..."
ARGV.push "-r", root.join("lib/console.rb")
end
end
@X0nic
X0nic / postgresql_configuration_on_ubuntu_for_rails.md
Created November 4, 2018 01:33 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@X0nic
X0nic / kamal-production-server-setup.sh
Created February 11, 2025 00:37 — forked from rameerez/kamal-production-server-setup.sh
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---