sudo yum -y upgrade
sudo yum install -y gcc*
sudo yum install -y tcl
sudo wget http://download.redis.io/releases/redis-stable.tar.gz
sudo tar xzf redis-stable.tar.gz
cd redis-stable
cd deps ; sudo make hiredis jemalloc linenoise lua ; cd ..
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
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config. | |
# Then add the classes your want to migrate in the klasses array below. | |
# Then run rake paperclip_migration:migrate_to_s3 | |
# Should work but this is untested and may need some tweaking - but it did the job for me. | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
klasses = [:model_1, :model_2] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration. | |
klasses.each do |klass_key| |
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
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemin | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# pidfile: /var/run/nginx.pid |
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 | |
# Put this file in the root of your Rails project, | |
# then run it to output the SQL needed to change all | |
# your tables and columns to the same character set | |
# and collation. | |
# | |
# > ruby character_set_and_collation.rb | |
DATABASE = '' |
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
require 'sinatra' | |
get "/" do | |
erb :form | |
end | |
post '/save_image' do | |
@filename = params[:file][:filename] | |
file = params[:file][:tempfile] |
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
require "onnxruntime" | |
require "mini_magick" | |
img = MiniMagick::Image.open("bears.jpg") | |
pixels = img.get_pixels | |
model = OnnxRuntime::Model.new("model.onnx") | |
result = model.predict({"inputs" => [pixels]}) | |
p result["num_detections"] |
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
ruby -e "require 'rubygems';require 'sinatra';set :port, 9999;set :public, Dir.pwd" |
basic CSS template for A4 print
BONUS: includes style for A2 and A5!
A Pen by rafaelcastrocouto on CodePen.
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
# Requires doctl and the "public-ip-cli" npm module to be globally installed. | |
#!/bin/sh | |
FWID="YOUR_FIREWALL_ID" | |
IPV4=$("${HOME}/.nodebrew/current/bin/public-ip" --4) | |
#IPV6=$("${HOME}/.nodebrew/current/bin/public-ip" --6) | |
printf "🔥 Updating DO firewall rules\n\n" | |
OLD_RULES="$(doctl compute firewall get "${FWID}" --format InboundRules | tr ' ' '\n' | grep -E 'ports:22|ports:2022' | tr '\n' ' ' | sed '$ s/.$//')" |
OlderNewer