Go to advanced search

by rpdom
Thu Jun 06, 2013 7:06 am
Forum: General programming discussion
Topic: Problem with rm on cron job?
Replies: 3
Views: 1187

Re: Problem with rm on cron job?

"==" is a bash specific operator (a "bashism" as they are known). When you specifiy /bin/sh in a cron it will use a different shell and == won't work.

Either change your #! line to use bash instead of sh, or use [ $? = 0 ] or [ $? -eq 0 ] for the tests.
by rpdom
Thu Jun 06, 2013 5:55 am
Forum: Raspbian
Topic: Date still at May. NTPD failure?
Replies: 5
Views: 878

Re: Date still at May. NTPD failure?

It is quite common for routers to act as a local time server on a network and sync itself to one or more external servers. That way the local machine all sync to the same server so their clocks will be in sync with each other as well, with no delays. It also cuts down on the amount of external traff...
by rpdom
Wed Jun 05, 2013 2:00 pm
Forum: General discussion
Topic: IP Address
Replies: 6
Views: 804

Re: IP Address

The Pi has almost no internal storage (other than the RAM memory which forgets everything when you switch it off). What it does have is a few bits of write-once memory that are used to store the serial number, board version number and things like that. Everything else is stored on the card (like the...
by rpdom
Wed Jun 05, 2013 1:25 pm
Forum: General discussion
Topic: IP Address
Replies: 6
Views: 804

Re: IP Address

Are you saying that the IP address moved with the card, or that the address stayed the same even with the other card?

If the former, well that's to be expected. All the files - including the one to set the IP address are on that card. Move it to another Pi and the address goes with it.
by rpdom
Wed Jun 05, 2013 12:44 pm
Forum: Troubleshooting
Topic: Directory disappeared...twice
Replies: 10
Views: 2011

Re: Directory disappeared...twice

I can think of a few possibilities there. (There are probably others too). a) The file wasn't written properly. Yes, it will look like it was, but that is because all the writes are cached in memory for a while and when you re-read the file you will see the cached version. Use the "sync" command (no...
by rpdom
Wed Jun 05, 2013 12:29 pm
Forum: Beginners
Topic: Share disk between machines raspbian
Replies: 6
Views: 2573

Re: Share disk between machines raspbian

My network shares are all NFS for my Linux systems and one of them is also a Samba share for my wife's windows laptop.
by rpdom
Wed Jun 05, 2013 10:42 am
Forum: Networking and servers
Topic: Run Bash script in PHP
Replies: 6
Views: 3859

Re: Run Bash script in PHP

