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 / 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
#
#
#!/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 / .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
@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 / 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>
//
// - vjt@openssl.it - public domain
//
(function () {
@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 / 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 / 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 / 1-session.sh
Last active June 5, 2018 12:31
vjt's tmux RVM + ViM IDE setup
#!/bin/sh
#
# IDE Session starter - you should save this script as ~/bin/session, make it
# executable with chmod +x ~/bin/session, and then make a symlink to it for
# every application you want to start.
# E.g. ln -s session ~/bin/members creates a "members" symlink, and when you'll issue
# "members" on the command line this script will:
# Check if a tmux session named "members" exists
@vjt
vjt / conf.apache
Created February 22, 2012 15:32
GRC (Generic Colouriser/Colorizer) configuration for Apache / nginx access logs
# Configuration suitable to display Apache/nginx access logs
# Based on conf.proftpd by Pavol Domin
# Crafted by Marcello Barnaba <vjt@openssl.it>
# Get GRC at http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
#
# ip number
regexp=^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
colours=bold magenta