Skip to content

Instantly share code, notes, and snippets.

View sonalkr132's full-sized avatar
🐢
β€β€β€Ž

Aditya Prakash sonalkr132

🐢
β€β€β€Ž
View GitHub Profile
== Brakeman Report ==
Application Path: /home/aditya/rubygems.org
Rails Version: 5.2.2
Brakeman Version: 4.4.0
Scan Date: 2019-01-18 16:23:20 +0530
Duration: 1.622901744 seconds
Checks Run: BasicAuth, BasicAuthTimingAttack, ContentTag, CreateWith, CrossSiteScripting, DefaultRoutes, Deserialize, DetailedExceptions, DigestDoS, DynamicFinders, EscapeFunction, Evaluation, Execute, FileAccess, FileDisclosure, FilterSkipping, ForgerySetting, HeaderDoS, I18nXSS, JRubyXML, JSONEncoding, JSONParsing, LinkTo, LinkToHref, MailTo, MassAssignment, MimeTypeDoS, ModelAttrAccessible, ModelAttributes, ModelSerialize, NestedAttributes, NestedAttributesBypass, NumberToCurrency, PermitAttributes, QuoteTableName, Redirect, RegexDoS, Render, RenderDoS, RenderInline, ResponseSplitting, RouteDoS, SQL, SQLCVEs, SSLVerify, SafeBufferManipulation, SanitizeMethods, SelectTag, SelectVulnerability, Send, SendFile, SessionManipulation, SessionSettings, SimpleFormat, SingleQuotes, SkipBeforeFilter, SprocketsPathTraversal, StripTags, Symbo
@sonalkr132
sonalkr132 / Jan_2019.sql
Created January 13, 2019 11:15
In dumps compared, 4 gems got more than 10 versions under an hour and 2 gems got 7 versions within a minute.
gemcutter_development=# select name, updated_at from rubygems order by updated_at desc limit 1;
name | updated_at
-------------+----------------------------
canvas_sync | 2019-01-07 21:10:22.016253
(1 row)
gemcutter_development=# select count(*) from (select date_trunc('hour',created_at) as created_at, count(*) as num, rubygem_id from versions group by 1, 3 order by num
desc) as s where s.num > 10;
count
-------
@sonalkr132
sonalkr132 / brakeman.json
Created December 25, 2018 08:01
brakeman -c config/brakeman.yml
{
"scan_info": {
"app_path": "/home/aditya/rubygems.org",
"rails_version": "5.2.1.1",
"security_warnings": 2,
"start_time": "2018-12-25 13:30:52 +0530",
"end_time": "2018-12-25 13:30:54 +0530",
"duration": 1.919798021,
"checks_performed": [
"BasicAuth",
select substr(name,1,1) as alpha, count(id)/30
from rubygems
group by substr(name,1,1);
alpha | ?column?
-------+----------
_ | 0
- | 0
. | 0
0 | 0
$ git s
On branch 5-1-upgrade
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: Gemfile
modified: Gemfile.lock
modified: config/application.rb
@sonalkr132
sonalkr132 / Vagrantfile
Last active February 26, 2019 11:29
Setting up puppet master and agent using vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.hostmanager.enable = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.vm.define "puppet" do |puppet|
puppet.vm.box = "ubuntu/xenial64"
@sonalkr132
sonalkr132 / cable.yml
Created May 1, 2017 12:18
rails 5 update new files which were removed on rubygems.org
development:
adapter: async
test:
adapter: async
production:
adapter: redis
url: redis://localhost:6379/1
1) Failure:
SearchTest#test_params_has_non_white_listed_keys [/home/addie/rubygems.org/test/integration/search_test.rb:64]:
Expected false to be truthy.
2) Failure:
SearchTest#test_searching_for_a_gem [/home/addie/rubygems.org/test/integration/search_test.rb:16]:
Expected false to be truthy.
# Custom Analyzer for ActiveRecord integration with Elasticsearch
# ===============================================================
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'ansi'
require 'logger'
require 'active_record'
require 'elasticsearch/model'