(Remember to create a symlink pytest for py.test)
pytest [options] [file_or_dir] [file_or_dir] ...
Help:
#!/usr/bin/env bash | |
set -e | |
pg_version=${1:-'9.5'} | |
echo "Installing PostgreSQL version: $pg_version" | |
sudo apt-get update -q | |
sudo apt-get -y install postgresql-client-$pg_version postgresql-$pg_version postgresql-contrib-$pg_version postgresql-server-dev-$pg_version libpq-dev postgresql-$pg_version-postgis-2.2 |
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
Rails.application.configure do | |
# ... | |
require_relative '../../spec/support/no_animations' | |
config.middleware.use Rack::NoAnimations | |
end |
# Display the current tcp_keepalive_time value. | |
$ cat /proc/sys/net/ipv4/tcp_keepalive_time | |
# Set tcp_keepalive_time to 60 seconds and make it permanent across reboots. | |
$ echo 'net.ipv4.tcp_keepalive_time = 60' | sudo tee -a /etc/sysctl.conf | |
# Apply the change. | |
$ sudo /sbin/sysctl --load=/etc/sysctl.conf | |
# Display the tcp_keepalive_time value to verify the change was applied. |
task non_digested: :environment do | |
assets = Dir.glob(File.join(Rails.root, 'public/assets/**/*')) | |
regex = /(-{1}[a-z0-9]{32}*\.{1}){1}/ | |
assets.each do |file| | |
next if File.directory?(file) || file !~ regex | |
source = file.split('/') | |
source.push(source.pop.gsub(regex, '.')) | |
non_digested = File.join(source) |
/** | |
* based on a work of | |
* https://webapps.stackexchange.com/questions/50511/pass-range-in-google-apps-script-custom-function-without-using-a1-notation | |
* | |
* Counts cell values in a range if they have the given background color | |
* =countByColor("A5", ROW(A5)) | |
* | |
* @param {String} cell reference to get color | |
* @param {int} startrow reference to the row to calculate count | |
* @return {int} Count of all cell values matching the condition |
#!/bin/sh | |
mkdir /home/bitnami/backups/ | |
export BACKUP_FILE=/home/bitnami/backups/db-backup.sql.gz | |
export DATABASE_SCHEMA_NAME=--all-databases | |
export AZURE_CONTAINER=YOUR_VALUE_HERE | |
export AZURE_NAME=YOUR_VALUE_HERE | |
export AZURE_KEY=YOUR_VALUE_HERE | |
export AZURE_BLOB_NAME=db-production-$(date +%Y%m%d%H%M%S).sql.gz |
#!/bin/bash | |
# Usage: slackpost <token> <channel> <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
slackhost=PUT_YOUR_HOST_HERE | |
token=$1 |
#!/bin/bash | |
# Usage: slackpost <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
webhook=PUT_YOUR_HOST_HERE | |
shift |