Skip to content

Instantly share code, notes, and snippets.

View iruca3's full-sized avatar
🏠
Working from home

Dolphin iruca3

🏠
Working from home
View GitHub Profile
@iruca3
iruca3 / gist:2373af9a16c7bc86f19dad3d812d527d
Last active June 6, 2017 21:35
circleci-coverage-slack
###
# Post coverage rate to Slack
#
# Usage: bash circleci-coverage-slack.sh [cobertura|jacoco]
#
# Required environment variables:
#
# - CIRCLE_TOKEN: project-specific readonly API token (need to access build artifacts for others)
# - SLACK_ENDPOINT: Slack endpoint url
# - COVERAGE_FILE: coverage xml filename (default: coverage.xml)
@iruca3
iruca3 / atkba.rb
Created February 4, 2016 06:41
attacking basic auth
require 'net/http'
keywords = ['hoge', 'bar', 'mofu']
i = 1
while true
puts "#{i} length challenge."
# repeated_combination is also useful.
keywords.combination(i).each do |keywords|
require 'json'
KEYS = { '11' => '1', '12' => '2', '13' => '3', '14' => '4',
'15' => '5', '16' => '0', '18' => '6', '19' => '7' }
notes = []
open(ARGV[0]).each_line do |line|
arr = line.scan(/^#(\d{3,3})(\d{2,2}):(\w+)/)
next unless arr[0]
@iruca3
iruca3 / ika.rb
Last active August 29, 2015 14:23
イカ よろしくーーー!
class Hash
def max_depth
max_depth = 1
depth_func = ->(hsh, cur_depth) do
max_depth = cur_depth if cur_depth > max_depth
hsh["children"].to_a.each{|h| depth_func.call(h, cur_depth+1)}
max_depth
end
depth_func.call(self, 0)
end
#!/usr/bin/perl
use MIME::Base64;
use MIME::QuotedPrint::Perl;
my $mail_file = $ARGV[0];
open( FILE, $mail_file) or die "$!";
my $mail_content = "";
while ( <FILE> ) {