Here's what I did to get things working.
Yep, over at: https://developer.apple.com
# put this into /etc/logrotate.d/app-production | |
# to have a Rails app running on unicorns rotating/rolling its logs monthly | |
# check with logrotate -f /etc/logrotate.d/app-production | |
/web/app/production/shared/log/*.log { | |
monthly | |
missingok | |
rotate 24 | |
compress | |
delaycompress |
http { | |
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
server { | |
location /login { | |
# `set` is provided by the Rewrite module | |
set $filter "password|secret"; |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
#To Get List of Hardware | |
sudo networksetup -listallhardwareports | |
#To Disable IPv6 on Wifi Adapter | |
sudo networksetup -setv6off wi-fi | |
#To Disable IPv6 on Built-in Ethernet Adapter | |
sudo networksetup -setv6off Ethernet |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
# frozen_string_literal: true | |
namespace :db do | |
namespace :structure do | |
STRUCTURE_PATH = 'db/structure.sql' | |
def clean_structure_file | |
original = File.read(STRUCTURE_PATH) | |
cleaned = original.dup |