Skip to content

Instantly share code, notes, and snippets.

View alebruck's full-sized avatar

Alessandro Diogo Brückheimer alebruck

  • Valutico
  • Austria
View GitHub Profile
@cl4rk3
cl4rk3 / stackscript.sh
Created March 25, 2011 00:44
Linode Stackscript for Ubuntu 10.10 w/java/groovy/grails
#!/bin/bash
echo deb http://archive.canonical.com/ubuntu maverick partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick partner >> /etc/apt/sources.list
echo >> /etc/apt/sources.list
echo deb http://archive.canonical.com/ubuntu maverick-updates partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick-updates partner >> /etc/apt/sources.list
echo >> /etc/apt/sources.list
echo deb http://archive.canonical.com/ubuntu maverick-security partner >> /etc/apt/sources.list
echo deb-src http://archive.canonical.com/ubuntu maverick-security partner >> /etc/apt/sources.list
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@arjunvenkat
arjunvenkat / gist:1115bc41bf395a162084
Last active January 12, 2024 05:04
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

@Shourai
Shourai / Allowing SSH on a server with an active OpenVPN client.md
Last active July 11, 2024 20:22
Allowing SSH on a server with an active OpenVPN client

If you want to SSH to a VPS which is running openVPN do the following:
source: https://serverfault.com/questions/659955/allowing-ssh-on-a-server-with-an-active-openvpn-client

Enable

The problem is that the default gateway gets changed by OpenVPN, and that breaks your current SSH connection unless you set up appropriate routes before you start OpenVPN.

What follows works for me. It uses iptables and ip (iproute2). Below, it is assumed that the default gateway interface before OpenVPN is started is "eth0". The idea is to ensure that when a connection to eth0 is made, even if eth0 is not the default gateway interface anymore, response packets for the connection go back on eth0 again.

You could use the same number for the connection mark, firewall mark and routing table. I used distinct numbers to make the diffences between them more apparent.

@NickMcSweeney
NickMcSweeney / postgresql_plus_arch-linux.md
Last active July 29, 2024 14:42
Getting postgresql running on Arch Linux

Setup Postgresql

run postgresql with systemctl

Install postgres

latest

sudo pacman -S postgresql

specific version

find version & build from source

@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@jesster2k10
jesster2k10 / README.md
Last active July 28, 2024 15:33
JWT Auth + Refresh Tokens in Rails

JWT Auth + Refresh Tokens in Rails

This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.

I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)

Before trying it out DIY, I considered using: