Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Saturday, October 15, 2011

wmii ubuntu 11.10 (Oneiric Ocelot)

The default gcc compiler now requires linked libraries to appear after the source file
gcc example.cpp -lsomelibrary
wmii build files have the shared libraries located before the source files, and thus can not be easily built with the default configuration.
To build wmii I updated the config.mk to use gcc-4.4 for the compiler
CC = gcc-4.4 -c
LD = gcc-4.4
This allowed the project to compiled with the following command:
dpkg-buildpackage -rfakeroot -us -uc -b

Thursday, September 29, 2011

Fix clang errors in ubuntu

In natty clang needs some the headers that are not included in ubuntu. To get clang to work use the following:
sudo ln -s /usr/include/c++/4.5 /usr/include/c++/4.4

Friday, February 19, 2010

Bonjour

Group 4: iOrder for restaurants. After evaluating the project risk in class, we came up with the following potential risk: Server Client: Can we use the iPod touch to connect to a server? how hard is it? UI Feasibility: Can we create a user interface that is fast enough to place orders? The biggest risk for our group project is that we need to have a server and client. After doing our risk evaluation in class we started to work on trying to tackle this issue. Prof of Concept: I worked on trying to get the iPod touch to communicate with a server. I took some server client code that I used from a previous school project and tried to port it over to the Ipod. This was not as difficult as I expected. The iPhone SDK natively supports c, c++, objective c/c++. The client code I had was written in c++. I was able to copy it into the project in Xcode and have it compile without any modifications. Using the code from objective-c was more difficult. I had to rename the extension of the file that was using the class from *.m to *.mm. After this I could call the c++ code without any problems. I was actually impressed at how objective-c++ can keep track of both objective-c and c++. I had overloaded operators in my clientSocket class and they worked just fine. I was able to connect both the iPod touch and a linux server and send unencrypted data back and forward. I saw a potential problem setting up the server address in the client though. We really don't want people to have to enter the ip address of the server and port number in order to connect to the server. If for some reason the server goes down and comes back with a different address, having to go trough and change many iPod touches to reflect these changes would be a hassle. This got me thinking: iTunes automatically shares music libraries across a network. It does some magic and automatically the libraries of anyone on a network are shared with everyone else. Can our group do this? I looked around the Internet and found out how this magic is done. Apple uses a zeroconf protocol called bonjour. Bonjour locates devices such as printers, other computers, and the services that those devices offer on a local network using multicast Domain Name System service records (source). I was able to broadcast my server on a local network using avahi. Avahi is an open source implementation of bonjour (source). I was able to do it with the following steps in ubuntu: - run my server using port 5555. - create file in /etc/avahi/services/iorder.service with following contents
<?xml version="1.0" standalone='no'?>
<service-group>
  <name>iOrder Server</name>
  <service>
    <type>_http._tcp</type>
    <port>5555</port>
  </service>
</service-group>
avahi-deamon will now take care of broadcasting the service. To browse for services using bonjour apple provides the class NSNetServiceBrowser. I had a hard time getting this to work. I am not familiar with objective-c so writing code was very slow. The biggest problem I had was that after discovering a service(by name) it needs to be resolved to get the ip address and port number. When a service is found, the method
(void)netServiceBrowser: ...didFindService ( NSNetService* ) service moreComing: ( BOOL )more
is called and a request needs to be done to resolve the address:
[service resolveWithTimeout:5.0]
but for some reason it can't be called on the service that is being passed by the didFindService method. It needs to be a new service. It took a very long time to figure this out. I spent hours looking at my code and examples trying to figure out why it was not working. I was able to get networking/bonjour working on the prof of concept app. It automagically finds the server and connects to it. It does take a few min to resolve the address and port but these can probably be saved until they are no longer valid. In conclusion, having a server client is not a huge risk, although we will need to be careful moving forward.

Wednesday, December 23, 2009

Getting started-a free operating system

So your operating system (OS) is basically the backbone of your computer. It's what allows your software (why you can create a report in Microsoft Word) to tell your hardware (like the central processing unit or CPU) what to do.  Most desktop pc's (personal computers) work from the Windows family of operating systems; if it's a Macintosh then they work off the Apple OS.  Without an OS your pc would be pretty much worthless because there would be no operating system telling it that you want to play music for example.  Now, the two operating systems I just mentioned aren't free and will cost you anywhere from $30 dollars (for the Mac single user operating system called 'Snow Leopard') to $79.95 (for a Windows 7 Upgrade; $119.99 for Windows 7 Home Premium).  As someone who's always been interested in computers but never quite understood why there were only 2 mainstream companies in the OS business, imagine my happiness when I found out that this whole 'paying for an operating system' scheme was a...well, scheme!

You mean to tell me I don't have to pay for that stuff?  Ok, let me clarify.  If you want a Windows or Apple OS then, yes, you legally must pay for it.  So then what do I mean by a free operating system?  I'm glad you asked, let me introduce you to a little concept called 'open source'.

Open source, in a nutshell, is free software-but it's not just free because you don't have to buy it. Everything about it is free-how it's made is free, being able to download it is free, making changes to it is free....

Open source is owned by no one individual nor any corporation. Think of open source as 'free speech'-it's something available to everyone and owned by no one.

Say you find out how Microsoft Word is made, and you have some ideas for improvement-so you make changes to the software and then tell everyone how to make those same changes on the internet. You would get sued in a heartbeat by Microsoft because they legally own Microsoft Word.

But with open source, what you have is a community of computer developers who are constantly improving and progressing open source software on a daily basis-not because they're being paid by a company and it's their job but because they simply love to do it.(for a more detailed explanation of open source I've provided a link here). In the long term, if you want stability and are even thinking about wanting to install software that doesn't cost you hundreds if not thousands in the long run, then don't buy into major marketing campaigns because open source is the way to go. For each and every $4,000 dollar software program (like...maya) there is an equivalent open source program (like..blender), but more on open source software in later posts...

With that introductory understanding of how free and open source are connected, let me get back to open source operating systems and one in particular called Ubuntu.

Ubuntu is one of many, many different open source operating systems available.  Distrowatch is a website dedicated to maintaining a list of all the different distributions of open source operating systems.  You can think of a distribution as a set of programs and applications running on top of the Linux kernel (think of a kernel as the foundation of an OS, but don't get overwhelmed, this is just an introduction & we'll talk about Linux & kernel's later).  Different distributions serve different purposes.   Some distributions are designed  for very small computers (like your PC or laptop), while others are designed for larger servers (think of the FBI's computer system). The software programs that are included with each distribution also vary from one distribution to another.

Currently the most popular OS distribution for personal computer's is Ubuntu.  Canonical, the company behind Ubuntu, has made great strides in developing Ubuntu with the help of the open source community.  They have focused primarily in developing an operating system that is secure which means free from viruses, simple and easy to use & install, but also maintains of all the powerful features needed by advanced users.

Getting started with Ubuntu is very simple and you have a couple of options for how you want to install it.  There is the installation cd for Ubuntu which comes with a live cd that allows users to try out Ubuntu without  having to change anything on their computer.

You can order the desktop edition CD here from Ubuntu's website and they will ship it to you free of charge. Or you can just try out Ubuntu by heading over to their website and downloading it here or if you have Windows then the installer is here.

Look, by no means am I a "fan boy/girl" nor do I claim to know everything there is about computers, but I'm all about efficiency and if something is free and all I have to do is install a few things in order to save a couple of hundred if not thousands of dollars in the long run...then call me cheap, but definitely not stupid!

Next up, an open source word processor, spreadsheet, and other (free) software for your computer!