SSH into Root
$ ssh root@123.123.123.123
Change Root Password
| import Ember from 'ember'; | |
| export default Ember.Component.extend(KeyHandling, { | |
| setupQuill: Ember.on("didInsertElement", function() { | |
| this.quill = new Quill(this.$('.rich-text-editor__contents').get(0)); | |
| this.quill.on("text-change", this.editorChanged.bind(this)); | |
| this.quill.on("selection-change", this.selectionChanged.bind(this)); |
| # | |
| # mmm m m mmm mmm mmm mmmmm mmm | |
| # " # "m m m" #" # # " #" "# # # # #" # | |
| # m"""# #m#m# #"""" """m # # # # # #"""" | |
| # "mm"# # # "#mm" "mmm" "#m#" # # # "#mm" | |
| # | |
| # nginx configuration For Ruby/Rack web applications | |
| # | |
| # Cooked up with style, care and a bit of *secret* | |
| # nerdy spice. :-) |
| daemon off; | |
| worker_processes 4; | |
| events { | |
| use epoll; | |
| accept_mutex on; | |
| multi_accept on; | |
| worker_connections 1024; | |
| } |
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545
| #!/bin/bash | |
| USER=deploy | |
| KEYS_PATH=https://github.com/chloerei.keys | |
| useradd -s /bin/bash -m deploy | |
| passwd $USER | |
| adduser $USER sudo | |
| mkdir /home/$USER/.ssh | |
| wget $KEYS_PATH -O /home/$USER/.ssh/authorized_keys |
If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.
Rack describes itself as follows:
Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.
Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.
At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.
| [Unit] | |
| Description=Puma Rails Server | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=deploy | |
| WorkingDirectory=/home/deploy/app/current | |
| ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb | |
| ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop |
| .video-container { | |
| position: relative; | |
| padding-bottom: 56.25%; /*16:9*/ | |
| padding-top: 30px; | |
| height: 0; | |
| overflow: hidden; | |
| } | |
| .video-container iframe, | |
| .video-container object, |
| class Cosine | |
| def initialize vecA, vecB | |
| @vecA = vecA | |
| @vecB = vecB | |
| end | |
| def calculate_similarity | |
| return nil unless @vecA.is_a? Array | |
| return nil unless @vecB.is_a? Array | |
| return nil if @vecA.size != @vecB.size |