sudo apt-get install -y rsnapshot
ssh-keygen
scp ~/.ssh/id_rsa.pub pi@mypi:/home/pi/.ssh/authorized_keys
sudo nano /etc/rsnapshot.conf
cmd_ssh /usr/bin/ssh
ssh_args -i /home/backupuser/.ssh/id_rsa
Remote:
sudo apt-get install rsync
Test:
sudo rsnapshot configtes
sudo rsnapshot hourly
#Really used this guide, and just add chown on .ssh
#http://dev.kprod.net/?q=linux-backup-rsnapshot-no-root.
For each Remote host:
sudo scp /home/backupuser/.ssh/id_rsa.pub pi@MyPi:
sudo useradd backupuser -c "limited backup user" -m -u 4210
sudo mkdir /home/backupuser/.ssh
sudo mv id_rsa.pub /home/backupuser/.ssh/authorized_keys
sudo nano /home/backupuser/rsync-wrapper.sh
sudo chown backupuser:backupuser /home/backupuser/rsync-wrapper.sh
sudo chown -R backupuser:backupuser /home/backupuser/.ssh/
sudo chmod 755 /home/backupuser/rsync-wrapper.sh
sudo nano /etc/sudoers
Add this line (This file is read only on debian systems, so ignore the warning)
backupuser ALL=NOPASSWD: /usr/bin/rsync
sudo ssh backupuser@REMOTE -i /home/backupuser/.ssh/id_rsa
torsdag 8 december 2016
onsdag 7 december 2016
Webmin on Raspberry Pi
sudo apt-get update
sudo apt-get -y upgrade
sudo nano /etc/apt/sources.list
sudo apt-get update
sudo apt-get install webmin
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
sudo nano /etc/apache2/sites-available/webmin.mypi.myserver.se.conf
<VirtualHost *:443>
ServerName webmin.mypi.mysite.se
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://mypi:10000/
ProxyPassReverse / http://mypi:10000/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/webmin.mypi.mysite.se/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/webmin.mypi.mysite.se/privkey.pem
</VirtualHost>
Disable SSl in Webmin
Add Trusted Referrer
#http://www.webmin.com/deb.html
sudo apt-get -y upgrade
sudo nano /etc/apt/sources.list
deb http://download.webmin.com/download/repository sarge contrib wget http://www.webmin.com/jcameron-key.ascsudo apt-key add jcameron-key.asc
sudo apt-get update
sudo apt-get install webmin
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
sudo nano /etc/apache2/sites-available/webmin.mypi.myserver.se.conf
<VirtualHost *:443>
ServerName webmin.mypi.mysite.se
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://mypi:10000/
ProxyPassReverse / http://mypi:10000/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/webmin.mypi.mysite.se/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/webmin.mypi.mysite.se/privkey.pem
</VirtualHost>
Disable SSl in Webmin
Add Trusted Referrer
#http://www.webmin.com/deb.html
tisdag 13 september 2016
Node-RED on Raspbian
#***************************************************
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install Node-RED.
#NOTE! Dont install with apt-get, you get old version!
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
#To start (Starts some verbose output, service continues if you quit with CTRL+c)
node-red-start
#Autostart on boot
sudo systemctl enable nodered.service
#Source:
#https://nodered.org/docs/hardware/raspberrypi
#***************************************************
#********** Additional Nodes **********
#***************************************************
#Move to .node-red
#npm install node-red-node-mysqlnpm install node-red-node-pushbullet
#npm install node-red-contrib-owfs #Havent got it to work
npm install node-red-contrib-thingspeak
#npm install node-red-contrib-freeboard
npm install node-red-dashboard
#npm install node-red-contrib-bigtimer
#npm install node-red-contrib-ramp-thermostat
npm install node-red-contrib-sunevents
npm install node-red-contrib-time-range-switch
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install Node-RED.
#NOTE! Dont install with apt-get, you get old version!
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
#To start (Starts some verbose output, service continues if you quit with CTRL+c)
node-red-start
#Autostart on boot
sudo systemctl enable nodered.service
#Source:
#https://nodered.org/docs/hardware/raspberrypi
#***************************************************
#********** Additional Nodes **********
#***************************************************
#Move to .node-red
cd ~/.node-red
#node-red-contrib-freeboard requires git
#node-red-contrib-freeboard requires git
sudo apt-get install git
#npm install node-red-node-mysqlnpm install node-red-node-pushbullet
#npm install node-red-contrib-owfs #Havent got it to work
npm install node-red-contrib-thingspeak
#npm install node-red-contrib-freeboard
npm install node-red-dashboard
#npm install node-red-contrib-bigtimer
#npm install node-red-contrib-ramp-thermostat
npm install node-red-contrib-sunevents
npm install node-red-contrib-time-range-switch
#npm install node-red-node-suncalc
npm install node-red-contrib-influxdb
npm install node-red-node-dropbox
npm install node-red-contrib-owfs
#Tellstick node requires telldus-core and libtelldus-core-dev
sudo apt-get install libtelldus-core-dev
npm install node-red-contrib-tellstick
#***************************************************
#********** Password Protect **********
#***************************************************
#Install Node-RED-Admin
sudo npm install -g node-red-admin
#Create password hash
node-red-admin hash-pw
#Update settings file
sudo nano /home/[MyUser]/.node-red/settings.js#Sometimes: /usr/lib/node_modules/node-red/settings.js
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "HASH_FROM_Node-RED-Admin_HERE",
permissions: "*"
}]
},
#Restart
node-red-stop
node-red-start
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
#Remember to eable proxy_wstunnel for websocket to work.
sudo a2enmod proxy_wstunnel
<VirtualHost *:443>
ServerName node-red.mysite.org
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /comms ws://[SERVER_IP]:1880/comms
ProxyPass / http://[SERVER_IP]:1880/
ProxyPassReverse /comms ws://[SERVER_IP]:1880/comms
ProxyPassReverse / https://[SERVER_IP]:1880/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/node-red.mysite.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/node-red.mysite.org/privkey.pem
</VirtualHost>
#***************************************************
#********** OpenZWave NOT WORKING!!! **********
#***************************************************
sudo apt-get install -y libudev-dev
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/libopenzwave1.3_1.4.164_armhf.deb
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/openzwave_1.4.164_armhf.deb
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/libopenzwave1.3-dev_1.4.164_armhf.deb
sudo dpkg -i libopenzwave1.3_1.4.164_armhf.deb
sudo dpkg -i libopenzwave1.3-dev_1.4.164_armhf.deb
sudo dpkg -i openzwave_1.4.164_armhf.deb
#***************************************************
#********** Configuration files **********
#***************************************************
/home/pi/.node-red/flows_[MyPi].json/home/pi/.node-red/flows_[MyPi]_cred.json
npm install node-red-contrib-influxdb
npm install node-red-node-dropbox
npm install node-red-contrib-owfs
#Tellstick node requires telldus-core and libtelldus-core-dev
sudo apt-get install libtelldus-core-dev
npm install node-red-contrib-tellstick
#***************************************************
#********** Password Protect **********
#***************************************************
#Install Node-RED-Admin
sudo npm install -g node-red-admin
#Create password hash
node-red-admin hash-pw
#Update settings file
sudo nano /home/[MyUser]/.node-red/settings.js#Sometimes: /usr/lib/node_modules/node-red/settings.js
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "HASH_FROM_Node-RED-Admin_HERE",
permissions: "*"
}]
},
#Restart
node-red-stop
node-red-start
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
#Remember to eable proxy_wstunnel for websocket to work.
sudo a2enmod proxy_wstunnel
<VirtualHost *:443>
ServerName node-red.mysite.org
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /comms ws://[SERVER_IP]:1880/comms
ProxyPass / http://[SERVER_IP]:1880/
ProxyPassReverse /comms ws://[SERVER_IP]:1880/comms
ProxyPassReverse / https://[SERVER_IP]:1880/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/node-red.mysite.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/node-red.mysite.org/privkey.pem
</VirtualHost>
#***************************************************
#********** OpenZWave NOT WORKING!!! **********
#***************************************************
sudo apt-get install -y libudev-dev
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/libopenzwave1.3_1.4.164_armhf.deb
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/openzwave_1.4.164_armhf.deb
wget http://mirror.my-ho.st/Downloads/OpenZWave/Raspbian_Wheezy/armhf/libopenzwave1.3-dev_1.4.164_armhf.deb
sudo dpkg -i libopenzwave1.3_1.4.164_armhf.deb
sudo dpkg -i libopenzwave1.3-dev_1.4.164_armhf.deb
sudo dpkg -i openzwave_1.4.164_armhf.deb
#***************************************************
#********** Configuration files **********
#***************************************************
/home/pi/.node-red/flows_[MyPi].json/home/pi/.node-red/flows_[MyPi]_cred.json
måndag 15 augusti 2016
Lets Encrypt with Certbot on Raspbian Jessie
sudo nano /etc/apt/sources.list
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -
sudo certbot --apache certonly
When not working, this may work instead:
sudo certbot certonly --authenticator standalone --installer apache --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
#https://community.letsencrypt.org/t/solution-client-with-the-currently-selected-authenticator-does-not-support-any-combination-of-challenges-that-will-satisfy-the-ca/49983/15
#References
#https://letsencrypt.org/getting-started/
#https://certbot.eff.org/#debianjessie-apache
#https://backports.debian.org/Instructions/
#http://raspberrypi.stackexchange.com/questions/12258/where-is-the-archive-key-for-backports-debian-org
deb http://ftp.debian.org/debian jessie-backports main
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -
sudo a2enmod ssl
sudo apt-get updatesudo apt-get install python-certbot-apache -t jessie-backports -y
sudo certbot --apache certonly
When not working, this may work instead:
sudo certbot certonly --authenticator standalone --installer apache --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
#https://community.letsencrypt.org/t/solution-client-with-the-currently-selected-authenticator-does-not-support-any-combination-of-challenges-that-will-satisfy-the-ca/49983/15
#References
#https://letsencrypt.org/getting-started/
#https://certbot.eff.org/#debianjessie-apache
#https://backports.debian.org/Instructions/
#http://raspberrypi.stackexchange.com/questions/12258/where-is-the-archive-key-for-backports-debian-org
fredag 12 augusti 2016
Unifi on Pi
sudo apt-get update
sudo apt-get -y upgrade
#Unifi
sudo sh -c 'echo "deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti" >> /etc/apt/sources.list'
sudo apt-get -y upgrade
#Unifi
sudo sh -c 'echo "deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti" >> /etc/apt/sources.list'
sudo apt-get install -y dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
sudo apt-get update
sudo apt-get install -y unifi
#Configs:
/var/lib/unifi/
#https://help.ubnt.com/hc/en-us/articles/204952144-UniFi-How-can-I-restore-a-backup-configuration-
#Uninstall:
sudo apt-get remove --purge unifi
#http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/
#https://help.ubnt.com/hc/en-us/articles/220066768-UniFi-Debian-Ubuntu-APT-howto
#https://help.ubnt.com/hc/en-us/articles/204952144-UniFi-How-can-I-restore-a-backup-configuration-
#Reset
https://help.ubnt.com/hc/en-us/articles/205143490-UniFi-How-to-reset-the-UniFi-Access-Point-to-factory-defaults
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
sudo apt-get update
sudo apt-get install -y unifi
#Configs:
/var/lib/unifi/
#https://help.ubnt.com/hc/en-us/articles/204952144-UniFi-How-can-I-restore-a-backup-configuration-
#Uninstall:
sudo apt-get remove --purge unifi
#http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/
#https://help.ubnt.com/hc/en-us/articles/220066768-UniFi-Debian-Ubuntu-APT-howto
#https://help.ubnt.com/hc/en-us/articles/204952144-UniFi-How-can-I-restore-a-backup-configuration-
#Reset
https://help.ubnt.com/hc/en-us/articles/205143490-UniFi-How-to-reset-the-UniFi-Access-Point-to-factory-defaults
torsdag 21 april 2016
Save temperature from 1-Wire to OpenNetHome
sudo mkdir /usr/local/share/opennethome/
sudo nano /usr/local/share/opennethome/Read1-WireTemperature.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
if(@ARGV < 1){
print "Usage: [DeviceId] [optional:quiet]\n";
}else{
my $quiet = 0;
if(@ARGV > 1 && lc($ARGV[1]) eq "quiet"){
$quiet = 1;
}
my $device = $ARGV[0];
if($quiet == 0){
print "Reading device: '" . $device . "'\n";
}
#my $sensordata = `cat /sys/bus/w1/devices/$device/w1_slave 2>&1`;
my $sensordata = `less -FX /mnt/1wire/$device/temperature`;
if($quiet == 0){
print "Device read, temperature: '$sensordata'\n";
}else{
print $sensordata;
}
}
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/Read1-WireTemperature.pl
sudo nano /usr/local/share/opennethome/ReadCPUTemp.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
my $raw = `/opt/vc/bin/vcgencmd measure_temp`;
$raw =~ s/^\s+|\s+$//g;
#print "Raw: '" . $raw . "'\n";
my @result = split("=", $raw);
my @value = split("'", $result[1]);
my $final = $value[0];
print $final;
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/ReadCPUTemp.pl
#Test:
/usr/local/share/opennethome/ReadCPUTemp.pl
sudo nano /usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket;
if(@ARGV < 3){
print "Usage: [HouseCode] [DeviceCode] [Temperature] [optional:quiet]\n";
}else{
my $quiet = 0;
if(@ARGV > 3 && lc($ARGV[3]) eq "quiet"){
$quiet = 1;
}
my $houseCode = $ARGV[0];
my $deviceCode = $ARGV[1];
my $temperature = $ARGV[2];
my $k = 0.0625;
my $m = -50;
if($quiet == 0){
print "Subtract with m: " . $temperature . " - " . $m ." = " . ( $temperature - $m ) . "\n";
}
$temperature = $temperature - $m;
if($quiet == 0){
print "Divide by k: " . $temperature . " / " . $k . " = " . ( $temperature / $k ) . "\n";
}
$temperature = $temperature / $k;
my $sock = IO::Socket::INET->new(
Proto => 'udp',
PeerPort => 8005,
PeerAddr => '127.0.0.1',
) or die "Could not create socket: $!\n";
my $message = "event,UPM_Message,Direction,In,UPM.HouseCode,$houseCode,UPM.DeviceCode,$deviceCode,UPM.Primary,$temperature";
if($quiet == 0){
print "Send to server:\n";
print $message . "\n";
}
print $sock $message;
}
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl
sudo nano /usr/local/share/opennethome/SaveSensorValues.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
my $temp;
my $device;
my $houseCode;
my $deviceCode;
#CPU Temperature
$houseCode = 2;
$deviceCode = 1;
$temp = `/usr/local/share/opennethome/ReadCPUTemp.pl`;
#print "CPU Temperature: '" . $cputemp . "'\n";
`/usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl $houseCode $deviceCode $temp quiet`;
$device = "28.746FE0020000";
$houseCode = 1;
$deviceCode = 1;
$temp = `/usr/local/share/opennethome/Read1-WireTemperature.pl $device quiet`;
#print "One Wire Temperature: '" . $temp . "'\n";
`/usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl $houseCode $deviceCode $temp quiet`;
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/SaveSensorValues.pl
crontab -e
# m h dom mon dow command
*/5 * * * * /usr/local/share/opennethome/SaveSensorValues.pl
sudo nano /usr/local/share/opennethome/Read1-WireTemperature.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
if(@ARGV < 1){
print "Usage: [DeviceId] [optional:quiet]\n";
}else{
my $quiet = 0;
if(@ARGV > 1 && lc($ARGV[1]) eq "quiet"){
$quiet = 1;
}
my $device = $ARGV[0];
if($quiet == 0){
print "Reading device: '" . $device . "'\n";
}
#my $sensordata = `cat /sys/bus/w1/devices/$device/w1_slave 2>&1`;
my $sensordata = `less -FX /mnt/1wire/$device/temperature`;
if($quiet == 0){
print "Device read, temperature: '$sensordata'\n";
}else{
print $sensordata;
}
}
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/Read1-WireTemperature.pl
sudo nano /usr/local/share/opennethome/ReadCPUTemp.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
my $raw = `/opt/vc/bin/vcgencmd measure_temp`;
$raw =~ s/^\s+|\s+$//g;
#print "Raw: '" . $raw . "'\n";
my @result = split("=", $raw);
my @value = split("'", $result[1]);
my $final = $value[0];
print $final;
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/ReadCPUTemp.pl
#Test:
/usr/local/share/opennethome/ReadCPUTemp.pl
sudo nano /usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket;
if(@ARGV < 3){
print "Usage: [HouseCode] [DeviceCode] [Temperature] [optional:quiet]\n";
}else{
my $quiet = 0;
if(@ARGV > 3 && lc($ARGV[3]) eq "quiet"){
$quiet = 1;
}
my $houseCode = $ARGV[0];
my $deviceCode = $ARGV[1];
my $temperature = $ARGV[2];
my $k = 0.0625;
my $m = -50;
if($quiet == 0){
print "Subtract with m: " . $temperature . " - " . $m ." = " . ( $temperature - $m ) . "\n";
}
$temperature = $temperature - $m;
if($quiet == 0){
print "Divide by k: " . $temperature . " / " . $k . " = " . ( $temperature / $k ) . "\n";
}
$temperature = $temperature / $k;
my $sock = IO::Socket::INET->new(
Proto => 'udp',
PeerPort => 8005,
PeerAddr => '127.0.0.1',
) or die "Could not create socket: $!\n";
my $message = "event,UPM_Message,Direction,In,UPM.HouseCode,$houseCode,UPM.DeviceCode,$deviceCode,UPM.Primary,$temperature";
if($quiet == 0){
print "Send to server:\n";
print $message . "\n";
}
print $sock $message;
}
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl
sudo nano /usr/local/share/opennethome/SaveSensorValues.pl
------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
my $temp;
my $device;
my $houseCode;
my $deviceCode;
#CPU Temperature
$houseCode = 2;
$deviceCode = 1;
$temp = `/usr/local/share/opennethome/ReadCPUTemp.pl`;
#print "CPU Temperature: '" . $cputemp . "'\n";
`/usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl $houseCode $deviceCode $temp quiet`;
$device = "28.746FE0020000";
$houseCode = 1;
$deviceCode = 1;
$temp = `/usr/local/share/opennethome/Read1-WireTemperature.pl $device quiet`;
#print "One Wire Temperature: '" . $temp . "'\n";
`/usr/local/share/opennethome/SendUPMThermometerToOpennethome.pl $houseCode $deviceCode $temp quiet`;
------------------------------------------------------------
sudo chmod +x /usr/local/share/opennethome/SaveSensorValues.pl
crontab -e
# m h dom mon dow command
*/5 * * * * /usr/local/share/opennethome/SaveSensorValues.pl
onsdag 20 april 2016
ShellInABox on Raspberry Pi
#***************************************************
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install dependencies
sudo apt-get install -y git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
#Download source
git clone https://github.com/shellinabox/shellinabox.git /tmp/shellinabox
#Move to source folder
cd /tmp/shellinabox
#Build backage
dpkg-buildpackage -b
#Install package
sudo dpkg -i /tmp/shellinabox_*.deb
#Test:
#https://myip:4200/
#***************************************************
#********** Misc **********
#***************************************************
#Official site:
#https://github.com/shellinabox/shellinabox
#Config file:
/etc/default/shellinabox
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install dependencies
sudo apt-get install -y git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
#Download source
git clone https://github.com/shellinabox/shellinabox.git /tmp/shellinabox
#Move to source folder
cd /tmp/shellinabox
#Build backage
dpkg-buildpackage -b
#Install package
sudo dpkg -i /tmp/shellinabox_*.deb
#Test:
#https://myip:4200/
#***************************************************
#********** Misc **********
#***************************************************
#Official site:
#https://github.com/shellinabox/shellinabox
#Config file:
/etc/default/shellinabox
lördag 2 april 2016
OpenNetHome
#***************************************************
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install Java JDK
sudo apt-get install -y oracle-java8-jdk
#Download zipped OpenNetHome
#Latest source can be found here:
#http://opennethome.org/download/
wget http://wiki.nethome.nu/lib/exe/fetch.php/nethomeservernightly.zip -O /tmp/nethomeservernightly.zip
#Unzip OpenNetHome
unzip /tmp/nethomeservernightly.zip -d /tmp#Remove zipped OpenNetHome
sudo rm /tmp/nethomeservernightly.zip
#Add Execute access to install script
chmod +x /tmp/nethomeservernightly/install/raspbian/*.sh
#Install OpenNetHome
sudo /tmp/nethomeservernightly/install/raspbian/install.sh
#Sometimes a reboot is needed to find tellstick
sudo reboot
#Open browser
#http://MyRaspberryPi:8020/home
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
#Create folder for password file
sudo mkdir /var/www/passwd
#Generate password file, add user "myuser"
sudo htpasswd -c /var/www/passwd/proxy_opennethome.passwd myuser
sudo nano /etc/apache2/sites-available/opennethome.jockeg.se-ssl.conf
<VirtualHost *:443>
ServerName opennethome.mysite.org
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwd/proxy_opennethome.passwd
Require valid-user
</Proxy>
ProxyPass / http://mypi:8020/
ProxyPassReverse / http://mypi:8020/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/opennethome.mysite.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/opennethome.mysite.org/privkey.pem
RewriteEngine on
RewriteRule "^/$" "/home" [R]
</VirtualHost>
sudo nano /etc/apache2/sites-available/onh.mysite.org.conf
<VirtualHost *:80>
ServerName onh.mysite.org
Redirect permanent / https://opennethome.mysite.org/
</VirtualHost>
sudo nano /etc/apache2/sites-available/opennethome.mysite.org.conf
<VirtualHost *:80>
ServerName opennethome.mysite.org
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwd/proxy_opennethome.passwd
Require valid-user
</Proxy>
ProxyPass / http://mypi:8020/
</IfModule>
RewriteEngine on
RewriteRule "^/$" "/home" [R]
</VirtualHost>
#***************************************************#********** Misc **********
#***************************************************
#Official site:
http://opennethome.org/
#Upgrade nightly:
sudo nethome upgrade-nightly
Config directory:
/etc/opt/nethome
#********** INSTALL **********
#***************************************************
#Upgrade your system
sudo apt-get update && sudo apt-get upgrade -y
#Install Java JDK
sudo apt-get install -y oracle-java8-jdk
#Download zipped OpenNetHome
#Latest source can be found here:
#http://opennethome.org/download/
wget http://wiki.nethome.nu/lib/exe/fetch.php/nethomeservernightly.zip -O /tmp/nethomeservernightly.zip
#Unzip OpenNetHome
unzip /tmp/nethomeservernightly.zip -d /tmp#Remove zipped OpenNetHome
sudo rm /tmp/nethomeservernightly.zip
#Add Execute access to install script
chmod +x /tmp/nethomeservernightly/install/raspbian/*.sh
#Install OpenNetHome
sudo /tmp/nethomeservernightly/install/raspbian/install.sh
#Sometimes a reboot is needed to find tellstick
sudo reboot
#Open browser
#http://MyRaspberryPi:8020/home
#***************************************************
#********** Sample Reverse Proxy **********
#***************************************************
#Create folder for password file
sudo mkdir /var/www/passwd
#Generate password file, add user "myuser"
sudo htpasswd -c /var/www/passwd/proxy_opennethome.passwd myuser
sudo nano /etc/apache2/sites-available/opennethome.jockeg.se-ssl.conf
<VirtualHost *:443>
ServerName opennethome.mysite.org
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwd/proxy_opennethome.passwd
Require valid-user
</Proxy>
ProxyPass / http://mypi:8020/
ProxyPassReverse / http://mypi:8020/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/opennethome.mysite.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/opennethome.mysite.org/privkey.pem
RewriteEngine on
RewriteRule "^/$" "/home" [R]
</VirtualHost>
sudo nano /etc/apache2/sites-available/onh.mysite.org.conf
<VirtualHost *:80>
ServerName onh.mysite.org
Redirect permanent / https://opennethome.mysite.org/
</VirtualHost>
sudo nano /etc/apache2/sites-available/opennethome.mysite.org.conf
<VirtualHost *:80>
ServerName opennethome.mysite.org
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwd/proxy_opennethome.passwd
Require valid-user
</Proxy>
ProxyPass / http://mypi:8020/
</IfModule>
RewriteEngine on
RewriteRule "^/$" "/home" [R]
</VirtualHost>
#***************************************************#********** Misc **********
#***************************************************
#Official site:
http://opennethome.org/
#Upgrade nightly:
sudo nethome upgrade-nightly
Config directory:
/etc/opt/nethome
måndag 1 februari 2016
Kodi on Raspbian
#***************************************************
#********** INSTALL **********
#***************************************************
sudo apt-get install kodi
#***************************************************
#Set ENABLED to 1 in config file
#***************************************************
#********** Popcorn Time Plugin **********
#***************************************************
wget http://raw.githubusercontent.com/Diblo/KODI-Popcorn-Time/Repository/repository.kodipopcorntime/repository.kodipopcorntime-1.0.4.zip -O /tmp/repository.kodipopcorntime.zip
#https://seo-michael.co.uk/tutorial-how-to-install-kodi-popcorn-time-kodi/
#***************************************************
#********** Misc **********
#***************************************************
To play full HD video in Kodi, you have to set
gpu_mem=160
in /boot/config.txt (or higher)
#http://www.rieter.net/content/xot/troubleshooting/install
#https://www.raspberrypi.org/forums/viewtopic.php?t=99866
#http://forum.kodi.tv/showthread.php?tid=230035
#********** INSTALL **********
#***************************************************
sudo apt-get install kodi
#***************************************************
#********** AUTOSTART **********
#***************************************************
#Set ENABLED to 1 in config file
sudo sed -i 's/^ENABLED=.*$/ENABLED=1/g' /etc/default/kodi
#Keyboard fix:
#Option 1:
#Change startup user to Pi in config file
sudo sed -i 's/^USER=.*$/USER=pi/g' /etc/default/kodi
#Option 2:
#Give user kodi permissions?
#***************************************************
#********** Popcorn Time Plugin **********
#***************************************************
wget http://raw.githubusercontent.com/Diblo/KODI-Popcorn-Time/Repository/repository.kodipopcorntime/repository.kodipopcorntime-1.0.4.zip -O /tmp/repository.kodipopcorntime.zip
#https://seo-michael.co.uk/tutorial-how-to-install-kodi-popcorn-time-kodi/
#********** Misc **********
#***************************************************
To play full HD video in Kodi, you have to set
gpu_mem=160
in /boot/config.txt (or higher)
#http://www.rieter.net/content/xot/troubleshooting/install
#https://www.raspberrypi.org/forums/viewtopic.php?t=99866
#http://forum.kodi.tv/showthread.php?tid=230035
Prenumerera på:
Inlägg (Atom)