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://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster | |
innodb_buffer_pool_size = 4G | |
innodb_log_buffer_size = 256M | |
innodb_log_file_size = 1G | |
innodb_write_io_threads = 16 | |
innodb_flush_log_at_trx_commit = 0 | |
Why these settings ? | |
innodb_buffer_pool_size will cache frequently read data |
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
#!/bin/zsh | |
# Opens a zoom meeting with the name you've given it. | |
# Drop this script in /usr/local/bin/openzoom | |
# Invoke with `openzoom meeting_name` | |
typeset -A meeting | |
# NOTE: set this hashmap with meeting_name and ids of that meeting | |
meeting[meeting_name]=123456789 |
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
#!/bin/sh | |
# prevent commit to local master branch | |
branch=`git symbolic-ref HEAD` | |
if [ "$branch" = "refs/heads/master" ]; then | |
echo "pre-commit hook: Can not commit to the local master branch." | |
exit 1 | |
fi | |
exit 0 |
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
# NOTE: several improvements to be made but I'm in a VAT preparation hurry | |
# - use "up" and "down" to make the migration reversible | |
# - use Sequel methods for extension/server create | |
Sequel.migration do | |
change do | |
file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'vat_rates.csv')) | |
run 'CREATE EXTENSION file_fdw;' | |
run 'CREATE SERVER file_fdw_server FOREIGN DATA WRAPPER file_fdw;' | |
create_table(:vat_rates, foreign: 'file_fdw_server', options: {format: 'csv', header: 'true', filename: file, delimiter: ','}) do | |
String :month, null: false |
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
# Serving Random Payloads with NGINX | |
# add set_random module https://github.com/openresty/set-misc-nginx-module#set_random | |
# edit file /etc/nginx/sites-enabled/default | |
set_random $uri 1 3; | |
map $uri $payloads { | |
1 /payload.lnk; | |
2 /payload.hta; | |
3 /payload.exe; |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
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
#! /bin/bash | |
#since slack 2.6.3 there is some hack in that file, so make sure this piece of code goes before the: | |
#start(assignIn({}, require('electron').remote.getGlobal('loadSettings'), { windowType: 'WEBAPP' })); | |
#..line | |
# since 3.0.5 | |
# or before the 'const loadSettings = ...' line | |
cat << 'EOF' >> /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js |
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
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/ | |
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html | |
# Be sure you have config/meta-data and config/user-data ready as per the below | |
# change ec2-user's password to your password | |
$ cat config/meta-data | |
local-hostname: amazonlinux.onprem | |
# eth0 is the default network interface enabled in the image. You can configure |
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
#!/usr/bin/env ruby | |
# Install some tools first | |
# brew install ffmpeg | |
# brew install lame | |
# brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxbase | |
# brew install --HEAD watsonbox/cmu-sphinx/cmu-pocketsphinx | |
# Place this file in the directory that you have files to convert. | |
# Make this file executable |
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
# Extended configuration for Thinking Sphinx can be stored in the | |
# config/thinking_sphinx.yml file within your application (this file was | |
# previously known as config/sphinx.yml in TS v1/v2). | |
# | |
# Many settings from Sphinx itself can be set here, and they'll flow through to | |
# the appropriate section of the generated configuration. However, some are | |
# used for Thinking Sphinx behaviour, and so those are documented here first. | |
# | |
# Configuration is grouped by environment, just like config/database.yml in a | |
# standard Rails application. |