Go to advanced search

by swampdog
Tue Oct 13, 2020 1:28 pm
Forum: Beginners
Topic: Is there any executable file that is 100% going to be in /bin?
Replies: 14
Views: 368

Re: Is there any executable file that is 100% going to be in /bin?

I usually start with 'uname' and work from there but to answer your question, I guess we need to find a native executable using minimum tools.. #!/usr/bin/env sh E="/bin/sh" [ -f "$E" ] || exit 1 X=$(readlink "$E") [ -z "$X" ] && X="$E" X="$(which $X)" $(which file) "$X" || exit 1 The above ought to...
by swampdog
Fri Sep 25, 2020 11:19 pm
Forum: Raspberry Pi OS
Topic: Adding user without rights
Replies: 3
Views: 197

Re: Adding user without rights

The OP did specifically mention tunnelling. I went on the assumption they had a reason: probably a bad idea in forums. The upside to tunnelling though is you offload all the encryption onto a single package and don't have to worry about it in code/scripting. The downside of course, is you have to ke...
by swampdog
Fri Sep 25, 2020 11:03 pm
Forum: C/C++
Topic: questions to C libs also for g++
Replies: 28
Views: 885

Re: questions to C libs also for g++

If you run my "c.x" post example things might become clearer. I omitted the output of "gcc -E c.c" and "g++ -E c.cc" hoping you'd type in my code and all the commands in that post to see for yourself. Go grab a drink, take a deep breath and now for some C compiler history. A C compiler has the notio...
by swampdog
Fri Sep 25, 2020 8:54 pm
Forum: Raspberry Pi OS
Topic: Adding user without rights
Replies: 3
Views: 197

Re: Adding user without rights

Create a user with "/bin/false" as the login shell then have the client use the ssh "-N" option. sudo useradd -m -s /bin/false bob ^^^I'd probably delete all files (ls -la) in /home/bob/ (except .ssh if using a key). ssh -N -L [hostport]:mysql_server:[mysqlport] bob@rpi_server ..would probably equat...
by swampdog
Fri Sep 25, 2020 6:20 pm
Forum: C/C++
Topic: questions to C libs also for g++
Replies: 28
Views: 885

Re: questions to C libs also for g++

foo@pi18:/wrk/TT $ cat c.x /*?are we a C++ compiler?*/ #ifdef __cplusplus extern "C" { #endif void foo(void); //?are we a C++ compiler? #ifdef __cplusplus } #endif int main(void) { foo(); return 0; } foo@pi18:/wrk/TT $ ln -s c.x c.c ; ln -s c.x c.cc foo@pi18:/wrk/TT $ ls -l total 4 lrwxrwxrwx 1 foo...
by swampdog
Sat Sep 19, 2020 7:47 pm
Forum: C/C++
Topic: Advice on this code
Replies: 18
Views: 1056

Re: Advice on this code

GEM was never on a Mac. In fact Apple Computer sued Digital Research on claims of infringing on Apple's look an feel. That is how good GEM was. GEM was better than early versions of Windows. My bad. Forgot that over the years. Not quite sure how because I knew about the legal battle! It was early P...
by swampdog
Sat Sep 19, 2020 4:23 pm
Forum: C/C++
Topic: Advice on this code
Replies: 18
Views: 1056

Re: Advice on this code

The ancient GEM GUI used by the Atari ST and early Mac was very lean. Horrible implementation due to hardware restraints but the design still stands up. It had the notion of an OBJECT in which was contained very little.. http://toshyp.atari.org/en/008016.html#OBJECT typedef struct { int16_t ob_next;...
by swampdog
Sat Sep 19, 2020 2:44 pm
Forum: C/C++
Topic: Cross-compile for PI
Replies: 15
Views: 1441

Re: Cross-compile for PI

What if you just want to build your cross compiling toolchain from source? If you're prepared to do that then there's a counter intuitive way to cross compile using 'distcc' and your pi as the host - and you don't have to install any extra headers or libs other than on the host pi (as per normal na...
by swampdog
Wed Jul 22, 2020 9:36 am
Forum: General programming discussion
Topic: [SOLVED] Changing bash working directory within a program
Replies: 14
Views: 1044

Re: Changing bash working directory within a program

