raspberry pi – systemd unit cannot write to tty1

I am trying to write to /dev/tty1 from a program running using systemd. It initially writes when loaded but even after putting it at the end I am unable to make it work. The process is running but not writing to /dev/tty1. There are no errors.

It works if I restart it after logging in with ssh.
It doesn’t work restarting from rc.local or putting it in crontab with @reboot. Setting StandardInput also has no effect.

[Unit]
Description=ConsoleWarning
After=mosquitto.service getty@tty1.service systemd-user-sessions.service multi-user.target
Requires=mosquitto.service getty@tty1.service systemd-user-sessions.service multi-user.target

[Service]
User=root
StandardOutput=tty
TTYPath=/dev/tty1
ExecStart=/usr/bin/mosquitto_sub -h 127.0.0.1 -t warning
Restart=always


[Install]
WantedBy=multi-user.target

wallet – Is it secure to generate a new address using SBC such as raspberry pi? any problem with TRNG?

I am trying to create a cold wallet using SBC such as raspberry pi (not raspberry pi).

I wonder if the random generator is secure enough to generate random wallet address, for both BTC and ETH.

I heard there were fatal flaw in Android random number generator before. Is it possible that SBC can have the same issue?

raspberry pi – Reverse proxy for home network

I have a raspberrypi installed with a bunch of applications like transmission, jellyfin, grafana and pihole and I want to be able to access them from my laptop as well as vpn network using locations instead of specifying ports.

I’ve set up the reverse proxy configuration but it doesn’t seem to be redirecting correctly in some cases, especially grafana.

upstream speedtest {
server 127.0.0.1:3000;
}

server {

listen 80 default_server;
server_name raspberrypi.local;



location /speedtest/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_pass http://speedtest/goto/9lT5wrkRz;
#proxy_pass http://speedtest/grafana/d/kawPe8zRz/internetspeeed?orgId=1&theme=dark;
}

This seems to work but only because it actually redirects to the url containing raspberrypi.local:3000 which works great on the home network but not on the vpn. Also, if I uncomment the complete url, it doesn’t redirect properly and shows me the If you’re seeing this Grafana has failed to load its application files error page.

Any help would be much appreciated.

Thanks,
Karan

java – Problemas para Instalar o Java6 ou Java7 na Raspberry PI (Linux)

Olá. Estou usando o ScadaBR/LTS e preciso instalar o Java 6 ou Java 7 na Raspberry PI.

Antigamente era só baixar o java6 para arm no site da Oracle e instalar manualmente descompactando o tar.gz da oracle, depois rodando o update-alternative.

Contudo qualquer distro para Raspberry PI hoje, quando se da o uname -m na Raspberry PI 3B obtenho a arquitetura arm64 e ao tentar baixar o java6 ele falha dizendo que o java não pode ser executado ou não encontrado.

Pesquisei por dias e cheguei a uma lib do Java que ela não pode ser carregada na Raspberry PI. Não sei mais como resolver, pois nos repositórios só acho o java acima da versão 8.

Infelizmente o ScadaBR não funciona a contento usando o Java8 ou versões superiores. Sempre aparece um bug aqui ou acolá que faz o ScadaBR dar erro 404 ou coisas mais bizarras complicadas de diagnosticar.

Existe como rodar o java 6 (Preferível) ou o Java 7 no Ubuntu 20/21, Raspbian outro Linux atual?

linux – How to solve “OpenVPN: Connection refused” on Raspberry Pi?

I have used openvpn-install to install OpenVPN on my Raspberry Pi. The installation and config process worked without any problem: The server should run on TCP port 1195.

When trying to connect to the Server over the internet (IPv6 connection) I get a Connection refused error:

...
2021-05-03 12:02:17.730046 MANAGEMENT: CMD 'hold release'
2021-05-03 12:02:17.730820 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
2021-05-03 12:02:17.730840 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
2021-05-03 12:02:17.730848 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
2021-05-03 12:02:17.730856 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
2021-05-03 12:02:17.730922 MANAGEMENT: >STATE:1620036137,RESOLVE,,,,,,
2021-05-03 12:02:17.761583 TCP/UDP: Preserving recently used remote address: (AF_INET6)8af6:1090:41be:2800:af16:abff:fe56:9b13:1195
2021-05-03 12:02:17.761683 Socket Buffers: R=(131072->131072) S=(131072->131072)
2021-05-03 12:02:17.761710 Attempting to establish TCP connection with (AF_INET6)8af6:1090:41be:2800:af16:abff:fe56:9b13:1195 (nonblock)
2021-05-03 12:02:17.761732 MANAGEMENT: >STATE:1620036137,TCP_CONNECT,,,,,,
2021-05-03 12:02:18.762081 TCP: connect to (AF_INET6)8af6:1090:41be:2800:af16:abff:fe56:9b13:1195 failed: Connection refused

