Go to advanced search

by swampdog
Thu May 28, 2020 7:56 pm
Forum: C/C++
Topic: New major release of GCC
Replies: 74
Views: 2558

Re: New major release of GCC

You can use temporary mounts for the build. Plug in a usb memory stick, format it and use that for the build folder. Not ideal but it will work and unless your sdcard is really struggling for space you can temporarily add more swap so that "make -j4" can work. On my x86 PC I do the entire build in ...
by swampdog
Thu May 28, 2020 6:43 pm
Forum: C/C++
Topic: New major release of GCC
Replies: 74
Views: 2558

Re: New major release of GCC

Check disk space first. Then "make -j1" to see if the error goes away (not enough ram in 99% of instances) and for that 1% where it doesn't you'll have a consistent log (eg: "make -j1 2>&1 | tee /tmp/z.log"). It can be nigh on impossible to find the true (initial) error in a parallel build because s...
by swampdog
Fri May 08, 2020 10:58 am
Forum: Advanced users
Topic: Qt5 and RPi EGLFS: Could not initialize egl display
Replies: 8
Views: 953

Re: Qt5 and RPi EGLFS: Could not initialize egl display

I get this when I ssh (-X or -Y) into my pi and run qtcreator.. libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast ..and two plugin loader messages in a dialog "QmlDesigner" "QmlProfiler" - "Plugin initialization failed: Cannot create OpenGL context". I've...
by swampdog
Thu Apr 23, 2020 1:14 am
Forum: Advanced users
Topic: How to Get Rid of the need to Type "sudo"?
Replies: 65
Views: 1641

Re: How to Get Rid of the need to Type "sudo"?

Nonsense. (a) is how I've been running all my kit for the last 25 years, and is how we all used to admin computers before this modern sudo nonsense was foisted on us. As long as you use root for root things (only), it's fine. If you're running *everything* as root, then yes, I agree, you're doing i...
by swampdog
Wed Apr 22, 2020 10:41 pm
Forum: Advanced users
Topic: How to Get Rid of the need to Type "sudo"?
Replies: 65
Views: 1641

Re: How to Get Rid of the need to Type "sudo"?

a) enable the root a/c and just (auto)log in as that. [...] You will regret (a). Some programs refuse to run as root at all. Others will mysteriously fail because you've fiddled with them and accidentally denied those programs access to themselves. Nonsense. (a) is how I've been running all my kit ...
by swampdog
Wed Apr 22, 2020 8:07 pm
Forum: Advanced users
Topic: How to Get Rid of the need to Type "sudo"?
Replies: 65
Views: 1641

Re: How to Get Rid of the need to Type "sudo"?

Glancing through the thread so far it appears you have two options: a) enable the root a/c and just (auto)log in as that. b) add a NOPASSWD entry to a file in /etc/sudoers.d/ then "override" the few commands that annoy you. Hint: [email protected]:~/bin $ cat RB #!/bin/bash sudo su - root -c reboot ..and so ...
by swampdog
Wed Apr 22, 2020 5:06 pm
Forum: C/C++
Topic: LED display (python -> C)
Replies: 6
Views: 351

Re: LED display (python -> C)

I'm looking forward to digging into your code next week to see how it all fits together. Start in the CMakeLists.txt as that shows how I glue the pieces together. The idea is to have a common module that does the common LCD functions (clear, move cursor, write, define CG, etc.) then one driver modu...
by swampdog
Wed Apr 22, 2020 12:33 am
Forum: C/C++
Topic: Allocating memory for 2D array odd problem
Replies: 8
Views: 325

Re: Allocating memory for 2D array odd problem

I've never used them myself as they weren't around before I started using C++ and all the C code I encountered did it the old fashioned way but you might want to read.. https://www.drdobbs.com/the-new-cwhy-variable-length-arrays/184401444 https://www.drdobbs.com/the-new-c/184401468 ..for variable le...
by swampdog
Thu Apr 16, 2020 1:10 pm
Forum: C/C++
Topic: LED display (python -> C)
Replies: 6
Views: 351

Re: LED display (python -> C)

Many thanks! Worked first time :-)

