I hereby claim:
- I am carlosespejo on github.
- I am awcarlos (https://keybase.io/awcarlos) on keybase.
- I have a public key ASC2JMFchy46ahF4d2Vnp6L4kTL2IplOUR0BaJTFzaM7fAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| require 'fileutils' | |
| class Encoder | |
| attr_reader :processed, :search_path, :queue | |
| def initialize | |
| @search_path = '/mnt/data/media' | |
| @processed = File.readlines('encode.log') if File.exists?('encode.log') | |
| @processed = Array(processed).map(&:chomp) | |
| @queue = Dir.glob("#{search_path}/**/*.avi").sort |
| # Borrowed from this talk | |
| # https://www.youtube.com/watch?v=dBeXS5aFLNc | |
| # http://jberkus.github.io/performance_in_15_min/index.html?utm_source=postgresweekly&utm_medium=email#37 | |
| # Thank you Josh!! | |
| # Memory Settings | |
| shared_buffers = 2GB # RAM/4 up to 8GB | |
| work_mem = 32MB # limit: RAM/(max_connections/2) | |
| # 8MB to 32MB: web |
| #!/bin/bash | |
| # This script will create a compressed data dump | |
| # that can be restored in parallel using | |
| # pg_restore -C -j[num of cores] -d postgres 2015-09-30-app_db.dump | |
| # note: when -C is present the db in -d is used only to make the connection. | |
| # http://www.postgresql.org/docs/current/static/app-pgrestore.html | |
| # http://www.postgresql.org/docs/current/static/app-pgdump.html | |
| DATABASE_NAME=app_db |
| Ubuntu 15.04 | |
| sudo apt-get install numactl | |
| # Open systemd file | |
| # find /etc/systemd/ | grep -i mongo | |
| /etc/systemd/system/multi-user.target.wants/mongod.service | |
| [Unit] | |
| Description=An object/document-oriented database |
| # Look into | |
| # Explicitly define PATH at the top of your crontab file: | |
| PATH=/Users/deployer/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin | |
| Or | |
| export PATH=~/.rbenv/shims:~/.rbenv/bin:"$PATH" | |
| sudo cat /proc/[pid]/environ | tr '\0' '\n' |
| disable_ddl_transaction! | |
| def up | |
| add_column :users, :processed, :boolean | |
| change_column :users, :processed, :boolean, default: false | |
| execute 'update users set processed = false where processed is null' | |
| add_index :users, :processed, where: 'processed = false', algorithm: :concurrently | |
| end |
https://help.ubuntu.com/community/Fstab
sudo lsblk # list block devices
sudo blkid # Get block device UUID
sudo mount -a # will try to mount everything and throw errors if fstab is screwed up.