class Task < ActiveRecord::Base
has_many :subtasks, class_name: 'Task', foreign_key: "parent_id"
belongs_to :parent, class_name: 'Task'
accepts_nested_attributes_for :subtasks, allow_destroy: true
belongs_to :user
belongs_to :project
end
def task_params
params.require(:task).permit(:title, :description, :priority, :status, :scheduled, :deadline, subtasks_attributes: [:title])
end
<%= simple_form_for @task do |t| %>
<%= t.simple_fields_for :subtasks, @task.subtasks.build do |f| %>
<div class="form-inputs">
<%= f.input :title %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
<% end %>
#!/bin/sh
#Включаем форвардинг пакетов
echo 1 > /proc/sys/net/ipv4/ip_forward
#Удалить все существующие правила
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
#Политику по умолчанию устанавливаем на блокировку
iptables -P INPUT DROP
iptables -P FORWARD DROP
#Разрешаем входящие/исходящие пакеты на шлюз из локальной сети
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth1 -m conntrack --ctstate NEW -j ACCEPT
#Разрешаем доступ из внутренней сети наружу
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -p tcp --dport 443 -m conntrack --ctstate NEW -j ACCEPT # HTTPS
iptables -A FORWARD -i eth1 -o eth0 -p tcp -m multiport --dport 25,110,143,465,587,993,995,2525 -m conntrack --ctstate NEW -j ACCEPT # Post
iptables -A FORWARD -i eth1 -o eth0 -p tcp -m multiport --dport 2041,2042 -m conntrack --ctstate NEW -j ACCEPT # mail.ru Agent
iptables -A FORWARD -i eth1 -o eth0 -p udp -m multiport --dport 500,4500 -m conntrack --ctstate NEW -j ACCEPT # VPN IPSec
iptables -A FORWARD -i eth1 -o eth0 -p tcp -m multiport --dport 5242,4244 -m conntrack --ctstate NEW -j ACCEPT # Viber
iptables -A FORWARD -i eth1 -o eth0 -p udp -m multiport --dport 5243,9785 -m conntrack --ctstate NEW -j ACCEPT # Viber
iptables -A FORWARD -i eth1 -o eth0 -p tcp -m multiport --dport 4433 -m conntrack --ctstate NEW -j ACCEPT # Sberbank
iptables -A FORWARD -i eth1 -o eth0 -p icmp --icmp-type echo-request -m conntrack --ctstate NEW -j ACCEPT
#Включаем NAT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#Заворачивем порты на порт прокси (делаем прозрачным)
iptables -t nat -A PREROUTING -i eth1 ! -d 192.168.1.0/24 -p tcp -m multiport --dport 80,8080 -j REDIRECT --to-port 3128
DSynchronize is a stand-alone utility that let you periodically synchronize two or more folders on Hard Disk, Floppy Disk, LAN, USB Key, CD-DVD (with packet writing software) and FTP server.
It is also possible to specify the time and the day to schedule the synchronization to run, and to create some additional "filters" for other factors.
Real-Time sync is also supported.