See the new site: https://postgresisenough.dev
This file contains hidden or 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
| """ To use: install Ollama, clone OpenVoice, run this script in the OpenVoice directory | |
| brew install portaudio | |
| brew install git-lfs | |
| git lfs install | |
| git clone https://github.com/myshell-ai/OpenVoice | |
| cd OpenVoice | |
| git clone https://huggingface.co/myshell-ai/OpenVoice | |
| cp -r OpenVoice/* . | |
This file contains hidden or 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
| import boto3 | |
| import os | |
| import time | |
| from subprocess import Popen, PIPE | |
| import pyarrow.parquet as pq | |
| import pickle | |
| import hashlib | |
| TSDB_CPUS = 8 |
This file contains hidden or 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
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; | |
| CREATE OR REPLACE FUNCTION uuid_timestamp(uuid UUID) RETURNS TIMESTAMPTZ AS $$ | |
| DECLARE | |
| bytes bytea; | |
| BEGIN | |
| bytes := uuid_send(uuid); | |
| if (get_byte(bytes, 6) >> 4)::int2 != 1 then | |
| RAISE EXCEPTION 'UUID version is not 1'; |
This file contains hidden or 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
| use_bpm 30 | |
| define :chorda do |root, type| | |
| case type | |
| when "major" | |
| [root, root+4, root+7] | |
| when "minor" | |
| [root, root+3, root+7] | |
| end | |
| end |
This file contains hidden or 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 set the numbers of hypertables you'd like to test | |
| \set hypertables_count 100 | |
| -- Hypertable configuration with the chunk time interval for every hypertable | |
| \set chunk_time_interval '''1 hour''' | |
| -- How much data you'd like to append for every append_data call | |
| \set append_interval '''1 day''' | |
| -- How many devices would you like to simulate in parallel | |
| \set number_of_devices '''1''' | |
| -- When the data starts | |
| \set start_date '''2000-01-01''' |
This file contains hidden or 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 ActionsHypertable < ActiveRecord::Migration[7.0] | |
| def change | |
| @table_name = 'actions' | |
| @time_column = 'created_at' | |
| reversible do |dir| | |
| dir.up do | |
| execute <<-SQL | |
| SELECT create_hypertable('#{@table_name}', '#{@time_column}', if_not_exists => TRUE, migrate_data => TRUE); | |
| SQL | |
| end |
This file contains hidden or 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
| DROP TABLE ticks CASCADE; | |
| DROP TABLE ohlc_1s CASCADE; | |
| CREATE TABLE ticks ( time TIMESTAMP NOT NULL, symbol varchar, price decimal, volume int); | |
| CREATE TABLE ohlc_1s ( time TIMESTAMP NOT NULL, symbol varchar, o decimal, h decimal, l decimal, c decimal, v int); | |
| SELECT create_hypertable('ticks', 'time'); | |
| SELECT create_hypertable('ohlc_1s', 'time'); | |
| CREATE OR REPLACE FUNCTION feed_ohlc_1s() RETURNS trigger AS | |
| $BODY$ | |
| DECLARE |
This file contains hidden or 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
| source 'https://rubygems.org' | |
| gem "activerecord", "~> 6.1" | |
| gem "composite_primary_keys", "~> 6.0" | |
| gem "pg", "~> 1.2" | |
| gem 'pry' |
This file contains hidden or 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
| # Connect to device using adb | |
| adb connect <@IP> | |
| # Start su shell (works out of the box - no need to root device) | |
| adb shell | |
| su | |
| # We need to remount the system file-system in order to modify the start-up script | |
| mount -o remount,rw /system |
NewerOlder