I'm looking forward to digging into your code next week to see how it all fits together.
by swampdog
Wed Apr 15, 2020 10:44 pm
Forum: General discussion
Topic: Switching off network
Replies: 6
Views: 283

Re: Switching off network

Interesting question. Here's an idea.. https://serverfault.com/questions/550276/how-to-block-internet-access-to-certain-programs-on-linux It would need tweeking. The idea is you set up a firewall on the pi and make your kid's account a member of a group for which the firewall throws away all network...
by swampdog
Wed Apr 15, 2020 10:14 pm
Forum: C/C++
Topic: LED display (python -> C)
Replies: 6
Views: 351

LED display (python -> C)

I've had this knocking around for ages: GeeekPi IIC/I2C 2004 20x4 Character LCD Module Display, Support I2C Protocol, LCD 2004 Module Shield for Arduino Uno Raspberry Pi https://www.amazon.co.uk/gp/product/B07QNKCLJM/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 Sadly, no C code for it, only https...
by swampdog
Wed Apr 15, 2020 9:43 pm
Forum: Advanced users
Topic: Qt5 and RPi EGLFS: Could not initialize egl display
Replies: 8
Views: 953

Re: Qt5 and RPi EGLFS: Could not initialize egl display

If this has boiled down to an 'ldconfig' issue you may be having an "LD_LIBRARY_PATH problem" - 'ldd' respects that so results can differ depending on it. That is, without it set correctly 'ldd' may erroneously pick a system lib instead of yours. In my case, I rarely produce an "official" package (....
by swampdog
Thu Apr 09, 2020 12:06 am
Forum: Beginners
Topic: Need help with a script to delete .txt files
Replies: 7
Views: 311

Re: Need help with a script to delete .txt files

You want the 'find' command. Didn't cleverca22 already give a find command that was more straightforward? you can also work around that problem with: find /home/pi/goes/emwin -name '*.TXT' -delete You can't test it and "-delete" has some side effects. Also I don't think the OP wants folders removed.
by swampdog
Wed Apr 08, 2020 11:32 pm
Forum: Networking and servers
Topic: deploying many rpi
Replies: 2
Views: 212

Re: deploying many rpi

I left the industry proper before DevOps became de-facto so can't help with that. What I do when writing images is have a script mount the image prior to writing to the sdcard and (amongst other things) adjust the hostname, enable ssh and /etc/rc.local then put a script in there which completes the ...
by swampdog
Wed Apr 08, 2020 10:57 pm
Forum: Beginners
Topic: Need help with a script to delete .txt files
Replies: 7
Views: 311

Re: Need help with a script to delete .txt files

You want the 'find' command. Extremely powerful (man find) but a headache to use..

Code: Select all

$ find /home/pi/goes/emwin/ -type f -iname '*.txt' -exec echo rm -v '{}' ';'
Once you're satisfied it lists only the files you want to delete remove the "echo" from above.
by swampdog
Wed Apr 08, 2020 10:47 pm
Forum: Beginners
Topic: (SOLVED) Why does it generate such a large backup file? Does it work by SSH? Does it work by USB?
Replies: 4
Views: 279

Re: Why does it generate such a large backup file? Does it work by SSH? Does it work by USB?

1) You can compress on the fly. Something like this (where /dev/sdd is my sdcard reader): [email protected] /kvm $ sudo dd if=/dev/sdd status=progress | bzip2 --best >/wrk/pi.img.bz2 Disadvantage is you need to decompress before restoring (you can decompress on the fly). Biggest problem is sdcards of same siz...
by swampdog
Wed Apr 08, 2020 8:33 am
Forum: Raspberry Pi Desktop for PC and Mac
Topic: JY-R2T (rs232 adapter)
Replies: 7
Views: 264

Re: JY-R2T (rs232 adapter)

I managed to read what the chips are: Sipex sp3232een 634lt7320 (v1.4) https://www.maxlinear.com/ds/sp3222e_sp3232e.pdf Max3232 ese+1240 (v1.3) http://www.ti.com/lit/ds/symlink/max3232.pdf ..or at least supposed to be (I dont know what exe+1240 means). On the face of it they appear similar enough. I...
by swampdog
Wed Apr 08, 2020 5:21 am
Forum: Raspberry Pi Desktop for PC and Mac
Topic: JY-R2T (rs232 adapter)
Replies: 7
Views: 264

