This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative '../config/environment' | |
class TableStats | |
include ActionView::Helpers::NumberHelper | |
OUTPUT_HEADER = sprintf "%-32s %10s %10s %10s %10s\n", "Table name", "Tuples", "Size", "#Seq. Scans", "#Index Scans" | |
def initialize( attrs = {} ) | |
@attributes = attrs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
VAULT_USER=sr | |
SSH_SOCKET=$HOME/.ssh/control/vault | |
REMOTE_HOST=app1.staging.givve.io | |
VAULT_HOST=vault.givve.io | |
export VAULT_ADDR="https://$VAULT_HOST:8200" | |
export VAULT_CACERT="/home/sr/src/givve/givve/config/certs/vault_cacert.pem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2019-09-19 13:00:51 - [sway/main.c:152] Linux plinth 5.1.16 #1 SMP PREEMPT Fri Jul 5 21:04:54 CEST 2019 x86_64 GNU/Linux | |
2019-09-19 13:00:51 - [sway/main.c:168] Contents of /etc/lsb-release: | |
2019-09-19 13:00:51 - [sway/main.c:152] LSB_VERSION=1.4 | |
2019-09-19 13:00:51 - [sway/main.c:152] DISTRIB_ID=Arch | |
2019-09-19 13:00:51 - [sway/main.c:152] DISTRIB_RELEASE=rolling | |
2019-09-19 13:00:51 - [sway/main.c:152] DISTRIB_DESCRIPTION="Arch Linux" | |
2019-09-19 13:00:51 - [sway/main.c:168] Contents of /etc/os-release: | |
2019-09-19 13:00:51 - [sway/main.c:152] NAME="Arch Linux" | |
2019-09-19 13:00:51 - [sway/main.c:152] PRETTY_NAME="Arch Linux" | |
2019-09-19 13:00:51 - [sway/main.c:152] ID=arch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Memoize | |
def memoize(method_name) | |
ivar_name = :"@#{method_name}" | |
aliased_method_name = :"__unmemoized_#{method_name}" | |
alias_method aliased_method_name, method_name | |
define_method method_name do | |
return instance_variable_get(ivar_name) if instance_variable_defined?(ivar_name) | |
instance_variable_set(ivar_name, send(aliased_method_name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
NEW_NS_SERVER="ns-561.awsdns-06.net" | |
OLD_NS_SERVER="ns.udag.net" | |
def clean_up_answer(ns_answer) | |
answer_section = nil | |
ns_answer.match(%r{^;; ANSWER SECTION:\s*(.*?\n)\n}m) do |match| | |
answer_section = match[1] | |
end |
OlderNewer