Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Linux


Reply
 
Share Thread Tools Display Modes
Old 05-20-2009, 07:59 PM   #31
Maximum Bitrate
 
PaulF's Avatar
 
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
PaulF is on a distinguished road
Seems like you don't fully understand what DNS does...

When you type a URL in to a web browser or any other program, it goes out to a DNS server which in a home-type environment would be a server owned by your ISP or in a corporate environment, the company usually has its own DNS server.

So
Step 1: type in URL
Step 2: it calls up the dns server
Step 3: the dns server sends the computer the ip address setup for that domain
Step 4: the browser now requests the web page from that ip address
Step 5: apache checks to see if the domain name matches any domains set up on the server
Step 6: apache connects the browser to the appropriate virtual host.

So by setting a domain name on the web server, you effectively do absolutely nothing, without a record set up in the DNS server. With that said, you have some options.

The easiest, but possibly least effective, method is to edit the hosts file on whatever devices you know are going to access the web server. The hosts file is essentially a file which overrides the dns server for specific domain names. So right now I'm on a windows machine to edit my hosts file, I would browse to C:\Windows\System32\drivers\etc and open a text file which is called hosts. In there there are lines that look like this:
Code:
127.0.0.1 localhost

What that line says is: when someone tries to connect to the domain "localhost" connect them to the ip address 127.0.0.1

You can add a bunch of those lines if you want to, so on any computer you could add a line something like this... I'm using 192.168.1.102 as an example IP address for the sheeva.
Code:
192.168.1.102 www.ibug.plug

Now, every time you enter www.ibug.plug into a web browser on the computer whose hosts file you just modified the browser takes you to 192.168.1.102.

Since Mac OS X likes to dumb things down, there is a GUI manager to do this task with the instructions found here: http://support.apple.com/kb/TA27291

Now I recognize that the place you really want to do this is on your iphone. To do this, the iphone needs to be jailbroken. Once jailbroken, you SSH into it and in either the /etc/ or /private/etc/ directory there is a hosts file. Use whatever text editor exists from the iphone terminal to edit it.

It should also be pretty easy to find on any other device/operating system.
__________________
My Car (Just the audio install as of now)
http://paulfurtado.com/car/

Worklog:
http://www.mp3car.com/vbulletin/work...-work-log.html

Planning 90%
Computer Build 88%
Programming 10%
Car Install 71%
PaulF is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 05-21-2009, 12:09 AM   #32
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,141
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
Quote: Originally Posted by PaulF View Post
Seems like you don't fully understand what DNS does...

I'd say that's accurate! I sort of understand the concept on the world wide web but I guess I thought that setting this in the config file would inform my home network router of the domain. Same way as it knows when I type 192.x.x.x that it shouldn't look outside of my network, but instead inside.

I suppose doing something like that requires me to change the settings in the router and give the plug a static IP?
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?
Bugbyte is offline   Reply With Quote
Old 05-21-2009, 05:53 AM   #33
Maximum Bitrate
 
PaulF's Avatar
 
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
PaulF is on a distinguished road
I doubt that your router will have a setting for it. If you want a domain name to be known to all devices on the network, you would have to set up your own DNS server on the network. The router might have one built in, but I have my doubts on whether there is a way to put your own values into it. The router, will definitely have a DHCP server in it, the DHCP server informs all of the computers on the network what they should use as an ip address, the subnet mask, the gateway, and the dns servers. Remember how I said before that companies have their own DNS servers? You can set up the sheeva plug as a DNS server, then set it as the DNS server in the router and restart/reconnect all devices using the router. From then on, all the devices would look to the sheeva for a list of addresses and would see any custom addresses you put in.

If the sheeva is a server of any sort, it should definitely have a static IP.

There might be a way to do this by using the OpenDNS service. I'll check it out when I get home.
__________________
My Car (Just the audio install as of now)
http://paulfurtado.com/car/

Worklog:
http://www.mp3car.com/vbulletin/work...-work-log.html

Planning 90%
Computer Build 88%
Programming 10%
Car Install 71%
PaulF is offline   Reply With Quote
Old 05-21-2009, 01:56 PM   #34
FLAC
 
Join Date: May 2006
Location: Calgary, Alberta
Posts: 1,541
Maheriano will become famous soon enoughMaheriano will become famous soon enough
The plug will always have a static local IP which you can use if you're trying to run it from the local network, and as long as you don't keep plugging/unplugging devices into this network causing the IP to get rearranged.

After that you can set up bind9 to completely manage your DNS for you locally on top of Apache.
__________________
Ampie Case
2.5" Hard Drive 80GB Samsung 5400RPM
256 MB DDR2 PC5400
Xenarc 700TSV - VGA Monitor
Intel D945GCLF Motherboard
M2-ATX-HV