There's also the underused 'pushd' and 'popd' commands and note that 'cd -' will take you back to the last folder. I have.. foo@sdu /kvm $ alias pu alias pu='pushd 1>/dev/null' foo@sdu /kvm $ alias po alias po='popd 1>/dev/null' If you want all users affected stick it into "/etc/bash.bashrc". I tend...
by swampdog
Sat Jul 04, 2020 8:39 am
Forum: Advanced users
Topic: transferring a directory via SCP from a windows machine
Replies: 4
Views: 263

Re: transferring a directory via SCP from a windows machine

/cygwin64/c/ implies you have cygwin installed. It has a ssh client. Use "setup.exe" to install it. It's called something like "openssh client". There may be cygwin updates applied when setup.exe runs so be prepared to reboot(*) the PC when it completes. Open a cygwin terminal and run "ssh-user-conf...
by swampdog
Thu Jul 02, 2020 4:48 pm
Forum: C/C++
Topic: New major release of GCC
Replies: 120
Views: 11722

Re: New major release of GCC

-rwxr-xr-x 4 root root 6.1M May 8 15:19 arm-linux-gnueabihf-c++ -rwxr-xr-x 4 root root 6.1M May 8 15:19 arm-linux-gnueabihf-g++ -rwxr-xr-x 4 root root 6.1M May 8 15:19 c++ -rwxr-xr-x 4 root root 6.1M May 8 15:19 g++ -rwxr-xr-x 3 root root 6.1M May 8 15:21 arm-linux-gnueabihf-gcc -rwxr-xr-x 3 root r...
by swampdog
Thu Jul 02, 2020 4:22 pm
Forum: C/C++
Topic: How to debug Bus Error
Replies: 8
Views: 784

Re: How to debug Bus Error

If you are able to compile it natively then I'd do that first. It saves wondering about cross-compilation subtleties. I did a quick google and cross compilers do get a fair mention but then again they're used a lot on arm so it may be meaningless. I did learn something though.. foo@pi20:~ $ cat /pro...
by swampdog
Thu Jul 02, 2020 3:18 pm
Forum: Beginners
Topic: Headless SSH switching between tasks
Replies: 4
Views: 320

Re: Headless SSH switching between tasks

On your rpi.. $ sudo apt-get install screen It's a detachable terminal. To start your app, "ssh" in like normal but rather than running the app directly type 'screen' first then launch your app there. CTRL-A-D (that's CTRL-A, let go then press D) will detach it and you can log out of ssh if you wish...
by swampdog
Thu Jul 02, 2020 10:43 am
Forum: C/C++
Topic: New major release of GCC
Replies: 120
Views: 11722

Re: New major release of GCC

I don't know the reason why gcc is installed as multiple copies but I suspect it has to do with the more complex configuration options. You might want multiple compilers (and crosses) all sat in the same folder (or not) and there are hard coded paths. Changing the system compiler to be a symlink wil...
by swampdog
Sat Jun 27, 2020 10:07 am
Forum: Networking and servers
Topic: iSCSI Root Like a Data Center
Replies: 45
Views: 4897

Re: iSCSI Root Like a Data Center

Have you noticed any dhcp duplication? Years ago when I experimented with iscsi I found it would randomly fail (nothing being unplugged). The rpi initrd would obtain a lease and when raspbian loaded, another lease would be obtained. I probably messed up the initrd. Too long ago to recall those deta...
by swampdog
Sat Jun 27, 2020 9:20 am
Forum: Beginners
Topic: Only had my Pi 4 for a week, crashes/hangs multiple times a day
Replies: 14
Views: 810

Re: Only had my Pi 4 for a week, crashes/hangs multiple times a day

re: clamav I don't know for the rpi but on one of my linux mint boxes: foo@sdu /kvm $ sudo systemctl -a | grep -i clam ● clamav-daemon.service not-found inactive dead clamav-daemon.service clamav-freshclam.service loaded active running ClamAV virus database updater If you type that command and get s...
by swampdog
Sat Jun 27, 2020 7:17 am
Forum: Networking and servers
Topic: idea: replacing a large power hungry rack server, with Rpi computers
Replies: 16
Views: 811

Re: idea: replacing a large power hungry rack server, with Rpi computers

