Skip to content

Instantly share code, notes, and snippets.

View drahamim's full-sized avatar

Daniel Rahamim drahamim

View GitHub Profile
#!/usr/bin/env python
import string
import sys
import hmac
import hashlib
def split_hex(value):
value = value[4:] if len(value) % 4 == 0 else "0" + value[4:]
return " ".join(value[i:i+4] for i in range(0, len(value), 4))
SECRET = bytearray.fromhex('85 44 E3 B4 7E CA 58 F9 58 30 43 F8')
D = hmac.new(SECRET, digestmod=hashlib.sha1)
@drahamim
drahamim / questions.txt
Created October 13, 2021 20:24
Job Questions for recruiters
Hi {{ Recruiter_first_name }},
Thanks for reaching out. Before we jump on a call, can you answer a few questions for me.
1. What is the current on-call like for the team?
2. How much on-call is expected for this role?
3. Expected Base comp range?
4. What are the expected {{ your_tz }} work hours?
5. How big is the team?
Please also send over a FULL job description.
Thanks in advance,
{{ Your First name here }}
<div class="whiteGreyCardBox cardData">
<div class="cardInfo">
<div class="infoDiv">
<div class="fieldName">Type:</div>
<div class="fieldData">ADULT</div>
</div>
<div class="infoDiv">
<div class="fieldName">Status:</div>
<div class="fieldData">Active</div>

Keybase proof

I hereby claim:

  • I am drahamim on github.
  • I am drahamim (https://keybase.io/drahamim) on keybase.
  • I have a public key whose fingerprint is 1CAD 5877 C45C 96CD E5AC 652D C7D5 CDED 4D68 83F6

To claim this, I am signing this object:

@drahamim
drahamim / migration.sh
Created November 17, 2015 17:12 — forked from stephenlauck/migration.sh
Migrate node across hosted chef servers
# update gems
sudo gem update --no-rdoc --no-ri
# edit client.rb with correct validation key and chef server
# also set the environment
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-comments"
validation_client_name "modcloth-comments-validator"
node_name "comments-standalone-01.demo.modcloth.com"
@drahamim
drahamim / Bootstrapping chef client behind firewall
Last active August 29, 2015 14:26 — forked from vinyar/Bootstrapping chef client behind firewall
Bootstrapping chef client behind firewall
https://docs.chef.io/knife_bootstrap.html#custom-templates
https://docs.chef.io/install_bootstrap.html
https://docs.chef.io/knife_bootstrap.html
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb
Blog:
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/
http://www.tomduffield.com/bootstrapping-without-the-internet/
@drahamim
drahamim / output Sidekiq web gui
Created March 27, 2013 22:13
Gitlab notification email is slow to send or doesnt send at all.
Job Class Sidekiq::Extensions::DelayedMailer
Job Arguments "---\n- !ruby/class 'Notify'\n- :project_access_granted_email\n- - 6\n"
Job ID 4a6b450384bdc4199a21f6cf
Retry Count 2
Last Retry about a minute ago
Next Retry less than a minute from now
Error
Error Class ArgumentError
Error Message wrong number of arguments(3 for 0)
@drahamim
drahamim / Production.log
Last active December 15, 2015 12:09
Gitlab fails to move a project to from Admin namespace to Global name space
Project::TransferError (uninitialized constant ProjectTransferService::TransferError):
app/services/project_transfer_service.rb:29:in `rescue in transfer'
app/services/project_transfer_service.rb:11:in `transfer'
app/models/project.rb:295:in `transfer'
app/contexts/projects/update_context.rb:13:in `execute'
app/controllers/admin/projects_controller.rb:34:in
@drahamim
drahamim / gist:5154388
Created March 13, 2013 17:37
Running sidekiq for a Gitlab installation returns the following.
Running command sudo -u gitlab -H bundle exec rake sidekiq:start RAILS_ENV=production
shows
No such file or directory - /home/gitlab/gitlab/tmp/pids/sidekiq.pid
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `initialize'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `open'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `write_pid'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:73:in `parse'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/bin/sidekiq:7:in `<top (required)>'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/sidekiq:23:in `load'
@drahamim
drahamim / Backtrace
Last active December 14, 2015 19:19
error received during gem installation when running sudo -u gitlab -H bundle install --deployment --without development test postgres
# sudo -u gitlab -H bundle install --deployment --without development test postgres
Fetching source index from http://rubygems.org/
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/fetcher.rb:119:in `specs': undefined method `each' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/source/rubygems.rb:244:in `block in remote_specs'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/source/rubygems.rb:244:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/source/rubygems.rb:244:in `remote_specs'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/source/rubygems.rb:162:in `fetch_specs'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.2/lib/bundler/source/rubygems.rb:66:in `specs'