A ping6 to the Pi is no problem. The local router (FritzBox) forwards TCP port 1195 to the pi. Other services on the Pi (e.g. HTTP) can be used without any problem.

How can I solve this?


Observations

nmap on the Pi itself shows, that port 1195 is closed:

$ nmap localhost
Starting Nmap 7.70 ( https://nmap.org ) at 2021-05-03 11:20 BST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0015s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 997 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
53/tcp open  domain
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 0.66 seconds

However, running a portscan on a Mac in the same network, shows that 1195 is open:

Port Scanning host: 192.168.5.5

     Open TCP Port:     22          ssh
     Open TCP Port:     53          domain
     Open TCP Port:     80          http
     Open TCP Port:     1195        rsf-1

Using netcat on this port from the same Mac computer is also no problem:

nc -vz 192.168.5.5 1195
Connection to 192.168.5.5 port 1195 (tcp/rsf-1) succeeded!

Testing if OpenVPN service is running on the Pi shows that it is active (exited):

$ sudo service openvpn status
● openvpn.service - OpenVPN service
   Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2021-05-03 09:22:54 BST; 2h 4min ago
  Process: 492 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 492 (code=exited, status=0/SUCCESS)

May 03 09:22:54 kkpi systemd(1): Starting OpenVPN service...
May 03 09:22:54 kkpi systemd(1): Started OpenVPN service.

So, is it active or did it exit??

I found the info not to check for service openvpn but for openvpn@NAME where NAME is the name of the configuration file in /etc/openvpn/. However, there is no *.conf file in /etc/openvpn/:

$ cd /etc/openvpn/
$ ls -la
    total 20
    drwxr-xr-x  4 root root 4096 Apr 30 11:38 .
    drwxr-xr-x 89 root root 4096 May  3 10:26 ..
    drwxr-xr-x  2 root root 4096 Feb 20  2019 client
    drwxr-xr-x  3 root root 4096 May  3 10:48 server
    -rwxr-xr-x  1 root root 1468 Feb 20  2019 update-resolv-conf
$ cd client
$ ls -la
    total 8
    drwxr-xr-x 2 root root 4096 Feb 20  2019 .
    drwxr-xr-x 4 root root 4096 Apr 30 11:38 ..
$ cd ../server/
$ ls -la
    total 52
    drwxr-xr-x 3 root   root    4096 May  3 10:48 .
    drwxr-xr-x 4 root   root    4096 Apr 30 11:38 ..
    -rw------- 1 root   root    1192 Apr 30 11:38 ca.crt
    -rw------- 1 root   root    1679 Apr 30 11:38 ca.key
    -rw-r--r-- 1 root   root     224 Apr 30 11:38 client-common.txt
    -rw------- 1 nobody nogroup  690 Apr 30 11:47 crl.pem
    -rw-r--r-- 1 root   root     424 Apr 30 11:38 dh.pem
    drwxr-xr-x 5 root   root    4096 Apr 30 11:38 easy-rsa
    -rw------- 1 root   root       0 May  3 11:33 ipp.txt
    -rw-r--r-- 1 root   root     436 Apr 30 11:38 server.conf
    -rw------- 1 root   root    4594 Apr 30 11:38 server.crt
    -rw------- 1 root   root    1704 Apr 30 11:38 server.key
    -rw------- 1 root   root     636 Apr 30 11:38 tc.key

mining theory – How to install the latest bfgminer binaries directly from terminal without ‘aptitude’ on a raspberry pi 4 8gb running raspbian?

months ago I found an entry on StackExchange or somewhere else on how to install the latest (!) bfgminer binaries directly from terminal. I can not find the stackexchange post, no matter how deep I search here / on Google.

I do not remember if it was a download directly from luke-jr’s website via terminal or from somewhere else. I only remember that it was done via the terminal and it created an executeable shortcut in the /bin/ and/or /usr/bin/ folder.

Visiting the website from luke-jr triggers my anti virus software telling me the website is infected or hosts infected files. So I can’t visit it directly sadly.

Months ago I tried it out on my old RPi and it worked just fine. But now that I had to switch to a newer RPi I can not find or remember the correct terminal command for installing bfgminer binaries directly.

More details about why I need the binaries:
Compiling prints out LOTS of errors for me.
Using ‘sudo aptitude install bfgminer’ needs “aptitude” installed, so I tried to install it and it returned lots of errors, most of the package files where not downloadable (my Internet connection is fine by the way).

Can you help me out with a terminal command that let’s me successfully install bfgminer on raspbian?
On my old Pi I managed to install it without aptitude and without compiling it first.

Thanks so far!