Diana HomeLab

  • Home
  • Diana HomeLab

Diana HomeLab Selfhosting the Universe

Setup your own Mysterium Node VPN in Linode Cloud for FREESetup your own Mysterium Node VPN in Linode Cloud and start ea...
29/03/2023

Setup your own Mysterium Node VPN in Linode Cloud for FREE
Setup your own Mysterium Node VPN in Linode Cloud and start earning MYST Tokens
By: Milind Patel

Setup your own Mysterium Node VPN in Linode Cloud and start earning MYST Tokens

Setup your own   Node   in     for FREE and start earning MYST TokensBy: Milind Patel
15/02/2022

Setup your own Node in for FREE and start earning MYST Tokens
By: Milind Patel

Setup your own Mysterium Node VPN in Linode Cloud and start earning MYST Tokens

16/12/2021
Setup   in   to   & manage your    How to install, set up & configure Radarr in Docker to automate & manage your Plex Mo...
26/11/2021

Setup in to & manage your
How to install, set up & configure Radarr in Docker to automate & manage your Plex Movies.
By: Milind Patel

How to install, set up & configure Radarr in Docker to automate & manage your Plex Movies.

Install / Migrate   from Bare-Metal   to  How to install plex in docker or migrate plex from bare-metal ubuntu to docker...
18/11/2021

Install / Migrate from Bare-Metal to
How to install plex in docker or migrate plex from bare-metal ubuntu to docker.
By: Milind Patel

How to install plex in docker or migrate plex from bare-metal ubuntu to docker.

Setting up Portainer for managing Docker containersA guide explaining how to set up Portainer for managing docker contai...
04/11/2021

Setting up Portainer for managing Docker containers
A guide explaining how to set up Portainer for managing docker containers on Linux.
By: Milind Patel

A guide explaining how to set up Portainer for managing docker containers on Linux.

02/11/2021
I found this really cool script that allows you to disable all the ways to letusers open developer tools windows on your...
02/11/2021

I found this really cool script that allows you to disable all the ways to let
users open developer tools windows on your website.
One additional step in hardening security across your website.

Here's a little video showing its operation

