Skip to content

Instantly share code, notes, and snippets.

@dschier-wtd
dschier-wtd / fedora 27 post
Last active August 22, 2018 01:01
fedora 27 post installation hints
# 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>
@diegopacheco
diegopacheco / aws-linux-ulimit.md
Last active October 23, 2020 02:16
How to Set ulimit on amazon linux | CentOS based?
sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536

root soft nofile 65536
root hard nofile 65536
@esamattis
esamattis / application.html.erb
Last active May 19, 2019 00:36
React hot reloading with Webpack for Ruby on Rails
<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>
@alcedo
alcedo / devise token auth notes
Created October 25, 2014 23:44
A list of Token authentication tutorials on rails using devise
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/
@hopsoft
hopsoft / db.rake
Last active September 17, 2024 06:23
Rails rake tasks for dump & restore of PostgreSQL databases
# 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
@dergachev
dergachev / ssh-forward-clipboard.md
Last active October 13, 2024 05:26
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

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:

@nhocki
nhocki / colors.rb
Created November 30, 2011 20:05
Colorize the output of your ruby rake tasks
module Colors
def colorize(text, color_code)
"\033[#{color_code}m#{text}\033[0m"
end
{
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,