Icons, billeder brugt til illustration.
Generer adgangskode.
Degenerer adgangskode.
Foreløbig laves en dørstation til Videx. Og denne model af en website er et mix af kode samt anvendeligheden af de enkelte komponenter. Jeg tror at hvis kode, forretnings model samt tydelig forklaring for at producere et produkt er en rød tråd gennem dette website. Kan der laves en skabelon der får produkter hurtigt gennem udvikling. Med andre ord skal enhver kunne producere ud fra dette websites opskrifter.
I sidste ende er en kode idé ikke meget værd, hvis ikke den kan gøres til en forretning, som vi tjener penge på. Men vigtigst er at idé som kode beskyttes. Arbejder på det.
En DNS Server som FreeDNS, gør at man kan bruge navne som vist på billedet. Og ud fra et Domain som man ejer, kan skabe lige så mange navne man vil, ud fra sit Domain navn. Dette er en gratis løsning for at give vor kunder, eller enheder, som kameraer et web navn f.eks. kamera99.doordk.com eller hansi.doordk.com.
adresse1.doordk.com
adresse2.doordk.com
adresse3.doordk.com
adresse4.doordk.com
adresse5.doordk.com
osv.doordk.com
Under menu'en DNS ACME, ses hvordan man laver en secure HTTPS:// adresse med FreeDNS.
Link. FreeDNS https://freedns.afraid.org/På den lange bane, må vi selv have(lave) en DNS server. Og ikke være afhængig af FreeDNS.
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:2,0"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:2,0"
}
}
Update Firmware.
Når man forsøger at update Rocken. Går den i ged??.
Løsningen er at update key filen.
Update key.
After backup. Clean Up.
cd ~
rm cmake-3.29.0.tar.gz && sudo rm -R cmake-3.29.0
#!/bin/bash
ip_4=$(curl -m 120 -w '\n' -sfL 'api{4}.ipify.org')
#echo $ip_4
ping -c1 $ip_4 &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$ip_4 offline. Take action?"
IPV4_ADDRESS=$(dig whoami.cloudflare ch txt @1.1.1.1 +short | awk -F'"' '{print $2}')
#echo $IPV4_ADDRESS
ping -c1 $IPV4_ADDRESS &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$IPV4_ADDRESS offline. Take action?"
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "$IPV4_ADDRESS online"
IPV4_ADD=$IPV4_ADDRESS
fi
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "ip_4 online"
IPV4_ADD=$ip_4
fi
ip_6=$(curl -m 120 -w '\n' -sfL 'api{6}.ipify.org')
#echo $ip_6
ping -c1 $ip_6 &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$ip_6 offline. Take action?"
IPV6_ADDRESS=$(dig whoami.cloudflare ch txt @2606:4700:4700::1111 +short | awk -F'"' '{print $2}')
#echo $IPV6_ADDRESS
ping -c1 $IPV6_ADDRESS &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$IPV6_ADDRESS offline. Take action?"
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "$IPV6_ADDRESS online"
IPV6_ADD=$IPV6_ADDRESS
fi
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "ip_6 online"
IPV6_ADD=$ip_6
fi
if [[ -n "${IPV4_ADD}" ]]; then
#echo $IPV4_ADD
if : >/dev/tcp/8.8.8.8/53; then
#echo "$DATE wee are on internet"
FREEDNS_DOMAIN_0=doorbell.doordk.com
FREEDNS_DOMAINHASHKEY_0=NEp1d2VnZTRsbXNaRzB5dkdIb0tEZ0IxOjIwNjQzODQ5
registered_ip_0=$(host -t A doorbell.doordk.com | awk '{print $4}' | cut -d/ -f1)
#registered_ip_0=$(ping -qn -c 1 $FREEDNS_DOMAIN_0 | head -n 1 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
#registered_ip_0=$(curl --silent "https://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_0" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
UPDATE_URL_0="http://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_0&address=$IPV4_ADD"
#echo "$DATE wee are on internet. Freedns reg ip addresse: $registered_ip_0"
#
if [ "$IPV4_ADD" != "$registered_ip_0" ]; then
echo "$DATE $FREEDNS_DOMAIN_0 Update from $registered_ip_0 to $IPV4_ADD"
wget -q --read-timeout=0.0 --waitretry=5 --tries=400 --background $UPDATE_URL_0
fi
else
echo "$DATE IPV4 wee are NOT on internet. Take action?"
fi
fi
if [[ -n "${IPV6_ADD}" ]]; then
#echo $IPV6_ADD
if : >/dev/tcp/8.8.8.8/53; then
#echo "$DATE wee are on internet"
FREEDNS_DOMAIN_1=doorbell.doordk.com
FREEDNS_DOMAINHASHKEY_1=NEp1d2VnZTRsbXNaRzB5dkdIb0tEZ0IxOjIzMDkyNTA2
#registered_ip_1=$(ping -qn -c 1 $FREEDNS_DOMAIN_1 | head -n 1 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
registered_ip_1=$(host -t AAAA doorbell.doordk.com | awk '{print $5}' | cut -d/ -f1)
#registered_ip_1=$(curl --silent "https://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_1" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
UPDATE_URL_1="http://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_1&address=$IPV6_ADD"
#echo "$DATE wee are on internet. Freedns reg ip addresse: $registered_ip_1"
#
if [ "$IPV6_ADD" != "$registered_ip_1" ]; then
echo "$DATE $FREEDNS_DOMAIN_1 Update from $registered_ip_1 to $IPV6_ADD"
wget -q --read-timeout=0.0 --waitretry=5 --tries=400 --background $UPDATE_URL_1
fi
else
echo "$DATE IPV6 wee are NOT on internet. Take action?"
fi
fi
******************************************
SerialClass *serial=NULL;
serial=new SerialClass();
serial->set_port("/dev/ttyUSB2");
if( !serial->Start() ){
std::cout << "error findig port? " << std::endl;
letter = 'x';
}
Når programmet kører tast "a" og Enter for test.
Sender "AT\r" til modemet, og forventer at få svaret "OK".
time_out=3; Giver modemet 3seconds max, Har modemet ikke svaret inden kommer en fejl meddelse "Time OUT????".
ellers "Hurray: expected: OK"
std::string ttyUSB_port="";
std::string ttySIM_port="/dev/ttySIM02";
std::string ret=ExecCmd("ls -l /dev/ttySIM0*");
int pos = ret.find(ttySIM_port);
if( pos > 0 ){
// Copy substring after pos
std::string str = ret.substr(pos + 1);
boost::algorithm::trim(str);
std::vector strs;
boost::split(strs, str , boost::is_any_of("\n"));
if( strs.size() > 0 ){
//std::cout << strs.size() << " str: " << strs[0] << std::endl;
std::vector strs_1;
boost::split(strs_1, strs[0] , boost::is_any_of(" "));
if( strs_1.size() > 0 ){
ttyUSB_port=strs_1[strs_1.size()-1];
boost::algorithm::trim(ttyUSB_port);
ttyUSB_port="/dev/"+ttyUSB_port;
//std::cout << " ttyUSB_port: " << ttyUSB_port << std::endl;
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
/var/log/asterisk/debug /var/log/asterisk/console /var/log/asterisk/full /var/log/asterisk/messages /var/log/asterisk/*log {
missingok
rotate 15
compress
delaycompress
notifempty
size 2M
create 640 asterisk asterisk
sharedscripts
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
**********************************************
AST_USER="asterisk"
AST_GROUP="asterisk"
************************************
enabled=yes
bindport=8088
;; tls certificados
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/fullchain.pem
tlsprivatekey=/etc/asterisk/keys/key.pem
************************************
[general]
allowguest = no
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060
external_media_address = 80.91.3.214 ;; Public IP
external_signaling_address = 80.91.3.214 ;; Public IP
;local_net = 172.50.50.90/255.255.255.0 ;; Docker IP
[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0
external_media_address = 80.91.3.214 ;; Public Ip
external_signaling_address = 80.91.3.214 ;; Public Ip
;local_net = 172.50.50.90/255.255.255.0 ;; Docker Ip
;;
;; 6000 UDP
;;
[6000]
type = aor
max_contacts = 1
remove_existing=yes
[6000]
type=auth
auth_type=userpass
password=1234
username=6000
[6000]
type = endpoint
transport = transport-udp
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 6000
auth = 6000
webrtc=no
;;
;; 7000 UDP
;;
[7000]
type = aor
max_contacts = 1
remove_existing=yes
[7000]
type=auth
auth_type=userpass
password=1234
username=7000
[7000]
type = endpoint
transport = transport-udp
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7000
auth = 7000
webrtc=no
;;
;; 7001 Webrtc
;;
[7001]
type = aor
max_contacts = 1
remove_existing=yes
[7001]
type=auth
auth_type=userpass
password=1234
username=7001
[7001]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7001
auth = 7001
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7002 Webrtc
;;
[7002]
type = aor
max_contacts = 1
remove_existing=yes
[7002]
type=auth
auth_type=userpass
password=1234
username=7002
[7002]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7002
auth = 7002
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
[webrtc-phones](!)
context=office-phones
transport=transport-wss
;allow=!all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
webrtc=yes
************************************
[office-phones]
exten => 6000,1,Dial(PJSIP/6000)
exten => 7000,1,Dial(PJSIP/7000)
exten => 7001,1,Dial(PJSIP/7001)
exten => 7002,1,Dial(PJSIP/7002)
same => n,Playback(hello-world)
same => n,Hangup()
************************************
noload = app_voicemail_imap.so
noload = app_voicemail_odbc.so
noload => res_config_ldap.so
load = res_crypto
load = res_http_websocket
load = res_pjsip_transport_websocket
load = codec_opus
load = res_srtp
************************************
[general]
rtpstart=10000
rtpend=10099
icesupport=yes ;; important
strictrtp=no ;; important
stunaddr=stun.l.google.com:19302 ;; important
************************************
radiuscfg => /etc/radcli/radiusclient.conf
************************************
[radius]
radiuscfg => /etc/radcli/radiusclient.conf
************************************
enabled = true
port = 5060,5061
filter = asterisk
#action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol="tcp"]
#%(default/action_)s[name=%(__name__)s-udp, protocol="udp"]
action = %(action_)s
logpath = /var/log/asterisk/messages
findtime = 10800
maxretry = 3
bantime = 604800
************************************
sudo cp /etc/asterisk/asterisk.conf /etc/asterisk/asterisk.bak && \
sudo cp /etc/asterisk/cdr.conf /etc/asterisk/cdr.bak && \
sudo cp /etc/asterisk/cel.conf /etc/asterisk/cel.bak && \
sudo cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.bak && \
sudo cp /etc/asterisk/http.conf /etc/asterisk/http.bak && \
sudo cp /etc/asterisk/logger.conf /etc/asterisk/logger.bak && \
sudo cp /etc/asterisk/modules.conf /etc/asterisk/modules.bak && \
sudo cp /etc/asterisk/pjsip.conf /etc/asterisk/pjsip.bak && \
sudo cp /etc/asterisk/rtp.conf /etc/asterisk/rtp.bak
#Deploy asterisk .conf files.
sudo cp /home/rock/asterisk_conf/asterisk.conf /etc/asterisk/asterisk.conf && \
sudo cp /home/rock/asterisk_conf/cdr.conf /etc/asterisk/cdr.conf && \
sudo cp /home/rock/asterisk_conf/cel.conf /etc/asterisk/cel.conf && \
sudo cp /home/rock/asterisk_conf/extensions.conf /etc/asterisk/extensions.conf && \
sudo cp /home/rock/asterisk_conf/http.conf /etc/asterisk/http.conf && \
sudo cp /home/rock/asterisk_conf/logger.conf /etc/asterisk/logger.conf && \
sudo cp /home/rock/asterisk_conf/modules.conf /etc/asterisk/modules.conf && \
sudo cp /home/rock/asterisk_conf/pjsip.conf /etc/asterisk/pjsip.conf && \
sudo cp /home/rock/asterisk_conf/rtp.conf /etc/asterisk/rtp.conf
#Save asterisk .conf files for later use.
sudo cp /etc/asterisk/asterisk.conf /home/rock/asterisk_conf/asterisk.conf && \
sudo cp /etc/asterisk/cdr.conf /home/rock/asterisk_conf/cdr.conf && \
sudo cp /etc/asterisk/cel.conf /home/rock/asterisk_conf/cel.conf && \
sudo cp /etc/asterisk/extensions.conf /home/rock/asterisk_conf/extensions.conf && \
sudo cp /etc/asterisk/http.conf /home/rock/asterisk_conf/http.conf && \
sudo cp /etc/asterisk/logger.conf /home/rock/asterisk_conf/logger.conf && \
sudo cp /etc/asterisk/modules.conf /home/rock/asterisk_conf/modules.conf && \
sudo cp /etc/asterisk/pjsip.conf /home/rock/asterisk_conf/pjsip.conf && \
sudo cp /etc/asterisk/rtp.conf /home/rock/asterisk_conf/rtp.conf
Using Token-Based (.p8) vs Certificate-Based (.p12) Authentication to APNs.
Previous Token Revokation You can have up to two .p8 keys in your Apple account. If you need to generate a third key, you will need to revoke one of your existing keys and it can no longer be used.
Note: .p8 keys are in the “keys” section of the Apple developer account and the .p12 certificates are under “certificates”. In your Apple account, you can only have two .p8 keys, but you can have both active .p12s and .p8s.
https://developer.apple.com
#!/bin/bash
# IPv6
##
## set default policies to let everything in
ip6tables --policy INPUT ACCEPT;
ip6tables --policy OUTPUT ACCEPT;
ip6tables --policy FORWARD ACCEPT;
##
## start fresh
ip6tables -Z; # zero counters
ip6tables -F; # flush (delete) rules
ip6tables -X; # delete all extra chains
# IPv4
##
## set default policies to let everything in
iptables --policy INPUT ACCEPT;
iptables --policy OUTPUT ACCEPT;
iptables --policy FORWARD ACCEPT;
##
## start fresh
iptables -Z; # zero counters
iptables -F; # flush (delete) rules
iptables -X; # delete all extra chains
# delete old configuration, if any
# Flush all the rules in filter and nat tables
iptables --flush
iptables --table nat --flush
# delete all chains that are not in default filter and nat table, if any
iptables --delete-chain
iptables --table nat --delete-chain
chmod u+x reset_iptabeles.sh
#92
ignoreip = 127.0.0.1/8 ::1 192.168.1.0/24 80.91.3.214 10.42.0.0/24
bantime = 1d #101 "bantime" is the time that a host is banned 10m=10minutter 1d=1dag.
findtime = 10m #105 A host is banned if it has generated "maxretry" during the last "findtime" 10m=10minutter
maxretry = 3 #108 maxretry the maximum number of failures before the IP is blocked.
******************************************Under menu'en SIM7600.
Se assignment.
# linie 44
index index.php index.html index.htm;
# linie 56 57 60 63 Remove #
# from line 59
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# from line 72
# A long browser cache lifetime can speed up repeat visits to your page
location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
# disable access to hidden files
location ~ /\.ht {
access_log off;
log_not_found off;
deny all;
}
******************************************
<?php
phpinfo();
******************************************
<?php
$servername = "localhost";
$username = "phpmyadmin";
$password = "mariaspacewalk";
$dbname = "phpmyadmin";
// Create connection
$mysqli = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
echo "Connected successfully\n";
$sql = "SHOW DATABASES;";
// Process the query so that we will save the date of birth
$results = $mysqli->query($sql);
// Fetch Associative array
$row = $results->fetch_all(MYSQLI_ASSOC);
var_dump($row);
// Free result set
$results->free_result();
// Close the connection after using it
$mysqli->close();
******************************************Icons, billeder brugt til illustration.