Re: JY-R2T (rs232 adapter)

I believe I've got that part correct though it does no harm to verify. Atm two of the zero's are rpiZW. The remainder is a plain rpiZ with a wifi dongle. host type os rs232 --------------------------------- pi13 rpiZW stretch v1.4 pi22 rpiZ buster v1.4 pi21 rpiZW stetch v1.3 [email protected]:~ $ tail -3 /bo...
by swampdog
Tue Apr 07, 2020 10:35 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: JY-R2T (rs232 adapter)
Replies: 7
Views: 264

Re: JY-R2T (rs232 adapter)

Ah. I seem to have neglected to mention these adapters are connected to raspberry pi's running raspbian! This is the only link I can find https://www.amazon.co.uk/Serial-Adapter-Module-JY-R2T-Joystick/dp/B077K5XF5M noting I likely didn't get them from there. I'm powering them from the 3.3v gpio pin ...
by swampdog
Tue Apr 07, 2020 3:45 pm
Forum: Networking and servers
Topic: Passwordless SSH From Windows 10
Replies: 3
Views: 273

Re: Passwordless SSH From Windows 10

I heard win10 can do ssh natively now? I don't know the details. I always install cygwin and its openssh client, which, once configured, works just like linux. Just run "ssh-user-config" on the cygwin side where you see "ssh-keygen" in linux instructions. Don't bother with the cygwin ssh server init...
by swampdog
Tue Apr 07, 2020 3:07 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: JY-R2T (rs232 adapter)
Replies: 7
Views: 264

JY-R2T (rs232 adapter)

Has anyone used the 1.3 version? I bought a few some months back. Two are v1.4 and work fine (attached to PC's running centos 7). The rest are v1.3 - you'll see the grub boot screen and everything appears fine(*) until the login prompt: then there's just random junk inserted. [ 28.591633] br0: port ...
by swampdog
Thu Apr 02, 2020 9:10 am
Forum: C/C++
Topic: Library linkage issues while developing a C++/MySQL application
Replies: 2
Views: 231

Re: Library linkage issues while developing a C++/MySQL application

I forgot to mention statically linking mysql is not easy. [email protected] /wrk/TT $ gcc -o c c.cpp `sd-qt mysql_config --cflags` -Wl,-Bstatic `sd-qt mysql_config --variable=pkglibdir`/libmysqlclient.a -Wl,-Bdynamic -lpthread -ldl -lgnutls -lz ..is what I just figured out it would be for my "slung on the sid...
by swampdog
Thu Apr 02, 2020 8:25 am
Forum: C/C++
Topic: Library linkage issues while developing a C++/MySQL application
Replies: 2
Views: 231

Re: Library linkage issues while developing a C++/MySQL application

I've not built a mysql app for years but I don't see mention of 'mysql_config'. Ignore 'sd-qt' below: it's for a self compiled mariadb "slung on the side" and I'll muck something up if I try edit it out. Just pretend 'sd-qt' doesn't exist. [email protected] ~/usr/src $ sd-qt mysql_config --cflags -I/usr/local...
by swampdog
Thu Apr 02, 2020 7:38 am
Forum: Beginners
Topic: Mariadb Run as PI versus Run as Root
Replies: 35
Views: 1010

Re: Mariadb Run as PI versus Run as Root

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld./sock’ (2) Is that period/slash in the path a typo? Fwiw, I just did 'apt-get install mariadb-server' (Y) on a fresh buster install and 'sudo mysql' logged right in. [email protected]:~ $ sudo ls -l /var/run/mysql...
by swampdog
Thu Apr 02, 2020 6:43 am
Forum: General discussion
Topic: Locking LXTerm and the sudo command
Replies: 12
Views: 270

Re: Locking LXTerm and the sudo command

A handy tip for these kind of "might lock myself out of root" situations (eg: sudo,ssh) is to have two terminals onto the target. In one terminal gain root login, then in the second, do the work and test. That way if you make a mistake you've still got the first terminal logged in to undo the mistake.

Go to advanced search