Skip to content

Instantly share code, notes, and snippets.

Ilya Katz ilyakatz

  • Square
  • SF
Block or report user

Report or block ilyakatz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ilyakatz
ilyakatz / ssl_puma.sh
Created Oct 27, 2016 — forked from tadast/ssl_puma.sh
localhost SSL with puma
View ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@ilyakatz
ilyakatz / siera.sh
Last active Nov 1, 2016
Max OS X sierra upgrade
View siera.sh
xcode-select --install
bundle config build.nokogiri --use-system-libraries   
bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include
gem install eventmachine -v '1.0.7' -- --with-cppflags=-I/usr/local/opt/openssl/include          
@ilyakatz
ilyakatz / opsworks.rb
Last active Aug 29, 2015
Viewing logs in OpsWorks
View opsworks.rb
require 'aws-sdk-core'
deployments = opsworks.describe_commands(deployment_id: deployment_id)
region = "us-east-1"
opsworks = Aws::OpsWorks::Client.new(region: region)
deployments = opsworks.describe_commands(deployment_id: deployment_id)
deployments[0].collect(&:log_url).compact
@ilyakatz
ilyakatz / largest.sql
Last active Aug 29, 2015
Largest tables (mysql)
View largest.sql
/*
http://www.percona.com/blog/2008/02/04/finding-out-largest-tables-on-mysql-server/
*/
SELECT CONCAT(table_schema, '.', table_name) ,
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 ), 2), 'M') total_size,
ROUND(index_length / data_length, 2) idxfrac
View Ilya_Katz_pub.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFRY6TUBCADgzqFSpV15H77BC574fnzYNl7rFEerbyeK1JIwnkCRvssS/S8ZzGNwgYUn
eMZFT3t9euYAzTx0WgHwhdDUZpRPXsYIfzjz44bXPd4yhJtes12twpj4ZD9RBmbDLnnVpPY1
ZVvk6EICKsy3FuwaQ1t/SxwWJ/w/aVHzTmlvxHuLYsp418Ik+5S+EAg/zB0ME/V89BUNiC/w
tEisE2EZj6JZSXeQrs7YQhZxe5E5HNewBdEvpigvlFUS/Q3aObeFe1lj5M1sGn6Cmrzs8GXy
Q/qWzVuRqjiVy7229Tm2+yARLm87KbbyRWVjdj43ykM1NcDwl/GEau57o6QNuwKUl1KrABEB
AAG0HklseWEgS2F0eiA8aWx5YWthdHpAZ21haWwuY29tPokBMgQQAQgAJgUCVFjpNwYLCQgH
AwIJEFLp7GBMMJSGBBUIAgoDFgIBAhsDAh4BAACvwAf/dv8j/OfJ1IjxQrFvRXv/BxTBZ8UD
99igTFHM8KuYhK/AluOKQZMR34yUNVyGPvO6Iz3+jDeES8d3PoVOOD8y7VKtqwkooXLjFb4m
View onename
Verifying that +katzmopolitan is my Bitcoin username. You can send me #bitcoin here: https://onename.io/katzmopolitan
@ilyakatz
ilyakatz / active_admin.rb
Created Aug 12, 2014
Custom default order order in active_admin
View active_admin.rb
# initializers/active_admin.rb
module ActiveAdmin
class OrderClause
alias_method :initialize_old, :initialize
alias_method :valid_old?, :valid?
alias_method :to_sql_old, :to_sql
def initialize(clause)
if clause.class == String
initialize_old(clause)
@ilyakatz
ilyakatz / abd_broadcase_receivers.sh
Created Mar 9, 2014
List all registered BroadcastReceivers
View abd_broadcase_receivers.sh
#statuc
adb shell dumpsys activity b
# dynamic
adb shell dumpsys package
@ilyakatz
ilyakatz / primary_key_autoincrement. rb
Created Feb 5, 2014
Update the value of the primary key auto increment for a model in rails
View primary_key_autoincrement. rb
klazz = SoftwareMember
klazz .connection.execute("ALTER TABLE #{klazz .table_name} AUTO_INCREMENT = 1000")
View _asset_exception_pages.md

In order to use asset pipeline available for static error pages (like 404.html), a few steps are required

  • Move static pages from /public into /app/assets

    (eg: public/422.html → app/assets/html/422.html.erb)

  • Add html directory to the asset pipeline

  • Update exceptions middleware to understand assets with digests

You can’t perform that action at this time.