Skip to content

Instantly share code, notes, and snippets.

View vjt's full-sized avatar
💭
looking at the stars

Marcello Barnaba vjt

💭
looking at the stars
View GitHub Profile
@vjt
vjt / monitor.sh
Created February 23, 2012 17:19
Web server tmux monitoring session
#!/bin/sh
#
# Starts a multiplexed terminal session with tmux running monitoring software.
# Requires dstat, htop and grc. The apache configuration for grc can be found
# here: https://gist.github.com/1885569
#
# My .tmux.conf is here instead: https://gist.github.com/1886016#file_3_tmux.conf
#
# tmux 1.7 or later recommended.
#
@vjt
vjt / resync-gems.rb
Created March 23, 2012 15:51
Rome RSC 2012-03: Develop application and dependent gems, tricking bundler
#!/usr/bin/env ruby
if ARGV[0] == ARGV[1] && $0 =~ /git.*hook/ # Not switching branches
exit 0
end
require 'rubygems'
require 'bundler'
require 'pathname'
@vjt
vjt / pryrc.rb
Created March 26, 2012 09:15
My Pry configuration file
# vim: ft=ruby
# -*- pryrc -*-
#
# Learn more about pry: https://github.com/pry/pry
#
# Allows you to just run "pry" inside a Rails app directory and get
# everything loaded as rails c does. Inside a Bundler directory does
# what bundle console does.
#
# Loads also Hirb and ruby-debug, if present, and a ~/.rubyrc with
@vjt
vjt / passwdgen.js
Created March 29, 2012 16:52
Javascript Random Password Generator (jQuery)
// Demo: http://jsbin.com/emisib/5/edit#preview
//
// Markup:
//
// <input type="text" name="password" id="password" />
// <a href="#" class="passworder" data-length="10" data-target="#password">Generate</a>
//
// - [email protected] - public domain
//
(function () {
@vjt
vjt / README.md
Last active November 25, 2020 18:45
[POC] Temporal database system on PostgreSQL with Active Record in mind

This has become a Ruby gem: https://github.com/ifad/chronomodel

A temporal database system on PostgreSQL using table inheritance and the rule system.

This is a data structure for a Slowly-Changing Dimension Type 2 temporal database, implemented using only PostgreSQL >= 9.0 features.

Any application code is completely unaware of the temporal features: queries are done against a view that behaves exactly like a plain table (it can be SELECTed, UPDATEd, INSERTed INTO and DELETEd FROM), but behind the scenes the database redirects the queries to backend tables holding actual data, using the PostgreSQL rule system.

@vjt
vjt / .sqshrc
Created May 3, 2012 09:54
My SQSH rc
\set histsave=true
\set interfaces=/opt/sybase/interfaces
\set statistics=true
\set style=pretty
\set semicolon_hack=true
\set keyword_completion=4
\set banner=false
# Your preferred syb server
#\set DSQUERY=debian
#!/bin/bash
# Creates a chroot environment for the binaries
# passed on the command line, including the NSS
# subsystem, the RTLD and any dynamic libraries
# required by the binaries. Optionally, copies
# the given configuration files.
# Tested on Ubuntu 12.04 x86-64. Patches welcome.
@vjt
vjt / build-gnuradio.sh
Created September 1, 2012 06:38
GnuRadio build script w/ UHD, rtl-sdr, and gr-extras.
#!/bin/bash
#
# Taken from http://www.sbrac.org/files/build-gnuradio
#
# Build script for UHD+GnuRadio on Fedora and Ubuntu
#
# Updates: https://github.com/guruofquality/grextras/wiki
# Updates: https://github.com/balint256/gr-baz.git
#
#
@vjt
vjt / list-my-open-sockets.sh
Created November 20, 2012 18:19
Lists all open IPv4 sockets allocated by the current user's running processes whose command line matches the regex passed as the first parameter.
#!/bin/sh
#
# Lists all open IPv4 sockets allocated by the current user's
# running processes whose command line matches the regex passed
# as the first parameter. Uses "unicorn.*worker" by default -
# because we all love unicorns! :-)
#
# - [email protected] Tue Nov 20 19:06:08 CET 2012
#
@vjt
vjt / libreoffice.sh
Created December 3, 2012 12:34
Libreoffice LSB init script
#!/bin/sh
#
# Startup Script for the LibreOffice server. Save it into /etc/init.d/libreoffice
# and install it using `insserv /etc/init.d/libreoffice`.
#
# Copyright (C) 2012 Marcello Barnaba <[email protected]>
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO