You need to do this if you try this command:
ssh -T git@github.comand you get something that says
git@github.com: Permission denied (public key).| hostname: example-registry.com | |
| external_url: https://example-registry.com | |
| # http related config | |
| http: | |
| # port for http, default is 80. If https enabled, this port will redirect to https port | |
| port: 8080 | |
| # https related config |
You need to do this if you try this command:
ssh -T git@github.comand you get something that says
git@github.com: Permission denied (public key).| namespace :optimization do | |
| desc "Provide DB vacuum for production environment" | |
| task :vacuum => :environment do | |
| begin | |
| tables = ActiveRecord::Base.connection.tables | |
| tables.each do |table| | |
| ActiveRecord::Base.connection.execute("VACUUM FULL ANALYZE #{table};") | |
| end | |
| rescue Exception => exc | |
| Rails.logger.error("Database VACUUM error: #{exc.message}") |
| # credit: http://stackoverflow.com/questions/4514988/rails-is-there-away-to-get-the-date-object-that-is-the-closest-monday-to-today | |
| # docs: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html#method-c-commercial | |
| # Find the next Monday | |
| Date.commercial(Date.today.year, 1+Date.today.cweek, 1) | |
| # Find the nearest Monday | |
| Date.commercial(Date.today.year, Date.today.cwday.modulo(4)+Date.today.cweek, 1) | |
| # Date of writing was: 2013-12-03 |
| # FOR BUSY JOBS | |
| # take the process_id from the /busy page in sidekiq and kill the longest running one. | |
| workers = Sidekiq::Workers.new | |
| workers.each do |process_id, thread_id, work| | |
| process = Sidekiq::Process.new('identity' => process_id) | |
| process.stop! if process_id == 'integration.3:4:71d1d7f4ef5a' | |
| end | |
| # FOR SCHEDULED JOBS | |
| # you need to know the jid to make this happen |
| class DateRangeSplitter | |
| include Enumerable | |
| def initialize(date_from, date_to, max_days, end_inclusive: true) | |
| @date_from = date_from | |
| @date_to = date_to | |
| @max_days = max_days | |
| @end_inclusive = end_inclusive | |
| generate_split_dates | |
| end |
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot
pi@raspberrypi ~ $ sudo apt-get update
| module ChargebeeFetcher | |
| class Subscription | |
| attr_reader :response | |
| delegate :has_card?, to: :customer, allow_nil: true | |
| delegate :card_expired?, :card_will_expire_soon?, to: :card | |
| def initialize(response) | |
| @response = response | |
| end |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |