Go to advanced search

by swampdog
Thu Jun 16, 2016 8:21 pm
Forum: C/C++
Topic: color.h in gcc
Replies: 6
Views: 1309

Re: color.h in gcc

Ah, right! ;-) In that case, this worked for me.. $ mkdir foo && cd foo $ git clone https://github.com/NREL/Radiance.git $ cmake . $ make ..there were a few warnings but everything built. Note that is "cmake[space][period]" above. I didn't install the project or test it but a subsequent.. $ sudo mak...
by swampdog
Thu Jun 16, 2016 7:50 pm
Forum: Troubleshooting
Topic: rpi3 dropping ssh connectiong over ethernet
Replies: 5
Views: 897

Re: rpi3 dropping ssh connectiong over ethernet

Are you able to get the output from 'ifconfig eth0' and 'sudo -i ethtool eth0' ("ethtool" package) and "ip route show"?
by swampdog
Thu Jun 16, 2016 6:32 pm
Forum: Raspbian
Topic: hd_driveid structure
Replies: 3
Views: 696

Re: hd_driveid structure

Code: Select all

$ sudo updatedb  <- apt get mlocate, iirc
$ locate hdreg.h
/usr/include/linux/hdreg.h
$ sudo apt-file search /usr/include/linux/hdreg.h
linux-libc-dev: /usr/include/linux/hdreg.h
..so you need to "apt-get install linux-libc-dev" methinks.
by swampdog
Thu Jun 16, 2016 1:28 am
Forum: Raspbian
Topic: Raspbian Jessie equivalent to ipconfig /all?
Replies: 18
Views: 15238

Re: Raspbian Jessie equivalent to ipconfig /all?

"@flatmax, I am looking for the DHCP assignments for each device/address. DNS, gateway, whatever DHCP has assigned."

$ sudo dhcpcd -U eth0
by swampdog
Thu Jun 16, 2016 12:25 am
Forum: General programming discussion
Topic: Stop Program after so long?
Replies: 6
Views: 1180

Re: Stop Program after so long?

How? The pid is always Changing. There's a myriad of ways to achieve that. The key is to obtain the correct PID. The bash shell variable "$!" will contain it. Wrap the 'go' command inside some shell script. Here's a generic example.. $ cat z-app #!/bin/bash ## f_exit () { echo "cleanup here" } f_tr...
by swampdog
Wed Jun 15, 2016 10:18 pm
Forum: C/C++
Topic: color.h in gcc
Replies: 6
Views: 1309

Re: color.h in gcc

Not enough info. You need to at least post a link to where the source code is. Chances are it is in there.

This is probably not what you want..

Code: Select all

sudo apt-file search "color.h" | egrep "/color\.h$"
by swampdog
Sat Jun 11, 2016 3:19 am
Forum: Beginners
Topic: Crontab setup in LDXE desktop
Replies: 5
Views: 1048

Re: Crontab setup in LDXE desktop

'crontab' isn't GUI independant. admin@pi00 ~ $ crontab -l PATH=/usr/local/sd/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH #------------------------------------------------------------------------------ #min hrs dom mon dow /path/to/cj #-----------------------------------------------------...
by swampdog
Sat Jun 11, 2016 2:59 am
Forum: Troubleshooting
Topic: Can't access WAN outside of my internal network with Jessie
Replies: 15
Views: 2694

Re: Can't access WAN outside of my internal network with Jes

If it's not on the same subnet you need. NAT. I hide my own network behind one. Unfortunately for yourself it is an old RPI running wheezy. One port is attached to my cable modem, the other (usb eth) to my internal network. Or it might be the other way around. It has worked for years. Bearing in min...
by swampdog
Sat Jun 11, 2016 2:24 am
Forum: Beginners
Topic: SUDO Python
Replies: 11
Views: 2678

Re: SUDO Python

'sudo' allows you to run something as if you were somebody else. Typically it is used to run something as the 'root' user. The root user can do anything, good or bad, without question. If you erroneously run something as root then realise your mistake, you may find your program does not work - even ...
by swampdog
Wed Jun 08, 2016 8:56 am
Forum: Other programming languages
Topic: Make a PHP script start at raspberry boot
Replies: 1
Views: 1275

Re: Make a PHP script start at raspberry boot

/etc/rc.local is easiest but it'll run as root which you almost certainly don't want so put this above the "exit 0".. sudo -u {user} -i {/path/to/php/script} eg: I have a user called "admin" and will invoke "z.php" as "admin".. sudo -u admin -i /wrk/z.php ..and "z.php" is.. #!/usr/bin/php <?php ob_s...
by swampdog
Sat Apr 23, 2016 11:03 am
Forum: C/C++
Topic: a few hints needed: reading input string, parse to ints
Replies: 2
Views: 667

Re: a few hints needed: reading input string, parse to ints

This is how to load a file into memory, with & without exceptions... bool FC sdFileLoad( sdConStr * cs, const sdStr & fname, bool append, BARF barf ) SD_THROW ((sde_Null,sde_File)) { SDE_NULL(cs); sdBifs ifs (fname.c_str()); sdStr s; if (!ifs) { if (barf) throw sde_File(SD_SFL(sdFileLoad),fname) ; r...
by swampdog
Sat Apr 09, 2016 12:47 am
Forum: C/C++
Topic: Time measure UDP socket Raspi<--->PC
Replies: 6
Views: 1607

Re: Time measure UDP socket Raspi<--->PC

I'm afraid you have made a fundamental mistake. UDP packets are "shouty" thus no way to know their time back. TCP is worse. You can get an average, that is all. [quote="ampu"]I´m trying to obtain the performance in a Client (PC i7 3.4 GHz Kubuntu 15.04) - Server (RaspberryPi 700 Mhz Raspbian Jessie)...
by swampdog
Sat Apr 09, 2016 12:25 am
Forum: C/C++
Topic: Which Editor for C Programs
Replies: 33
Views: 4107

Re: Which Editor for C Programs

'nano'

I've used 'vi' and 'emacs' in my time. Nano (-w) beats them all.
by swampdog
Sat Apr 09, 2016 12:17 am
Forum: C/C++
Topic: #error header must be compiled as C++
Replies: 5
Views: 3833

Re: #error header must be compiled as C++

I'm afraid you're git hub link doesn't work.
by swampdog
Fri Apr 01, 2016 10:06 pm
Forum: C/C++
Topic: Can't write .txt file
Replies: 5
Views: 1429

Re: Can't write .txt file

[must have been a glitch in my browser] Unix/Linux has two output streams. There's "stdout" and "stderr" (the input stream is "stdin"). Those are "C" terms. In C++ terminology they are "std::cout", "std::cerr" and "std::cin". Same thing on the command line really. It depends on the app but the gener...
by swampdog
Fri Apr 01, 2016 9:37 pm
Forum: C/C++
Topic: Can't write .txt file
Replies: 5
Views: 1429

Re: Can't write .txt file

sprinkmeier is most likely correct. Personally I prefer to perform such manipulations in memory. eg: #include <iostream> #include <sstream> #include <fstream> int main(void) {std::ostringstream x; x << "Hello C++ World" << std::endl; {std::ofstream f ("/tmp/z"); f << x.str(); if (f.bad()) std::cerr ...
by swampdog
Wed Mar 30, 2016 11:05 pm
Forum: C/C++
Topic: [solved] Trying to compile a game used on other linux
Replies: 2
Views: 799

Re: Trying to compile a game used on other linux

$ unzip vorton-src-beta2.zip 00.patch --- vorton/Makefile.linux.ORIGINAL 2016-03-30 22:45:18.075043520 +0000 +++ vorton/Makefile.linux 2016-03-30 22:49:14.582265492 +0000 @@ -5,7 +5,7 @@ STRIP= strip -CFLAGS = -Wall -Wno-switch -march=pentium -mcpu=pentium -DDEBUG \ +CFLAGS = -Wall -Wno-switch -DDEB...
by swampdog
Wed Mar 30, 2016 10:01 pm
Forum: C/C++
Topic: Makefile advice - compiling an old game from source
Replies: 4
Views: 1495

Re: Makefile advice - compiling an old game from source

I took a quick look. Actually it's written in C++. This is enough to get it to build.. $ git clone https://github.com/devpack/mayhem $ cd mayhem && rm -rf allegro442_include $ sudo apt-get install liballegro4.4 liballegro4-dev Modifiy these lines in 'Makefile', leave the rest unchanged: CPP = g++ CC...
by swampdog
Fri Mar 11, 2016 6:03 pm
Forum: Advanced users
Topic: iscsi & dhcp
Replies: 2
Views: 695

Re: iscsi & dhcp

Yes the pi is presented.. admin@pi05:~ $ sudo -i lsscsi [0:0:0:0] storage IET Controller 0001 - [0:0:0:1] disk IET VIRTUAL-DISK 0001 /dev/sda ..which corresponds to the 'tgt-admin -s' output which has *.53 as its connection ip address so to clarify the order of events is this: initrd7img <- *.53 fro...
by swampdog
Fri Mar 11, 2016 1:01 am
Forum: C/C++
Topic: Using namespace c++
Replies: 3
Views: 1474

Re: Using namespace c++

The namespace exists to stop things getting polluted. If I wrote a function called foo() and someone else writes another function called foo() they'd collide in what (iirc) is called the global namespace. #include <iostream> namespace a { void foo(){std::cout<<"a::foo\n";} }//namespace a namespace b...
by swampdog
Fri Mar 11, 2016 12:14 am
Forum: Advanced users
Topic: iscsi & dhcp
Replies: 2
Views: 695

iscsi & dhcp

Hi Folks, I'm stumped on this one. My dhcp server is (FreeBSD 8.2-RELEASE-p4).. admin@sdvmf64dns$ dhcpd --version isc-dhcpd-V3.1.2p1 The client is (Raspberry 4.1.18-v7+).. admin@pi05$ dhcpcd --version dhcpcd 6.7.1 I cross-compiled kernel7.img with "CONFIG_ISCSI_TCP=y" then generated an"initrd7.img" ...
by swampdog
Thu Dec 31, 2015 2:14 am
Forum: C/C++
Topic: is there a standard path to #include libs system-wide?
Replies: 4
Views: 774

Re: is there a standard path to #include libs system-wide?

You'd ordinarily build things from source thusly.. $ mkdir -p ~/usr/src/autoconf $ cd ~/usr/src/autoconf $ wget -c http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz $ tar xvJf autoconf-2.69.tar.xz $ mkdir obj && cd obj $ ../autoconf-2.69/configure --help $ ../autoconf-2.69/configure --prefix=/usr...
by swampdog
Thu Dec 31, 2015 1:00 am
Forum: C/C++
Topic: segmentation fault with gcc
Replies: 23
Views: 4620

Re: segmentation fault with gcc

otoh being initialized as zero is an advantage and you have a better overview, how much is used in total and usually, when I have subroutines, they use those variables too I dunno if this helps or will be more confusing.. $ nano -w c.c #include <stdio.h> #include <stdbool.h> #include <stdlib.h> boo...
by swampdog
Wed Dec 30, 2015 11:59 pm
Forum: Advanced users
Topic: Compile pwsafe
Replies: 8
Views: 1456

Re: Compile pwsafe

It will build under jessie. admin@pi05:~/T/pwsafe-3.37.1 $ pwd && cat 00.patch /home/admin/T/pwsafe-3.37.1 --- src/core/PwsPlatform.h.ORIGINAL 2015-12-30 18:59:04.482946108 +0000 +++ src/core/PwsPlatform.h 2015-12-30 19:04:38.609018301 +0000 @@ -142,6 +142,7 @@ // * Add other platforms here... * // ...
by swampdog
Sat Dec 12, 2015 3:11 am
Forum: Other programming languages
Topic: Date in Bash
Replies: 3
Views: 1968

Re: Date in Bash

Never mess with time.

Code: Select all

$ date "+%x %r %Z"
.. is likely what you wanted. Always log UTC (aka GMT time). A good format is..

YYYY-MM-DD-hh:mm:ss:[nano secs or whatever]

..because it is both language and timezone agnostic.

Go to advanced search