I assume you can, on the NFS client, touch/create then edit/write then remove a file in /mnt/nfs_home and /mnt/nfs_home/tjfhome/html as the appropriate users? If so then it isn't NFS. Typically on Redhat, it is SELinux, which is enabled by default. [foo@c7srv ~]$ getenforce Enforcing ^^^Yes? Then te...
by swampdog
Fri Jun 26, 2020 2:02 am
Forum: Networking and servers
Topic: idea: replacing a large power hungry rack server, with Rpi computers
Replies: 16
Views: 811

Re: idea: replacing a large power hungry rack server, with Rpi computers

[centos bit] You should reconsider running raid5. The topic has been done to death online but either raid10 or raid6 is better with four disks as two disks can fail. In the unlikely event all six disks are the same, there's the possibility of two partitions on each and assigning a hot spare. Typica...
by swampdog
Thu Jun 25, 2020 3:54 pm
Forum: Networking and servers
Topic: idea: replacing a large power hungry rack server, with Rpi computers
Replies: 16
Views: 811

Re: idea: replacing a large power hungry rack server, with Rpi computers

The three KVM's and both NAS run Centos btw. Most of my server VM images are Centos also. Bit off-topic but you need to be (at least) running LVM on top of raid1 for the OS in one Volume Group. Use another VG for data, yet another if you desire local backups. Are you running CentOS on the Pi? I'd l...
by swampdog
Thu Jun 25, 2020 3:36 pm
Forum: Raspberry Pi OS
Topic: Permission Denied, can't move, delete or save files.
Replies: 6
Views: 6424

Re: Permission Denied, can't move, delete or save files.

I only got 44 seconds into that video and there's already two mistakes. It goes downhill from there with an unnecessary vim trick to allow root ssh login. Nobody do anything advised in that video.
by swampdog
Thu Jun 25, 2020 3:12 pm
Forum: Networking and servers
Topic: iSCSI Root Like a Data Center
Replies: 45
Views: 4897

Re: iSCSI Root Like a Data Center

Have you noticed any dhcp duplication? Years ago when I experimented with iscsi I found it would randomly fail (nothing being unplugged). The rpi initrd would obtain a lease and when raspbian loaded, another lease would be obtained. I probably messed up the initrd. Too long ago to recall those detai...
by swampdog
Thu Jun 25, 2020 2:47 pm
Forum: Networking and servers
Topic: idea: replacing a large power hungry rack server, with Rpi computers
Replies: 16
Views: 811

Re: idea: replacing a large power hungry rack server, with Rpi computers

I'm doing the same thing, albeit very slowly (and much slower than I planned). I have three 24/7 KVM hypervisors and two 24/7 Proliant boxes for NAS plus some other stuff which is no longer on constantly. It was an obvious first step in my case to look at those virtual machines and figure out which ...
by swampdog
Wed Jun 24, 2020 2:18 am
Forum: C/C++
Topic: Bug Report - misbehaving little C++ code
Replies: 24
Views: 1590

Re: Bug Report - misbehaving little C++ code

That's great, swampdog, and for going the extra mile you deserve a whole pack (5) of Henri Winterman's Short Panatellas, provided it is legal for you to smoke them. I'll mail them anywhere; just send your postal address to: gr aec at gm % ail d0t commercial With swampdog in the subject. Sorry. I've...
by swampdog
Thu Jun 11, 2020 6:12 pm
Forum: C/C++
Topic: Bug Report - misbehaving little C++ code
Replies: 24
Views: 1590

Re: Bug Report - misbehaving little C++ code

I'd imagine if g++ couldn't sustain 24/7 output someone would have noticed pretty soon. This gcc version (and we're using different versions) will cause the same fault.. #include <unistd.h> const char s[]="Hello, loopy world!\n"; const size_t n=sizeof(s)-1; int main() { while (1) { write(1,s,n); } r...
by swampdog
Wed Jun 10, 2020 9:13 pm
Forum: C/C++
Topic: Bug Report - misbehaving little C++ code
Replies: 24
Views: 1590

Re: Bug Report - misbehaving little C++ code

Well, I forgot about it for a while and I just noticed one lxterminal window has gone blank. There were still eight open but only two were still running. The first window went completely blank. This was the one running longest. When I gave it focus, still blank but there was a momentary flash of a c...

Go to advanced search