You need to do this if you try this command:
ssh -T [email protected]
and you get something that says
[email protected]: Permission denied (public key).
You need to do this if you try this command:
ssh -T [email protected]
and you get something that says
[email protected]: 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 |
[email protected]:~$ 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
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
#!/bin/bash | |
rm -rf api.rubyonrails.org/ | |
wget -r -k -p http://api.rubyonrails.org/ | |
rm rails_api.rar | |
rar a -r rails_api.rar api.rubyonrails.org/ |
Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.
I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.