2005 Honda Civic
Maheriano is offline   Reply With Quote
Old 05-21-2009, 04:55 PM   #35
Maximum Bitrate
 
PaulF's Avatar
 
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
PaulF is on a distinguished road
How is the Sheeva connected to the internet? What other devices are on this connection? How is it all hooked up?

There may be an easy way out of this.
__________________
My Car (Just the audio install as of now)
http://paulfurtado.com/car/

Worklog:
http://www.mp3car.com/vbulletin/work...-work-log.html

Planning 90%
Computer Build 88%
Programming 10%
Car Install 71%
PaulF is offline   Reply With Quote
Old 05-25-2009, 02:05 PM   #36
Constant Bitrate
 
Join Date: Aug 2007
Location: Northern VA
Posts: 125
cgalpin is an unknown quantity at this point
Bugbyte, are you planning on using a router in the car too, or making the sheevaplug the center of the universe and being the router as well? If it's going to be the center of the universe for the car, you'll want to install a dhcp server and dns server on it as PaulF says. But if you give us more info we can give better advise.

I think either way you will want to configure it to have a static IP. To do this with debian/ubuntu, edit /etc/network/interfaces and add something like

auto eth0
iface eth0 inet static
address 192.168.1.12
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.11

Until you have a dns server in the environment you are using this in, you can an entry in your hosts file to map names to IPs. I have not hacked my iphone so I don't' know if it's the same as regular OSX (but should be) but edit /etc/hosts and add

192.168.1.12 whatever.the.name.youwanted.was

I'm going to try pay attention to this thread and your iphone one and perhaps get a shivaplug as well since I am very interested in this as a permanent "always on" carputer and then using others to boot up when the vehicle is running (maybe using tftp even) to provide additional services.

If anyone has info on good DC-DC power supplies to provide 3v and 5v to multiple devices please let me know. It seems you'll need a powered hub at a minimum to do anything useful with this.
cgalpin is offline   Reply With Quote
Old 05-26-2009, 12:31 AM   #37
High Voltage
 
blk02si's Avatar
 
Join Date: Jul 2005
Location: Motorcity
Posts: 1,966
blk02si will become famous soon enough
I must ask: why even bother using DNS if its a simple internal network?

Just hit the server directly with the IP address, bookmark it in a browser.

using direct TCP/IP will be faster than doing a DNS lookup even if it is local, since hitting the IP direct will essentially cut out a few networking steps

Cool device BTW!!

Also remember to open up port 80 for the server IP in your router so the iPhone can access the web server.
__________________
Build Things, it keeps your brain busy.

AutoPC v1 (Retired) - AutoPC v2 (in progress) - www.shocknet.us
blk02si is offline   Reply With Quote
Old 05-26-2009, 12:58 PM   #38
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,141
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
You know, mainly for the 'cool' factor. I thought it would be neat to have the Sheeva named rather than put in the IP. Also, I was worried that if I set up everything based on the I.P. that it might get rearranged at some point in the future and thus by looking up the name rather than relying on the IP, it wouldn't 'bust' stuff in the future.

Right now the Sheeva is plugged directly in to my WiFi router. It is issued an IP from the router. Some of the computers on my network are also plugged into the router, but others access it via the WiFi connection. I haven't noticed any differences in accessing the Sheeva from A) a wired connection; B) a WiFi connection; C) a terminal program on my iPhone; D) the browser of my iPhone. All work identically.

For in-car setup, I intend to have the following:
1. Sheeva plug
2. WiFi router
3. USB hub with devices attached

An alternate setup would use a USB WiFi dongle instead of the router.

The Sheeva will function as the center of the car hotspot. It will:
1. Serve web pages to the iPhone
2. Run php (possibly java) or Perl
3. Interact with the USB devices

The purpose will be to allow control of and interaction with external devices from the iPhone, preferrably from a web page or simple java app.

The Sheeva will do the work of interfacing and translating inputs and output to/from the iPhone. Effectively, it will be an iPhone server.
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?
Bugbyte is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 05-26-2009, 01:15 PM   #39
Constant Bitrate
 
Join Date: Aug 2007
Location: Northern VA
Posts: 125
cgalpin is an unknown quantity at this point
I think it would make the most sense to use a usb wifi dongle (and bluetooth even) instead of also having a router since it really isn't needed. You'll want to have the sheevaplug be the dhcp and dns server which are both easy to do. Once you have that setup you can use a name as well.

I assume once the ad-hoc wifi network is in place, the sheeva can use the iphone for network access as well which would be pretty cool.

I personally would use python before java, but perl or php should do fine as well.

Time to order a sheevaplug and a FusionBrain for myself I think

charles
cgalpin is offline   Reply With Quote
Old 05-26-2009, 02:28 PM   #40
High Voltage
 
blk02si's Avatar
 