Nearly every major software compromise has involved an attempt at "santising" that didn't go far enough. Even if you can put together a completely safe check (must be completely an integer) it's only reinforcing a programming habit that will come up again later ("I'm sure I can sanitise this large ...
by rpdom
Wed Jun 05, 2013 6:02 am
Forum: General discussion
Topic: Best way to run a python script at startup?
Replies: 35
Views: 324503

Re: Best way to run a python script at startup?

You don't need sudo.

Everything in /etc/rc.local runs as the root user.

Also, you can group commands together using ().

The following should work in /etc/rc.local

Code: Select all

(sleep 10;python scriptname.py)&
The () make both commands run in the background.
by rpdom
Wed Jun 05, 2013 5:55 am
Forum: Raspbian
Topic: Date still at May. NTPD failure?
Replies: 5
Views: 878

Re: Date still at May. NTPD failure?

Ok, first step is to check that you can get to an NTP server and when it was last updated. sudo ntpq -p Should list out all NTP servers that you have got configured and various values including when they were last accessed. Please post the results of that command and we can check them and give more ...
by rpdom
Wed Jun 05, 2013 5:48 am
Forum: Networking and servers
Topic: [HOW TO] Use your RPI as a DNS server and speed up yo' net!
Replies: 52
Views: 248591

Re: [HOW TO] Use your RPI as a DNS server and speed up yo' n

Good, very detailed description and instructions. Although one very minor point. I'd prefer to put a config file called "pimasq.conf" in /etc/dnsmasq.d/ instead of replacing the existing file. This is the "Debian way" (and therefore Raspbian) of handling config files now. It means you can leave the ...
by rpdom
Wed Jun 05, 2013 5:20 am
Forum: Networking and servers
Topic: Run Bash script in PHP
Replies: 6
Views: 3859

Re: Run Bash script in PHP

technion wrote:Just think about what happens when I go and visit this URL:

RPi_IP"/main.php?addr=10&value=100; rm -rf /

Passing PHP variables into a shell is almost always a bad idea.
True, the values should be at least quoted, if not escaped too, and checked for validity before use.
by rpdom
Wed Jun 05, 2013 5:17 am
Forum: Raspbian
Topic: OS Version and Upgrade
Replies: 5
Views: 16453

Re: OS Version and Upgrade

The following commands will make sure all your currently installed software is the latest versions as used on the new image. sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade When asked any [Y/n] questions, you can press Enter and it will take it as "Y". Any extra software that is o...
by rpdom
Tue Jun 04, 2013 6:26 pm
Forum: General discussion
Topic: Pinout weird behaviour
Replies: 1
Views: 293

Re: Pinout weird behaviour

What voltage do you get when you measure?

Which pins on the connector are you measuring between? Pin 5 and Pin 6?

Setting the value to 0 should set the pin to 0V
by rpdom
Tue Jun 04, 2013 6:18 pm
Forum: General discussion
Topic: where does the space go on 16GB SD card
Replies: 5
Views: 629

Re: where does the space go on 16GB SD card

Most of the distributions only initially use the start of the SD card. Which distribution did you use - the answer will affect the instructions for extending the usable space to use all of the card. I only install the raspbian about 2 or 3 weeks ago, it's called raspbian wheezy. In that case do wha...
by rpdom
Tue Jun 04, 2013 3:37 pm
Forum: Networking and servers
Topic: Run Bash script in PHP
Replies: 6
Views: 3859

Re: Run Bash script in PHP

That last chunk of code isn't enclosed in "<?php ... ?>" tags. Also, you don't need to do that for every line, just put the whole code block in it with echo or printf statements. <html><body><h1>Hello! </h1> <?php echo "Logic Address ${_GET["addr"]}<br>\n"; echo "Value ${_GET["value"]}<br>\n"; $old_...
by rpdom
Tue Jun 04, 2013 5:57 am
Forum: Beginners
Topic: Raspbarry Pi Model B Rev 1 or 2
Replies: 8
Views: 22131

Re: Raspbarry Pi Model B Rev 1 or 2

I see some tiny little holes, that look like they might be mounting holes, next to c5 and s2 on the card side of the raspberry logo. I have no idea if these tiny holes are the mounting holes you speek of. THERE MUST BE SOME WAY TO TELL WHAT REV OF BOARD I HAVE!!!! The "mounting" holes are big. Abou...
by rpdom
Mon Jun 03, 2013 4:46 pm
Forum: Troubleshooting
Topic: Kernel BUG (Oops) issue with USB LAN dongles (DM9601 driver)
Replies: 11
Views: 7612

Re: Kernel BUG (Oops) issue with USB LAN dongles (DM9601 dri

The board inside mine appears to be identical to the one labelled KY-RS9600 in your pictures, although it is labelled as SR9600 NO: 030818 MADE IN CHINA. The USB ident is "Kontron (Industrial Computer Source / ICS Advent) DM9601 Fast Ethernet Adapter". I have one in black plastic and one in blue. I'...
by rpdom
Mon Jun 03, 2013 4:14 pm
Forum: General discussion
Topic: My raspberry doesn't boot
Replies: 19
Views: 2263

Re: My raspberry doesn't boot

If you still get the "Greetings" message, you can fix that by putting "avoid_safe_mode=1" (without the " quotes) in the config.txt file. It shouldn't be needed, but for some reason it looks like your Pi does need it. My board is a type B 2 (with two holes). "grep Rev /proc/cpuinfo" return "Revision ...
by rpdom
Mon Jun 03, 2013 3:55 pm
Forum: Troubleshooting
Topic: Kernel BUG (Oops) issue with USB LAN dongles (DM9601 driver)
Replies: 11
Views: 7612

Re: Kernel BUG (Oops) issue with USB LAN dongles (DM9601 dri

Yes, the DM9601 devices do cause an oops when under any significant loading. I have a couple of them for my model A's. It is annoying :( It may be something to do with the fact that the interfaces I've got are only USB 1.1 (they say they are compatible with USB 2.0 and they are because 2.0 can handl...
by rpdom
Mon Jun 03, 2013 8:51 am
Forum: Gaming
Topic: Angry Birds Pi Edition
Replies: 52
Views: 8992

Re: Angry Birds Pi Edition

mrpi64 wrote:but isn't there at least ONE arm processor in a phone/ipod.
Probably, but which ARM processor, and what other hardware and which OS?
by rpdom
Mon Jun 03, 2013 8:49 am
Forum: General discussion
Topic: Pi turning off?
Replies: 5
Views: 845

Re: Pi turning off?

The first thing you need to find out is why it is happening. It would be good if you could get a screen connected to your Pi so you could see if there are any messages where it does disconnect from your network, and a keyboard too so you can see if it still responds. Otherwise you could check the va...
by rpdom
Mon Jun 03, 2013 8:38 am
Forum: Beginners
Topic: Strange occurrences with my Pi.
Replies: 23
Views: 1825

Re: Strange occurrences with my Pi.

I'm a bit fuzzy on ip forwarding and internet connection sharing and all that, but I did once do it on a Linux box using network bridging. I had to install some bridging software and add some entries to my /etc/network/interfaces. I had eth0 and wlan0 set up as well as a virtual interface called br0...
by rpdom
Mon Jun 03, 2013 8:30 am
Forum: C/C++
Topic: registers on pi?
Replies: 5
Views: 1332

Re: registers on pi?

I just got my pi and am excited to get started. I was wondering if there are any registers or eeprom on the pi I can access from C++? You seem to be approaching this problem as if the Pi were a microcontroller like a PIC or Arduino. It isn't. It is a full computer running a proper multi-tasking OS....
by rpdom
Mon Jun 03, 2013 6:37 am
Forum: General discussion
Topic: cable not connected
Replies: 2
Views: 976

Re: cable not connected

In addition to what mahjongg said, what adaptor are you using. Is it a HDMI to VGA adaptor with a separate power supply, or an HDMI to DVI cable or something else?
by rpdom
Mon Jun 03, 2013 6:22 am
Forum: Troubleshooting
Topic: SOLVED: :-( - My First PI wont boot
Replies: 16
Views: 1944

Re: :-( - My First PI wont boot

Yes it looks like the card inserted switch is closing and you cannot physically insert the card any further. The pins all appear to be up and making contact from what I can tell. Did you try holding the card against the contacts with a finger and thumb on top and bottom of the board, then powering ...

Go to advanced search