Go to advanced search

by swampdog
Thu Nov 21, 2019 5:59 pm
Forum: C/C++
Topic: [solved] access dynamic multidimensional arrays like static arrays
Replies: 24
Views: 1182

Re: access dynamic multidimensional arrays like static arrays

You can muck about but this is the area where it is extremely easy to corrupt memory.. #include <stdio.h> #include <stdlib.h> #include <string.h> #define X 10 #define Y 5 typedef struct { double a[X][Y]; } FOO; static void dump(double a[X][Y]) {size_t x,y; for(x=0;x<X;x++) { for(y=0;y<Y;y++) printf(...
by swampdog
Fri Nov 15, 2019 9:20 pm
Forum: Advanced users
Topic: SSH with RSA keys for MPI cluster
Replies: 4
Views: 280

Re: SSH with RSA keys for MPI cluster

You probably need to elaborate. Note though, it is possible to use the same set of keys all over the place. Typically this is one of those "d'Oh!" moments when someone clones and ships a preconfigured machine and *hasn't* cleared the keys but can be used to good effect if thought out.
by swampdog
Fri Nov 15, 2019 9:02 pm
Forum: Troubleshooting
Topic: RAID5: Remove all drives prevents boot
Replies: 6
Views: 308

Re: RAID5: Remove all drives prevents boot

As a side-issue, with large disks in enterprise environments, raid5 has a habit of dropping dead during the rebuild. What happens is all the disks are inserted into the SAN (storage area network, aka NAS) on day one. Much time later one fails. By that time all the disks are about to fail: the resync...
by swampdog
Fri Nov 08, 2019 7:29 pm
Forum: Raspbian
Topic: Raspbian cross toolchain
Replies: 8
Views: 940

Re: Raspbian cross toolchain

It really isn't worth it (cross compiling). Certainly now. Once the final product is ready, build it natively on an rpi or just get an rpi4 with an approved psu and a fan and develop it natively. If your project needs rpi features then you'll need to be developing some of it natively and if your pro...
by swampdog
Fri Nov 08, 2019 6:36 pm
Forum: Troubleshooting
Topic: rsync to/from remote server - no password
Replies: 19
Views: 1480

Re: rsync to/from remote server - no password

There's three potential hurdles. (a) ensure the source "src" box can 'ssh' into the destination "dst" box without a password. (b) unix file permissions. (c) keeping it simple but with a mind to security. Take user "foo" on "src" wants to copy root files to "dst".. foo@src $ sudo id ^^^if that works ...
by swampdog
Mon Oct 28, 2019 12:23 am
Forum: Advanced users
Topic: Moving file system to NFS share - not working - nfs server not responding
Replies: 14
Views: 1906

Re: Moving file system to NFS share - not working - nfs server not responding

I missed this thread originally. On the off-chance it might help narrowing it down.. admin@pi05:~ $ cat /boot/cmdline.txt dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/nfs smsc95xx.turbo_mode=N nfsroot=192.168.1.20:/mnt/nfsd/pi05,tcp,vers=3 ip=::::pi05.swampdog::dhcp rootfstype=...
by swampdog
Sun Oct 27, 2019 11:45 pm
Forum: Beginners
Topic: Maria DB: Installation of system tables failed!
Replies: 14
Views: 897

Re: Maria DB: Installation of system tables failed!

I built mariadb 5.5.56 for an rpi3 from source a couple of years ago. It still fires up.. admin@pi05:~/usr/src/mariadb $ sudo ./svr-mysql start admin@pi05:~/usr/src/mariadb $ ps -ef | grep mysql root 30210 1 0 23:07 pts/0 00:00:00 /bin/sh /usr/local/MARIADB/5556/bin/mysqld_safe --no-defaults --user=...
by swampdog
Sun Oct 27, 2019 8:28 pm
Forum: C/C++
Topic: Unable to find libpng and harfbuzz when compiling SDL2 TTF Library
Replies: 2
Views: 3000

Re: Unable to find libpng and harfbuzz when compiling SDL2 TTF Library

I'm going from memory here (years ago back when I built SDL under cygwin). I think SDL uses 'pkg-config' so try asking it what linker flags are required (eg: pkg-config --libs libpng16) then fudge those flags into your makefile (LDFLAGS?). If there was a 'configure' script then the bug is there beca...
by swampdog
Sat Oct 19, 2019 11:33 pm
Forum: C/C++
Topic: cc: error trying to exec '/usr/lib/gcc/arm-linux-gnueabihf/8/cc1'
Replies: 2
Views: 1387

