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
tasks = File.readlines('./tasks.txt', chomp: true).sort.freeze | |
developers = File.readlines('./developers.txt', chomp: true).shuffle.freeze | |
tasks.each_with_index do |task, i| | |
puts "#{task} - @#{developers[i % developers.size]}" |
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
# /etc/my.cnf.d/mariadb-server.cnf | |
[mysqld] | |
innodb_buffer_pool_size = 4G # 50% RAM | |
innodb_log_file_size = 1G | |
innodb_flush_log_at_trx_commit = 0 | |
innodb_doublewrite = 0 | |
max_allowed_packet = 256M | |
# Load the dump, skipping uniqueness and foreign key checks | |
time mysql -u root -p -D my_database --init-command="SET SESSION FOREIGN_KEY_CHECKS=0; SET SESSION UNIQUE_CHECKS=0;" < dump.sql |
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
[Unit] | |
Description=The NGINX HTTP and reverse proxy server | |
After=syslog.target network.target remote-fs.target nss-lookup.target | |
[Service] | |
Type=forking | |
PIDFile=/run/nginx.pid | |
ExecStartPre=/opt/nginx/sbin/nginx -t | |
ExecStart=/opt/nginx/sbin/nginx | |
ExecReload=/bin/kill -s HUP $MAINPID |
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
# We must update both the Python and NPM packages | |
pip install --upgrade aws-cdk-lib | |
npm install -g aws-cdk@latest |
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
# Resolves the following error which occurs when Ruby does not like our GCC version: | |
# | |
# vm_core.h:1865:34: error: ‘ruby_current_ec’ undeclared (first use in this function) | |
# rb_execution_context_t *ec = ruby_current_ec; | |
# | |
# Install the Developer Toolset 7 package to obtain a more current version of GCC | |
sudo yum install centos-release-scl | |
sudo yum install devtoolset-7 |
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
sudo yum install gcc make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl11-devel tk-devel libffi-devel xz-devel | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
CPPFLAGS=-I/usr/include/openssl11 LDFLAGS=-L/usr/lib64/openssl11 pyenv install 3.11 |
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
sudo dd if=/dev/zero of=/swapfile count=2048 bs=1MiB | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo vi /etc/fstab | |
/swapfile swap swap defaults 0 0 | |
sudo yum group install -y "Development Tools" | |
sudo yum install -y gcc-6 patch bzip2 openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel wget libcurl-devel tmux vim |
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
headers = %w(column1 column2 column3) | |
CSV.open('tmp/output.csv', 'wb') { |csv| csv << headers; MyModel.each { |app| csv << app.attributes.values_at(*headers) } } |
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
# List all available formats and download specific audio-only format | |
youtube-dl -F https://www.youtube.com/watch?v=xFjpTF4-PgI | |
youtube-dl -f 140 https://www.youtube.com/watch?v=xFjpTF4-PgI | |
# Download and convert to audio-only format | |
youtube-dl -x --audio-format m4a https://www.youtube.com/watch?v=xFjpTF4-PgI |
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
[mysqld] | |
innodb_buffer_pool_size=1G # Default: 128M. Ideally, this is 80% of the available RAM | |
max_connections=301 # Default: 151. Increase for more concurrent connections if you have the resources. | |
query_cache_size=64M # Default: 0 | |
# Check configuration of custom variables above | |
show variables like 'innodb_buffer%'; | |
show variables like '%connections%'; | |
show variables like '%query_cache%'; |
NewerOlder