> Disable browser developer tools [https://imgur.com/a/BEX9tmY]
This script can disable all the methods that can enter the developer tools to
prevent ‘code handling’ through the developer tools.

Some of its features,

1. Support configurable whether to disable the right-click menu
2. Disable f12 and ctrl+shift+i shortcuts
3. Support recognition to open the developer tools from the browser menu bar
and close the current page
4. Developers can bypass the disablement (use tk and md5 encryption for URL
parameters)
5. Multiple monitoring modes, support almost all browsers (IE, 360, qq browser,
Firefox, Chrome, Edge...)
6. Highly configurable
7. Minimal use, small size (only 7kb)
8. Support npm reference and script tag reference (attribute configuration)
9. Identify the real mobile terminal and browser developer tool settings
plug-in forged mobile terminal, saving performance for the mobile terminal

I'm gonna explain the steps to use it in your ghost blog. But it's pretty
straightforward for any website.

Just include this script in the footer (recommended by the developer) of your
website.



Attributes
1. disable-devtool-auto: this is what enables the script.
2. md5: you can generate an md5 value for a string and pass that string in your
website URL to also disable the script. Default is disabled. Refer to the
bypass disable section below.
3. url: the browser will be redirected to this URL in case the developer tools
window is opened somehow. Default is localhost.
4. tk-name: the variable to pass your string into in the URL to disable the
script. Default is ddtk. Refer to the bypass disable section below.
5. interval: Timer interval. Default is 200ms.
6. disable-menu: specify whether to disable the right-click menu or not.
Default is true.
7. nonce: added by me for content security policy. Just for security.

Bypass disable
The combination of key and md5 in the library allows developers to bypass the
disabling online.

The process is as follows:

First, specify a key string (the value should not be recorded in the code), use
md5 encryption to obtain an md5 value for that string, and pass that string as a
parameter. Developers only need to bring the URL parameter ddtk=string when
accessing the URL. Bypass disabled.

Example:

* Suppose your website is https://www.example.com
* The string that you choose: highlysecurepassword
* Go here [https://www.md5online.org/md5-encrypt.html], and get your md5 key
from that string.
* Specify the md5 value in your script tag.
* Now whenever you want to bypass this script, you would go to
https://www.example.com?ddtk=highlysecurepassword

Issues

So far, I only experienced one issue in particular.

If your website is loaded inside an iframe, then this script thinks the
Developer tools window is open somehow and automatically redirects you to a
block-page URL.

My workaround for this:

I have created a short snippet script that detects if your website is in an
iframe and disables this script.
This is not ideal, but until the developer fixes this issue, you can use this as
a workaround.
I have already raised an issue on the developer's GitHub repository here
[https://github.com/theajack/disable-devtool] regarding this.



function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
window.onload = function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'disable-devtool@latest/disable-devtool.min.js';" rel="ugc" target="_blank">https://cdn.jsdelivr.net/npm/disable-devtool@latest/disable-devtool.min.js';
if(!inIframe()){
s.setAttribute('disable-devtool-auto','');
s.setAttribute('url','https://google.com');
}
s.setAttribute('nonce','');
try {
document.body.appendChild(s);
} catch (e) {
document.body.appendChild(s);
}
}


Credits
All credits for the above script go to its original developer here
[https://github.com/theajack/disable-devtool].

Go ahead and give him some stars if you liked this.

Disable Developer tools in any browser including F12, Ctrl+Shift+I shortcut, and right-click.

This project helps you to get better details on your investments on BitBns[https://bitbns.com/trade/ #/] by using their ...
01/11/2021

This project helps you to get better details on your investments on BitBns
[https://bitbns.com/trade/ #/] by using their report
[https://bitbns.com/trade/ #/profile/trade-report] and coin prices from coingecko
[https://www.coingecko.com/en] using their APIs
[https://www.coingecko.com/en/api].

Supported coins
* ETH
* BTC
* QKC
* DOGE
* SHIB
* SAFEMOON
* XRP

For Docker guide, refer to docker setup at the bottom.

Pre-Requisites
1. First, go ahead and grab your Bitbns reports from their website here
[https://bitbns.com/trade/ #/profile/trade-report].
2. Now, you are gonna need NPM
[https://docs.npmjs.com/downloading-and-installing-node-js-and-npm]
installed. It's pretty straightforward, just follow their documentation for
your specific operating system.

Setup
1. Clone the following GitHub repository
[https://github.com/AmitRohan/bitbns-report-analyzer].
2. Rename your Bitbns Report [https://bitbns.com/trade/ #/profile/trade-report]
as REPORT.CSV and place it in the reports folder.
3. Install Project Dependencies by running npm install in your root folder of
the project.

Usage
Run the project using npm start and give input based on the menu.

Docker guide
For docker, things are pretty straightforward.
Save your REPORT.csv in a location and mount it to /reports inside the container
and run it.

docker run -it --rm -v /home/user/bitbns/report:/reports ghcr.io/amitrohan/bitbns-report-analyzer:main

Replace /home/user/bitbns/reports with the directory where you saved your
REPORT.csv

For Docker compose,

---
version: "2.1"
services:
bitbns-report-analyzer:
stdin_open: true # docker run -i
tty: true # docker run -t
image: ghcr.io/amitrohan/bitbns-report-analyzer:main
container_name: bitbnsreport
volumes:
- /home/user/bitbns/report:/reports
restart: "no"

If you liked this project, go ahead and give it some stars here
[https://github.com/AmitRohan/bitbns-report-analyzer].

This project helps you to get better details on your investments on BitBns by using their report and coin prices from coingecko using their APIs.

Ok, so, this is gonna be short and simple...for the most part .😅We will be setting up Docker Engine on Ubuntu 20.04 as a...
30/10/2021

Ok, so, this is gonna be short and simple...for the most part .😅
We will be setting up Docker Engine on Ubuntu 20.04 as a systemd service.

First, Older versions of Docker were called docker, docker.io, or docker-engine
If you have any of those installed, first remove them.

sudo apt-get remove docker docker-engine docker.io containerd runc

The contents of /var/lib/docker/, including images, containers, volumes, and
networks, will be preserved from your previous installation.
If you want a clean start, do this

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

WARNING, this will remove your docker volumes, images, and dataSetup Repository
1. Update apt and required packages

sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release

2. Add Docker's official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

3. Setup Docker's stable repository

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Since we installed via the apt package manager, updating is as simple as

sudo apt-get update

Now, Docker is installed and set up as a systemd service named docker.service,
and its service file is stored in /lib/systemd/system/docker.service
You can check its status with

sudo systemctl status docker

You can verify by running a test container,

docker run hello-world

This will print a test message then exit.

You can also start, stop, restart, disable or enable docker daemon by running

sudo systemctl start docker
sudo systemctl stop docker
sudo systemctl restart docker
sudo systemctl disable docker
sudo systemctl enable docker

To list running container

docker container ls

To list all containers (start and stopped)

docker container ls -a

To create or create and run a container

docker create --name containername imageurl
docker run --name containername imageurl

Refer to here for more detailed instructions
https://docs.docker.com/engine/reference/commandline/create/

To pull a new docker image

docker pull imageurl

To start, stop, or restart a container

docker start containername
docker stop containername
docker restart containername

To update a container

docker stop containername
docker rm containername
docker pull imageurl
docker run --name containername imageurl

Remember to use the same run/create command you used previously to run/create
the container. It's handy to keep all your docker run commands in a text file
somewhere.

Docker daemon also has a neat feature of restarting docker daemon without
stopping any of your containers, in case you want to update docker daemon or
something.

Edit your /etc/docker/daemon.json file

sudo nano /etc/docker/daemon.json

and add this

{
"live-restore": true
}

then press ctrl+x then Y and Enter to save.

Restart Policies
Docker has something called restart policies to manage the automatic start and
stop of your container. Following restart policies are available,

1. no : Do not automatically restart the container. (the default)
2. on-failure : Restart the container if it exits due to an error, which
manifests as a non-zero exit code.
3. always : Always restart the container if it stops. If it is manually
stopped, it is restarted only when Docker daemon restarts or the container
itself is manually restarted. (See the second bullet listed in restart
policy details)
4. unless-stopped : Similar to always, except that when the container is
stopped (manually or otherwise), it is not restarted even after Docker
daemon restarts.

You can set any of them via the --restart flag while creating a container.

Managing Docker Containers via Systemd

Although it is recommended to use restart policies to manage containers, I'm
gonna show you how to manage them via systemd service of your host ubuntu.
Suppose you want to start or stop containers based on some system events, like
after you have successfully run a system check on boot, or after you have your
external storage device plugged in and ready to be mounted inside your
containers.

Remember, if you want to manage docker containers via systemd, put --restart no
flag in your container.

Simply, create a containername.service file in /etc/systemd/system directory,
and add the following

[Unit]
Description=Docker Conatiner name
After=network-online.target docker.service
Requires=docker.service
StartLimitIntervalSec=10
StartLimitBurst=5

[Service]
Type=simple
ExecStart=/usr/bin/docker start -a containername
ExecStop=/usr/bin/docker stop containername
Restart=always
RestartSec=10s

[Install]
WantedBy=docker.service

Then reload systemctl, start and enable your service

sudo systemctl daemon-reload
sudo systemctl start containername
sudo systemctl enable coontainername

This will start your container after you have network connectivity and your
docker daemon is ready. Also, in case your container stops due to some reason,
it will automatically restart them, and keep restarting (you can remove
Restart=always to disable that) at a 10 seconds interval (you can adjust it with
RestartSec=10s value) whenever it stops.

The After= specifies the service after which this service will run.
The Requires= specifies the dependant service, without which this service won't
start. (it's more or less the same as after but both are required in this case)
The WantedBy= puts your service in the specifiedservice.service.wants folder. So
basically, whenever the specified service runs, this service will be started
too.

If you want your container service to start only and only after your foo.service
has started, you would put only foo.service in all three after, requires, and
wantedby.

To view container status via systemd

sudo systemctl status containername

To view full logs via systemd

sudo journalctl -f -u containername

or via docker daemon

docker logs containername

Refer to systemd man page for more info.
https://www.freedesktop.org/software/systemd/man/systemd.unit.html

Uninstall Docker Engine
Like most things in life, removing is as simple as

1. Remove packages

sudo apt-get purge docker-ce docker-ce-cli containerd.io

2. Remove images, containers & volumes

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

WARNING, this will remove your docker volumes, images, and dataWasn't that quick
🤣

Installing docker engine on ubuntu 20.04 and managing containers via systemd

Firstly, let me welcome you along in my journey of creating a perfectself-hosted home lab server which will most definit...
29/10/2021

Firstly, let me welcome you along in my journey of creating a perfect
self-hosted home lab server which will most definitely be always evolving.

I try to find popular open-source alternatives to services that I use or that
might benefit my daily life in some way and host them myself.

Now, back to your question, Diana was it?

Honestly, no real reason...just a cool name for a hot secretary that some of you
might have, not me though, that I got from Hitman, the game, agent 47, ring any
bells...if not, then I'm afraid this blog might not be for you.

JK :P

--------------------------------------------------------------------------------

So, I'll be posting short & simple guides to self-hosting the services that I
have learned the hard way, so you won't have to.

Do note, I am not an expert at any of this stuff. There will most probably be
more experienced people than me out there who have suggestions to do things in a
better way. And I am inviting those people to join my lab, and educate us too.

Although I hate the idea of subscriptions, I have still added a paid option to
subscribe to my blog if you wanna show some support. But for the most part, most
of my guides will be free.

--------------------------------------------------------------------------------

My current lab setup
Definitely won't win any awards in the hardware department.

An old HP Laptop Probook 4440s
CPU - Intel Core i5-3230m
Ram - 8GB
HDD - 512GB OS drive + 5TB Seagate external for media storage

Network setup
Fiber 300 Mbps Up/300 Mbps Down connection
DNS - Cloudflare
Focus on privacy & security - A+: SSL Labs
[https://www.ssllabs.com/ssltest/analyze.html?d=lab.diananas.online] A+:
Security Headers
[https://securityheaders.com/?q=lab.diananas.online&followRedirects=on]

Service I'm running
Everything in docker containers on Ubuntu 20.04 managed via portainer
Also, all the docker containers are managed via systemd and not restart
policies.

> 1. Ghost Blog
2. Ghost MySQL DB
3. Plex
4. Stash
5. XBVR
6. Radarr
7. Radarr for dolby vision
8. Radarr4k
9. Sonarr
10. Sonarr for dolby vision
11. Sonarr4k
12. Bazarr
13. Bazarr for dolby vision
14. Bazarr4k
15. Tdarr
17. Overseerr (modified to remove plex login)
18. Requestrr
19. Tautulli
20. Qbittorrent
21. Transmission
22. Jackett
23. Organizr
24. Jdownloader
25. Jdownloader api for ogranizr
26. Uptime Kuma
27. Healthchecks
28. Portainer
29. Webmin (bare metal)
30. Pulseway (for remote management)
Contact
Email me at [email protected]
Twitter [https://twitter.com/dianahomelab]
Facebook [https://www.facebook.com/dianahomelab]

Uptime Stats
Monitored by Uptime Kuma [https://uptimekuma.diananas.online]
See for yourself

Firstly, let me welcome you along in my journey of creating a perfect self-hosted home lab server which will most definitely be always evolving. I try to find popular open-source alternatives to services that I use or that might benefit my daily life in some way and host them myself.

Address


Alerts

Be the first to know and let us send you an email when Diana HomeLab posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to Diana HomeLab:

Shortcuts

  • Address
  • Alerts
  • Contact The Business
  • Claim ownership or report listing
  • Want your business to be the top-listed Media Company?

Share