Re: cc: error trying to exec '/usr/lib/gcc/arm-linux-gnueabihf/8/cc1'

$ sudo apt-get install apt-file $ apt-file update $ apt-file search /usr/lib/gcc/arm-linux-gnueabihf/8/cc1 Results likely to be.. cpp-8: /usr/lib/gcc/arm-linux-gnueabihf/8/cc1 g++-8: /usr/lib/gcc/arm-linux-gnueabihf/8/cc1plus gdc-8: /usr/lib/gcc/arm-linux-gnueabihf/8/cc1d gobjc++-8: /usr/lib/gcc/ar...
by swampdog
Fri Oct 11, 2019 11:29 pm
Forum: C/C++
Topic: copy protect an application
Replies: 3
Views: 1118

Re: protect an application

If your Pi always has access to a network then you could implement something reasonably secure. It will never be foolproof though. The only way to do that is manually type in the password to decrypt (eg: like "tails" on a usb stick) the filesystem. Mac address can be spoofed of course. That aside, t...
by swampdog
Fri Sep 27, 2019 9:16 pm
Forum: Networking and servers
Topic: Slow samba server
Replies: 10
Views: 523

Re: Slow samba server

It took about 7.5 minutes to 'scp' a 1G file of urandom data to my rpi zeroW, approx 2.3MB/s according to 'scp' - from a linux box on the same subnet. About 9.5 minutes to copy it back, 1.8MB/s. The rpiZW was 100% cpu unsurprisingly. Try similar yourself and see what results you get. I tend to use '...
by swampdog
Fri Sep 27, 2019 7:54 pm
Forum: Networking and servers
Topic: Using OpenVPN to transfer files between Pi 3 and Pi 4
Replies: 5
Views: 337

Re: Using OpenVPN to transfer files between Pi 3 and Pi 4

Have you got this.. +------+ | rpi3 |--\ +------+ \ +-------+ -| phone |-->internet +------+ / +-------+ | rpi4 |--/ +------+ ..with both rpi's physically near each other? If so, you could make use of the ethernet ports and either use a switch.. +------+ | rpi3 |--\ +------+ \ | \ +--------+ \ +----...
by swampdog
Fri Sep 27, 2019 6:48 pm
Forum: General discussion
Topic: Routing from one network to another
Replies: 23
Views: 1951

Re: Routing from one network to another

You've mentioned wg0 is on 10.0.0.3. Your internal network is on 192.168.1.0 which means wg0 has nowhere to go. I'm assuming wlan0 is bridged to wg0 ('brctl show')? so sidestep that problem by assigning a 192.168.1.x address to wg0 instead of 10.0.0.3 (if they're on the same subnet no routing requi...
by swampdog
Fri Sep 27, 2019 9:33 am
Forum: General discussion
Topic: Routing from one network to another
Replies: 23
Views: 1951

Re: Routing from one network to another

You don't need the bridge for forwarding. Here's the essential part of my rpi filewall, eth0 is my ISP, eth1 is my internal network. admin@pi00 ~ $ sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 1 admin@pi00 ~ $ cat /usr/local/sd/etc/svr-fw.dat | grep eth -A POSTROUTING -o eth0 -j MASQUERADE -A IN...
by swampdog
Wed Sep 25, 2019 9:23 pm
Forum: General discussion
Topic: Routing from one network to another
Replies: 23
Views: 1951

Re: Routing from one network to another

I don't know if this contributes or not as I've only yesterday got my rpi4 working as an access point and is very much a work in progress. In my case it will be a "laptop" so ordinarily will use dhcp on eth0 & wlan0 but when at home may as well serve as an AP. I nearly pulled my hair out with dhcpcd...
by swampdog
Mon Sep 23, 2019 5:40 am
Forum: Beginners
Topic: Help please I just can’t seem to mount my NAS to record onto.
Replies: 2
Views: 139

Re: Help please I just can’t seem to mount my NAS to record onto.

One of my NAS is quite ancient. I happen to mount it manually (rather than /etc/fstab) on my main linux box. Copied the ".smbcred" file from it to a buster rpi4 and liberated one of the cifs mount commands out of a script. $ cd;ls -ln .smbcred && cat .smbcred | sed -e 's/=.*/=blah/' -rw------- 1 100...
by swampdog
Mon Sep 23, 2019 4:30 am
Forum: General discussion
Topic: Samba Question
Replies: 2
Views: 196

Re: Samba Question

You could set up a second samba server. You mentioned in a previous post though.. Lets say I am trying to collect Temp and altitude data on Pi 1 and transmit it to Pi 2 for the storage or backup ..so a second samba server doesn't sound like the way to go unless the PC has to be involved(*). It sound...
by swampdog
Sat Sep 07, 2019 11:24 am
Forum: General discussion
Topic: Dual redundancy raspberry PI
Replies: 14
Views: 1018

Re: Dual redundancy raspberry PI

I have an rpi zero which monitors a power clamp on our fuse box. It's failed for the third time. Kudos to the guy who wrote the code but I knew it would go belly up but have been constantly too lazy to do anything about it. The code writes to a sqlite database which wears out the cards. I should hav...
by swampdog
Sat Sep 07, 2019 2:32 am
Forum: C/C++
Topic: Looking for advice with C++ learning
Replies: 29
Views: 6955

Re: Looking for advice with C++ learning

Really (really) terse example.. #include <iostream> using std::cout; typedef unsigned char TINYINT; typedef unsigned int BIGGERINT; struct foo { TINYINT a; foo(TINYINT b) : a(b){} foo operator+(foo & b) {TINYINT r(a+b.a); BIGGERINT aa(a+b.a); if (aa!=r) cout<<"oops\n"; return r; } }; int main() {foo...
by swampdog
Sat Sep 07, 2019 1:53 am
Forum: Troubleshooting
Topic: Pi 4, rootfs on SSD goes readonly
Replies: 19
Views: 1693

Re: Pi 4, rootfs on SSD goes readonly

Hi Folks, Another update. Put this https://www.amazon.co.uk/gp/product/B077SF8KMG/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1 into this https://www.amazon.co.uk/gp/product/B01K7I7UGQ/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1 and no data corruption so far. For cooling I tried this https:/...
by swampdog
Wed Aug 28, 2019 9:04 pm
Forum: Beginners
Topic: I cannot SSH my pi anymore
Replies: 20
Views: 1362

Re: I cannot SSH my pi anymore

dpkg: warning: files list file for package 'node-brace-expansion' missing; assuming package has no files currently installed [snip] ^^^corruption. Your best bet at this point is to attempt to rescue what work you can. This will make it far worse unless you can guarantee your sdcard is 100% ok.. htt...
by swampdog
Wed Aug 28, 2019 6:39 pm
Forum: Beginners
Topic: I cannot SSH my pi anymore
Replies: 20
Views: 1362

Re: I cannot SSH my pi anymore

privsep_preauth: preauth child terminated by signal 11 Hmm. This is a guess based on some googling. Assuming you're happy your sdcard is okay then.. $ sudo apt-get update $ sudo apt-get upgrade ..(because the last update may be incomplete) making sure there's no warnings/errors. If there are warnin...
by swampdog
Wed Aug 28, 2019 5:25 pm
Forum: Beginners
Topic: I cannot SSH my pi anymore
Replies: 20
Views: 1362

Re: I cannot SSH my pi anymore

pi@RPiPerpignan:~ $ sudo /usr/sbin/sshd -d [sudo] password for pi: debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2l 25 May 2017 debug1: private host key #0: ssh-rsa S debug1: private host key #1: ecdsa-sha2g debug1: private host key #2: ssh-ed25U debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec...
by swampdog
Wed Aug 28, 2019 5:03 pm
Forum: Beginners
Topic: I cannot SSH my pi anymore
Replies: 20
Views: 1362

Re: I cannot SSH my pi anymore

How can I add file ? it always throughs me " Error Invalid file extension: syslog" Ah. This is going to be tricky! I meant for you to search in "/var/log/syslog" for any errors. admin@pi05:~ $ sudo egrep -i ssh /var/log/syslog Aug 28 16:44:29 pi05 systemd[1]: Started Turn on SSH if /boot/ssh is pre...
by swampdog
Wed Aug 28, 2019 4:29 pm
Forum: Beginners
Topic: I cannot SSH my pi anymore
Replies: 20
Views: 1362

Re: I cannot SSH my pi anymore

pi@RPiPerpignan:~ $ systemctl status ssh.service ● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) Active: failed (Result: signal) since Wed 2019-08-28 15:49:05 UTC; 15s ago Process: 1000 ExecStartPre=/usr/sbin/sshd -t (cod...

Go to advanced search