This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We do it with bundler: | |
$ bundle gem name_of_new_gem | |
Linklist: | |
Testing, testing, testing | |
http://www.smashingmagazine.com/2014/04/how-to-build-a-ruby-gem-with-bundler-test-driven-development-travis-ci-and-coveralls-oh-my/ | |
Create and share rake tasks inside a gem | |
http://andyatkinson.com/blog/2014/06/23/sharing-rake-tasks-in-gems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((1..20).to_a+[6]*4).map{|i|puts(('*'*i*2).center(80))} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add laravel Installer: | |
composer global require "laravel/installer=~1.1" | |
add path for laravel-command | |
PATH=$PATH:~/.composer/vendor/bin | |
PATH=~/.composer/vendor/bin:$PATH | |
Now you can do.. | |
laravel new yournewproject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) | |
timeout 15 | |
preload_app true | |
GC.respond_to?(:copy_on_write_friendly=) and | |
GC.copy_on_write_friendly = true | |
before_fork do |server,worker| | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.connection.disconnect! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted version of https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.10/unicorn/templates/default/unicorn.conf.erb | |
worker_processes <%= node[:unicorn][:worker_processes] %> | |
user "<%= @deploy[:user]%>" | |
working_directory "<%= @deploy[:deploy_to]%>/current" | |
listen "<%= @deploy[:deploy_to]%>/shared/sockets/unicorn.sock", :backlog => <%= node[:unicorn][:backlog] %>, :tcp_nodelay => <%= node[:unicorn][:tcp_nodelay] %>, :tcp_nopush => <%= node[:unicorn][:tcp_nopush] %>, :tries => <%= node[:unicorn][:tries] %>, :delay => <%= node[:unicorn][:delay] %>, :accept_filter => <%= node[:unicorn][:accept_filter].inspect %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export one table from database: | |
mysqldump -u root -p db_with_data table1 > /your/path/newsql.sql | |
# .. and import it again to another db: | |
mysql -u username -p -D db_without_data < /your/path/newsql.sql | |
if you need some encoding you can add "--default-character-set=UTF8" | |
#You can also connect directly into mysql and set the source: | |
mysql –h <host_name> -port=3306 –u <db_master_user> -p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rollback n steps | |
$ rake db:rollback STEP=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============= | |
# Basic Setup | |
# ============= | |
# I guess you’ve Python, right? So here we go to install django | |
$ pip install Django==1.6.4 | |
# It should output the Version number you set above | |
$ python -c "import django; print(django.get_version())" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Easy Install VNC on Ubuntu with GUI via EC2 (I used a Ubuntu 64 Precise 12.04 HVM Instance, daily) | |
$ sudo apt-get update | |
$ sudo apt-get install ubuntu-desktop | |
$ sudo apt-get install vnc4server | |
Add correct permissions for the Securty-Group of the Instance and grant access for port 5901 | |
Start the VNC-Server on Port :1 (or 5901) and set Password for connection | |
$ vncserver :1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mounting an EBS-Storage | |
Variables: | |
@device_name = /dev/sdf | |
@device_mount = xvdf | |
@mount_point = /my_space | |
Select the EBS-Storage in the AWS-Console (Web-Interface) and attach it to the desired device. | |
Here you can set the @device_name which is shown in your instance as @device_mount. |