Skip to content

Instantly share code, notes, and snippets.

View ebertech's full-sized avatar

Andrew Eberbach ebertech

View GitHub Profile
@jferris
jferris / configmap.yaml
Last active June 2, 2024 13:21
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
@blackjid
blackjid / Readme.md
Last active February 23, 2022 01:34
Rails abort if pending migrations with data

Abort if pending migrations with data

We use the awesome gem data-migrate with comes with a handy rake task to check if you have migrations pending. The task is really and extention to the task built in on rails but that also check for pending data migrations.

That rake task is available since version 6.3.0 of data-migrate. If you are stuck in an older version like I was here is a version of the rake task you can put in your project.

rake db:abort_if_pending_migrations:with_data
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active June 14, 2024 02:40
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@giampaolotrapasso
giampaolotrapasso / Designing Event-Driven Systems links.md
Created August 1, 2018 09:56
List of links from Designing Event-Driven Systems by Ben Stopford
@mberlanda
mberlanda / gemfile_parser.rb
Created October 5, 2017 16:06
Run it as `$ ruby gemfile_parser.rb > Gemfile ` to generate a new Gemfile from a Gemfile.lock
require 'bundler'
lockfile = Bundler::LockfileParser.new(Bundler.read_file('Gemfile.lock'))
specs = lockfile.specs
gems_hash = Hash.new.tap do |h|
specs.each do |s|
h[s.name] = {
spec: s,
dependencies: s.dependencies.map(&:name)
@Luzifer
Luzifer / README.md
Last active May 29, 2024 08:02
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@mgoellnitz
mgoellnitz / clean-old-gitlab-pipelines.sh
Last active November 11, 2022 16:30
Clean old GitLab CI build job's results
#!/bin/bash
#
# Copyright 2017-2021 Martin Goellnitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@xbb
xbb / README
Last active May 14, 2024 14:33
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@alChaCC
alChaCC / brew-java-and-jenv.md
Last active July 23, 2020 09:17 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@beepony
beepony / ruby-ftp-get-all-files.rb
Last active January 24, 2023 17:09
ruby ftp list all files
require 'net/ftp'
def scan(ftp, dir)
ftp.chdir(dir)
puts ftp.pwd + "/."
entries = ftp.list('*')
entries.each do |entry|
if entry.split(/\s+/)[0][0,1] == "d" then
scan(ftp, entry.split.last)
else