Skip to content

Instantly share code, notes, and snippets.

View NealBozeman's full-sized avatar
🏠
Working from home

Neal Bozeman NealBozeman

🏠
Working from home
View GitHub Profile
@wvanbergen
wvanbergen / convert_innodb_to_per_table_idb.rb
Created August 22, 2010 11:52
Convert InnoDB tables to use a separate idb files instead of the shared, giant ibdata1.
#!/usr/bin/env ruby
# Converts an InnoDB database that uses a shared InnoDB tablespace file (e.g. ibdata1) to use
# a separate file per table.
#
# - First change your my.cnf file to use separate files by adding "innodb_file_per_table" to
# the [mysqld] section. (This is safe: MySQL will revert to the giant file if it cannot find
# the per table file.)
# - Restart the MySQL server
# - cd to the directory of your database (cd /opt/mysql/data/mydb)
@dschneider
dschneider / convert_utf8_to_utf8mb4
Created May 7, 2014 14:44
How to easily convert utf8 tables to utf8mb4 in MySQL 5.5
# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.)
@RLovelett
RLovelett / delete.sh
Created July 2, 2014 20:07
Delete ZFS snapshots from dataset one-liner
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy
@stungeye
stungeye / instructions.md
Last active April 8, 2022 19:27
SSL Using Let's Encrypt for Rails/Passenger/Nginx

After installing certbot:

sudo service nginx stop
sudo ./certbot-auto certonly --standalone -d sub.example.com --standalone-supported-challenges http-01
sudo service nginx start

Modified the ngnix site conf:

server {

listen 80;