iface, _ := net.Interfaces()
for _, inter := range iface {
fmt.Println("iface=", inter.Name, " mac=", inter.HardwareAddr)
if inter.Name == "Ethernet" {
fmt.Println("работаем с Ethernet")
fmt.Println("iface=", inter.Name, " mac=", inter.HardwareAddr) //текущие значения IP и MAC
}
}
func getAllPacients(){ //Соединение с БД
var i int //Переменная для обхода масива
i = 0
db, err := sql.Open("mysql", username+":"+password+"@tcp("+server+":3306)/clinic") //Настраиваем соединение с БД
rows,err :=db.Query("SELECT * FROM Pacient") //Выборка всех пациентов
checkErr(err)//Проверяем отсутсвие ошибок
tmp := pacientStruct{}
Counter = conterQuey() // запрашиваем кол-во строк в таблице
fmt.Println("Counter =",Counter)
fmt.Println("=============================================================")
for rows.Next() { //получаем построчно информацию из запроса
//Присваиваем значение переменным получая их их последовательно из интерфейса
err = rows.Scan(&tmp.Id, &tmp.Pacientid, &tmp.FirstName, &tmp.LastName, &tmp.MiddleName, &tmp.Sex, &tmp.Birthday, &tmp.Tel, &tmp.Tel2, &tmp.Adress, &tmp.Email, &tmp.Whatsapp)
checkErr(err) //проверяем на ошибку
fmt.Print("RowScan = ")
if len(PacientResultSlice) < Counter {
PacientResultSlice = PacientResult[:Counter]
}
PacientResultSlice[i].Id=tmp.Id
PacientResultSlice[i].Pacientid=tmp.Pacientid
PacientResultSlice[i].FirstName=tmp.FirstName
PacientResultSlice[i].LastName=tmp.LastName
PacientResultSlice[i].MiddleName=tmp.MiddleName
PacientResultSlice[i].Sex=tmp.Sex
PacientResultSlice[i].Birthday=tmp.Birthday
PacientResultSlice[i].Tel=tmp.Tel
PacientResultSlice[i].Tel2=tmp.Tel2
PacientResultSlice[i].Adress=tmp.Adress
PacientResultSlice[i].Email=tmp.Email
PacientResultSlice[i].Whatsapp=tmp.Whatsapp
fmt.Print("PacientResultSlice[",i,"]= ",PacientResultSlice[i].Id)
fmt.Print(" Длина PacientResultSlice = ",len(PacientResultSlice))
fmt.Println(" | i = ", i, " ")
i++
}
db.Close() //Закрываем соединение с БД
}
//
// Do any local configuration here
//
zone "example.com"{
type master;
file "/etc/bind/example.com.hosts";
};
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "10.168.192.in-addr.arpa" {
type master;
file "/etc/bind/192.168.10.in-addr.arpa";
};
$TTL 38400
@ IN SOA ns.example.com. example.com (
1192648703
10800
3600
604800
38400 )
;
@ IN NS localhost.
ns IN NS 192.168.10.1
gate IN A 192.168.10.1
storage IN A 192.168.10.6
promo1 IN A 192.168.10.55
$TTL 3600
@ IN SOA gate.example.com. example.com (
20060204 ; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
@ IN NS localhost.
1 IN NS ns.
6 IN PTR storage.
55 IN PTR promo1.
~
[root@localhost ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
INPUT_direct all -- anywhere anywhere
INPUT_ZONES_SOURCE all -- anywhere anywhere
INPUT_ZONES all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
DROP all -- anywhere anywhere ctstate INVALID
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 ctstate RELATED,ESTABLISHED
ACCEPT all -- 192.168.122.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
FORWARD_direct all -- anywhere anywhere
FORWARD_IN_ZONES_SOURCE all -- anywhere anywhere
FORWARD_IN_ZONES all -- anywhere anywhere
FORWARD_OUT_ZONES_SOURCE all -- anywhere anywhere
FORWARD_OUT_ZONES all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
DROP all -- anywhere anywhere ctstate INVALID
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:bootpc
OUTPUT_direct all -- anywhere anywhere
Chain FORWARD_IN_ZONES (1 references)
target prot opt source destination
FWDI_FedoraWorkstation all -- anywhere anywhere [goto]
FWDI_FedoraWorkstation all -- anywhere anywhere [goto]
FWDI_FedoraWorkstation all -- anywhere anywhere [goto]
FWDI_FedoraWorkstation all -- anywhere anywhere [goto]
Chain FORWARD_IN_ZONES_SOURCE (1 references)
target prot opt source destination
Chain FORWARD_OUT_ZONES (1 references)
target prot opt source destination
FWDO_FedoraWorkstation all -- anywhere anywhere [goto]
FWDO_FedoraWorkstation all -- anywhere anywhere [goto]
FWDO_FedoraWorkstation all -- anywhere anywhere [goto]
FWDO_FedoraWorkstation all -- anywhere anywhere [goto]
Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target prot opt source destination
Chain FORWARD_direct (1 references)
target prot opt source destination
Chain FWDI_FedoraWorkstation (4 references)
target prot opt source destination
FWDI_FedoraWorkstation_log all -- anywhere anywhere
FWDI_FedoraWorkstation_deny all -- anywhere anywhere
FWDI_FedoraWorkstation_allow all -- anywhere anywhere
Chain FWDI_FedoraWorkstation_allow (1 references)
target prot opt source destination
Chain FWDI_FedoraWorkstation_deny (1 references)
target prot opt source destination
Chain FWDI_FedoraWorkstation_log (1 references)
target prot opt source destination
Chain FWDO_FedoraWorkstation (4 references)
target prot opt source destination
FWDO_FedoraWorkstation_log all -- anywhere anywhere
FWDO_FedoraWorkstation_deny all -- anywhere anywhere
FWDO_FedoraWorkstation_allow all -- anywhere anywhere
Chain FWDO_FedoraWorkstation_allow (1 references)
target prot opt source destination
Chain FWDO_FedoraWorkstation_deny (1 references)
target prot opt source destination
Chain FWDO_FedoraWorkstation_log (1 references)
target prot opt source destination
Chain INPUT_ZONES (1 references)
target prot opt source destination
IN_FedoraWorkstation all -- anywhere anywhere [goto]
IN_FedoraWorkstation all -- anywhere anywhere [goto]
IN_FedoraWorkstation all -- anywhere anywhere [goto]
IN_FedoraWorkstation all -- anywhere anywhere [goto]
Chain INPUT_ZONES_SOURCE (1 references)
target prot opt source destination
Chain INPUT_direct (1 references)
target prot opt source destination
Chain IN_FedoraWorkstation (4 references)
target prot opt source destination
IN_FedoraWorkstation_log all -- anywhere anywhere
IN_FedoraWorkstation_deny all -- anywhere anywhere
IN_FedoraWorkstation_allow all -- anywhere anywhere
Chain IN_FedoraWorkstation_allow (1 references)
target prot opt source destination
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns ctstate NEW
ACCEPT udp -- anywhere anywhere udp dpt:netbios-ns ctstate NEW
ACCEPT udp -- anywhere anywhere udp dpt:netbios-dgm ctstate NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ctstate NEW
ACCEPT udp -- anywhere anywhere udp dpts:blackjack:65535 ctstate NEW
ACCEPT tcp -- anywhere anywhere tcp dpts:blackjack:65535 ctstate NEW
Chain IN_FedoraWorkstation_deny (1 references)
target prot opt source destination
Chain IN_FedoraWorkstation_log (1 references)
target prot opt source destination
Chain OUTPUT_direct (1 references)
target prot opt source destination