mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.confto/usr/local/etc/nginx/defaultanddefault-sslto/usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plistto/Library/LaunchDaemons/
| # How to find out where a method comes from. | |
| # Learned this from Dave Thomas while teaching Advanced Ruby Studio | |
| # Makes the case for separating method definitions into | |
| # modules, especially when enhancing built-in classes. | |
| module Perpetrator | |
| def crime | |
| end | |
| end | |
| class Fixnum |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf to /usr/local/etc/nginx/default and default-ssl to /usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plist to /Library/LaunchDaemons/| include Rails.application.routes.url_helpers | |
| default_url_options[:host] = "localhost" |
| import com.google.common.cache.CacheBuilder; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.cache.CacheManager; | |
| import org.springframework.cache.annotation.CachingConfigurer; | |
| import org.springframework.cache.annotation.EnableCaching; | |
| import org.springframework.cache.guava.GuavaCache; | |
| import org.springframework.cache.interceptor.CacheErrorHandler; | |
| import org.springframework.cache.interceptor.CacheResolver; | |
| import org.springframework.cache.interceptor.KeyGenerator; |
| import com.google.common.cache.CacheBuilder; | |
| import org.springframework.cache.Cache; | |
| import org.springframework.cache.annotation.EnableCaching; | |
| import org.springframework.cache.guava.GuavaCache; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import java.util.concurrent.TimeUnit; | |
| @Configuration |
| # script used in consul to check if mysql is primary master and asynchronous slave | |
| # v.0.1 - lefred 2018-02-16 | |
| SLAVEOFDC="dc2" | |
| SLAVEUSER="async_repl" | |
| SLAVEPWD="asyncpwd" | |
| # check if we are the primary one | |
| ROLE=$(mysql -h 127.0.0.1 -BNe "select MEMBER_ROLE from performance_schema.replication_group_members where MEMBER_HOST=@@hostname") |
| # script used in consul | |
| # the following addition to sys is required: | |
| # https://gist.github.com/lefred/153448f7ea0341d6d0daa2738db6fcd8 | |
| # v.0.1 - lefred 2018-02-14 | |
| read -r mysql_primary mysql_readonly mysql_tx mysql_cert <<<$(mysql -h 127.0.0.1 -P 6446 -BNe "select * from sys.gr_member_routing_candidate_status") | |
| if [[ "${mysql_primary}" == "YES" ]] && [[ "${mysql_readonly}" == "NO" ]] | |
| then |
| # from http://dzone.com/snippets/analyse-binary-log | |
| # cat /bin/mylog | |
| #!/bin/sh | |
| # usage: | |
| #$ mylog /mysql-bin-log/db-bin.000223 | |
| # 2132 insert into customers | |
| # 1887 update userlog_access | |
| # 788 insert into gn_commission | |
| # 718 insert into con_tab |