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, in your terminal. | |
# | |
# $ python3 -m virtualenv env | |
# $ source env/bin/activate | |
# $ pip install torch torchvision transformers sentencepiece protobuf accelerate | |
# $ pip install git+https://github.com/huggingface/diffusers.git | |
# $ pip install optimum-quanto | |
# $ pip install gradio | |
import torch |
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
class Crystal < Formula | |
desc "Fast and statically typed, compiled language with Ruby-like syntax" | |
homepage "https://crystal-lang.org/" | |
stable do | |
url "https://github.com/crystal-lang/crystal/archive/0.27.0.tar.gz" | |
sha256 "43c8ac1b5c59ccea3cd58c9bd2a7af07a56f96cf1eff1e54d93f648b5340e83a" | |
resource "shards" do | |
url "https://github.com/crystal-lang/shards/archive/v0.8.1.tar.gz" |
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 'sidekiq/api' | |
# BulkReindexer | |
module BulkReindexer | |
def self.reindex_model(model, promote_and_clean = true) | |
puts "Reindexing #{model.name}..." | |
index = model.reindex(async: true, refresh_interval: '30s') | |
puts "All jobs are in queue. Index name: #{index[:index_name]}" | |
loop do | |
# Check the size of queue |
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
development: | |
clients: | |
default: | |
database: floorplanner | |
options: | |
connect: :direct | |
hosts: | |
- localhost:27017 |
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/bash | |
output=`mongo --quiet --eval 'db.isMaster().ismaster'` | |
if [[ "$output" == 'true' ]] | |
then | |
http_type="HTTP/1.0 200 OK" | |
mongo="master" | |
else | |
http_type="HTTP/1.0 503 Service Unavailable" | |
mongo="slave" |
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
listen mongodb *:27017 | |
balance source | |
mode tcp | |
option tcpka | |
option httpchk | |
server db01 127.0.0.1:27017 check port 27020 inter 5s | |
server db02 127.0.0.2:27017 check port 27020 inter 5s | |
server db03 127.0.0.3:27017 check port 27020 inter 5s |
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
class RemoveColumns < ActiveRecord::Migration[5.1] | |
def change | |
working = false | |
columns = Answer.columns.map &:name | |
rm_cols = columns - %w[cols to keep] | |
rm_target = '' | |
until working || rm_cols.empty? | |
working = true | |
begin | |
puts "attempting to run query with #{rm_cols.first} column present" |
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
SELECT * FROM information_schema.COLUMNS | |
WHERE TABLE_SCHEMA = 'table_name' | |
AND TABLE_NAME = COLUMN_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
Section "Monitor" | |
Identifier "Monitor0" | |
VendorName "Unknown" | |
ModelName "Unknown" | |
HorizSync 28.0 - 33.0 | |
VertRefresh 43.0 - 72.0 | |
Option "DPMS" | |
Modeline "3184x2160" 590.04 3184 3440 3792 4400 2160 2161 2164 2235 -HSync +Vsync | |
EndSection |
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
# Image processing daemons | |
# By VvanGemert | |
# | |
# Requirements: | |
# apt-get install imagemagick | |
# ruby 1.9.3 or higher | |
# gem install daemons | |
# gem install aws-s3 | |
# | |
# Usage: |
NewerOlder