sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536
root soft nofile 65536
root hard nofile 65536
# Displaimer | |
This is not a guide or a guideline. It is a collection of ideas, tools and stuff I was/will/am use. | |
Everything below is very subjectiv and can change over time. If you want to use something from here, | |
please feel free. But please don't consider it working "as is". In most cases you have to think about stuff. | |
# Security | |
## Adjust Firewall | |
<port close for high ports> |
sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536
root soft nofile 65536
root hard nofile 65536
<script charset="utf-8"> | |
<% if ENV["RAILS_ENV"] == "production" %> | |
var script = "/react-app-bundle.js"; | |
<% else %> | |
console.warn("Development mode. Make sure to start 'node devServer.js'"); | |
var script = "http://" + (location.host || 'localhost').split(':')[0] + ":4000/react-app-bundle.js" | |
<% end %> | |
document.write('<script src="' + script + '"></' + 'script>'); | |
</script> |
https://gist.github.com/josevalim/fb706b1e933ef01e4fb6 | |
https://gist.github.com/gonzalo-bulnes/7659739 | |
https://github.com/plataformatec/devise/issues/2739 | |
https://gist.github.com/danielgatis/5666941 | |
http://stackoverflow.com/questions/20319961/restful-login-with-devise-rails-4 | |
http://chasseurmic.github.io/chasseurmic/blog/2013/02/13/restful-api-authentication/ | |
http://lucatironi.github.io/tutorial/2013/05/05/ruby_rails_rubymotion_ios_app_authentication_devise_tutorial_part_one/ | |
http://blog.codebykat.com/2012/07/23/remote-api-authentication-with-rails-3-using-activeresource-and-devise/ | |
http://codedecoder.wordpress.com/2013/01/08/devise-login-with-authentication_token/ |
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.
This isn't practical for larger texts, like when I want to copy the whole contents of a file.
If I had been editing large-file.txt
locally, I could easily copy its contents by using the pbcopy
command:
module Colors | |
def colorize(text, color_code) | |
"\033[#{color_code}m#{text}\033[0m" | |
end | |
{ | |
:black => 30, | |
:red => 31, | |
:green => 32, | |
:yellow => 33, |