Join Date: Jul 2005
Location: Motorcity
Posts: 1,966
blk02si will become famous soon enough
That's awesome, nice integration.

I would still run static IP's assigned to specific MAC addresses, it will never get rearranged that way. It will also filter out would be war drivers from hacking your bug in the parking lot

I however cannot deny the coolness factor with giving your CARNET server a name.
__________________
Build Things, it keeps your brain busy.

AutoPC v1 (Retired) - AutoPC v2 (in progress) - www.shocknet.us
blk02si is offline   Reply With Quote
Old 05-26-2009, 05:28 PM   #41
Maximum Bitrate
 
PaulF's Avatar
 
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
PaulF is on a distinguished road
Okay... on the server, you won't be able to control the devices using php directly. You will need a program running on the server written in a "real" programming language such as C, C#, C++, Java (don't do it), mono, or others too. It will maintain the connection to the fusion brain, and then PHP will need to talk to that program to control it.
__________________
My Car (Just the audio install as of now)
http://paulfurtado.com/car/

Worklog:
http://www.mp3car.com/vbulletin/work...-work-log.html

Planning 90%
Computer Build 88%
Programming 10%
Car Install 71%
PaulF is offline   Reply With Quote
Old 05-26-2009, 05:42 PM   #42
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,141
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
Quote: Originally Posted by PaulF View Post
Okay... on the server, you won't be able to control the devices using php directly. You will need a program running on the server written in a "real" programming language such as C, C#, C++, Java (don't do it), mono, or others too. It will maintain the connection to the fusion brain, and then PHP will need to talk to that program to control it.

Right. I sort of left that out. I'll need some type of daemon that can respond to commands. For example, gpsd will respond to queries for position data from a script or program. It serves as the go between for the app and the device.

Quick question - why not java?
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?
Bugbyte is offline   Reply With Quote
Old 05-26-2009, 05:44 PM   #43
Constant Bitrate
 
Join Date: Aug 2007
Location: Northern VA
Posts: 125
cgalpin is an unknown quantity at this point
You can use good old exec with php. It's as real as any other programming language out there

But Kevin of the LinucICE team wrote a dbus daemon for it, and he could use php-dbus

http://code.google.com/p/php-dbus/

I would use something like django (python) with an iphone optimized template for the pages I think before getting too heavily invested in php for it though.

It might be worth learning ruby (and rails) for as well.

charles
cgalpin is offline   Reply With Quote
Old 05-26-2009, 06:11 PM   #44
Maximum Bitrate
 
PaulF's Avatar
 
Join Date: Jan 2008
Location: Dartmouth, MA
Posts: 517
PaulF is on a distinguished road
Java is slow, and linux support for java is annoying. It is possible to make it work, but it is just a pain in the neck. I've worked with java every day for over a year and it is a pain. It runs things in a half-compiled, half-interpreted form which is slow. Plus it's big and bloated.

Java seems fine on a full-powered computer, but only because computers are so fast now. On a device with a limited processor and memory, you might think otherwise.

If you like java though and aren't interested in quick responses, then java will work fine. The only issue will be memory consumption. You'll end up saying "why the hell is that process using up 20mb?"
__________________
My Car (Just the audio install as of now)
http://paulfurtado.com/car/

Worklog:
http://www.mp3car.com/vbulletin/work...-work-log.html

Planning 90%
Computer Build 88%
Programming 10%
Car Install 71%
PaulF is offline   Reply With Quote
Old 05-26-2009, 09:16 PM   #45
Constant Bitrate
 
Join Date: May 2008
Posts: 112
ThePistonDoctor is an unknown quantity at this point
I didn't read the rest of this thread so you may have already figured this out, but here is a simple Apache/PHP setup for attacking via SQL injection on OSX (which runs a Debian backend). I did this a long time ago so I don't remember too much about it, but there was a fantastic walkthrough on setting up Apache which I'm sure will be helpful. And if not, it will teach you a little about how you can use your carputer as a mobile hacking machine...lol

http://www.criticalsecurity.net/inde...c=27058&hl=php

BTW, I'm also using Jaunty on my carputer right now so I'm sure we will be able to help each other out with stuff as these projects progress!
ThePistonDoctor is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Frontend for Windows and Linux gbr Other Cool Front Ends 68 01-21-2009 09:55 PM
What is needed to make a mac run in a car? purplebluengree MacCar 1 03-11-2005 02:05 AM
Possible EPIA distro for Linux, Can we make one? adamis Software & Software Development 15 02-23-2005 06:50 PM
Those running Linux from CF, how to make bootable? eugenen Software & Software Development 1 11-10-2003 01:18 AM
mp3/ogg player for Linux? mpfreeze Software & Software Development 5 12-16-2002 10:35 AM



All times are GMT -5. The time now is 06:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics