This file contains 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
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rtv2.settings.base") | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() |
This file contains 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
import os | |
from base import * | |
#ENVIRON = os.getenv("DJANGO_ENVIRONMENT") | |
ENVIRON = "develop" | |
if ENVIRON == "develop": | |
from develop import * | |
elif ENVIRON == "staging": |
This file contains 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
#!/usr/bin/env python | |
import os | |
import sys | |
if __name__ == "__main__": | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rtv2.settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
This file contains 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
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "chef_solo" do | |
|chef| | |
chef.cookbooks_path="../chef-repo/cookbooks" | |
chef.roles_path="../chef-repo/roles" | |
chef.data_bags_path="../chef-repo/data_bags" | |
chef.add_role("webserver") | |
chef.add_recipe "freecast" | |
chef.node_name = "dev1" |
This file contains 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
import os, sys | |
sys.stdout = sys.stderr | |
_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
sys.path.insert(0, _PROJECT_DIR) | |
sys.path.insert(0, os.path.dirname(_PROJECT_DIR)) | |
_PROJECT_NAME = _PROJECT_DIR.split('/')[-1] | |
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME | |
. | |
from django.core.wsgi import get_wsgi_application |
This file contains 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
WSGIScriptAlias / /home/hypnosb/RTV2/rtv2/rtv2/wsgi.py | |
WSGIDaemonProcess hypnosb.example.com python-path=/home/hypnosb/RTV2/rtv2:/home/hypnosb/RTV2.env/lib/python2.7/site-packages processes=2 threads=15 display-name=%{GROUP} | |
WSGIProcessGroup hypnosb.example.com |
This file contains 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
[root@hv1 ~]# iscsiadm -m session | |
iscsiadm: No active sessions. | |
[root@hv1 ~]# iscsiadm -m discovery -t st -p 172.18.1.180:3260 | |
172.18.1.180:3260,1 iqn.2003-01.org.linux-iscsi.mon1.x8664:sn.f473a1af8e6d | |
172.18.1.180:3260,1 iqn.2003-01.org.linux-iscsi.mon1.x8664:sn.ca426f9b0ba4 | |
[root@hv1 ~]# iscsiadm --mode node -l all | |
Logging in to [iface: default, target: iqn.2010-10.org.openstack:volume-5d966646-9cf2-466f-9a05-d69584cfff9d, portal: 172.18.1.180,3260] (multiple) | |
Logging in to [iface: default, target: iqn.2010-10.org.openstack:volume-ac9b6133-8730-4adc-a1f4-057f290a1417, portal: 172.18.1.180,3260] (multiple) |
This file contains 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
self.reports.each_with_index do |i, r| | |
if i == 0 | |
r.amount = 5000 | |
r.save | |
else | |
r.amount = r.amount + @total | |
r.save | |
end | |
end | |
This file contains 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
class ProjectionsController < ApplicationController | |
... | |
private | |
# Use callbacks to share common setup or constraints between actions. | |
def set_projection | |
@projection = Projection.find(params[:id]) | |
end |
This file contains 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
def projection_params | |
params.require(:projection).permit(:name, | |
incomes_attributes: [:id, :name, :amount, :projection_id] | |
) | |
end |