-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
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 a migration | |
| ### rails g migration make_unicode_friendly | |
| class MakeUnicodeFriendly < ActiveRecord::Migration | |
| def change | |
| alter_database_and_tables_charsets "utf8", "utf8_general_ci" | |
| end | |
| private | |
| def alter_database_and_tables_charsets charset = default_charset, collation = default_collation |
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
| // Add / Update a key-value pair in the URL query parameters | |
| function updateUrlParameter(uri, key, value) { | |
| // remove the hash part before operating on the uri | |
| var i = uri.indexOf('#'); | |
| var hash = i === -1 ? '' : uri.substr(i); | |
| uri = i === -1 ? uri : uri.substr(0, i); | |
| var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); | |
| var separator = uri.indexOf('?') !== -1 ? "&" : "?"; | |
| if (uri.match(re)) { |
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
| require 'net/sftp' | |
| SERVER = "127.0.0.0" | |
| KEY_FILE = "/tmp/id_rsa" | |
| Net::SFTP.start(SERVER, 'huskercane', :keys=>[KEY_FILE]) do |sftp| | |
| sftp.mkdir! "/tmp/something" | |
| #thats right needs full file name to copy | |
| sftp.upload!("/tmp/something/something.txt", "/tmp/something/something.txt") | |
| 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
| CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french ); | |
| ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING | |
| FOR hword, hword_part, word WITH unaccent, french_stem; | |
| CREATE TEXT SEARCH CONFIGURATION en ( COPY = english ); | |
| ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING | |
| FOR hword, hword_part, word WITH unaccent, english_stem; | |
| CREATE TEXT SEARCH CONFIGURATION de ( COPY = german ); | |
| ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING |
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
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
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
| docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
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
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
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 | |
| . /etc/init.d/functions | |
| PIDFILE=/var/run/tsd.pid | |
| LOCKFILE=/var/lock/subsys/tsd | |
| TSD_CONF=/usr/local/etc/tsd.conf | |
| TSDB_BIN=/usr/local/bin/tsdb | |
| TSD_LOGDIR=/var/tmp/tsd | |
| export TSDB_HOME=/usr/local/share/opentsdb |