Nov
11
2008
2

How to setup a free web development environment (mac)

It may seem like a lot, and when something doesn’t work, you feel violently pissed off. But, it feels SO good when it works.

1: Get apache to work.

Update your version of mac os and go into system preferences. That’s the thing with the gears - very important to your mac. Click Sharing under internet & Network. Now in that list of crap on the side, check Web Sharing. Do whatever seems right and when you’re done, go to your web browser and type in whatever they tell you to. And, yes, if your friend, who is using the same router as you, types http://192.168.something into their browser they will get your site. Pretty awesome huh. Wanna change it?

2: Changing your website, OMG html

Use your finder to open your folder (the one with your name on it) and then the folder called Sites. See that thing called index.html? That’s what’s you’re seeing when you go visit the web address. First rename it to index2.html or something. Now to edit it, you can do it in texteditor but please act like a pro and download a program specifically designed for it like Aquamacs. Now, simply open the file with aquamacs (right click and go under open with > *kangaroo deer thing* ). A lot of code to read and learn from if you want. Open a new file with aquamacs. Copy this:

<html>
<body>
<h1>WOOT!!!</h1>
</body>
</html>

Save as index.html in the folder Sites. Goto your site now. The one that has ~yourname in it. WOOT!!! Play around with it. Call yourself god. Whatever.

Just know that it’s not real programming until you get Php.

3: Php

I mentioned somewhere that I liked Php. You should too.

There’s a few ways to enable Php. Notice I said enable, not install (go macs). Here’s the cool kid’s way:

Open up Terminal. It’s under Applications>Utilities. Time to learn a bit of unix. Even if you don’t know what the hell’s going on, it’s really cool. By the way, the thing you’re in right now is called the Shell. Go to the folder you need to modify by typing in:

cd /private/etc/apache2/

First, you need to change php.ini.default into php.ini with this command:

sudo cp php.ini.default php.ini

Next, you need to modify httpd.conf so type:

sudo vi httpd.conf

Type in your computer login password (blank if there is none). Now type:

/php

This searches the text for the words php and you should get something like

#LoadModule php5_module        libexec/apache2/libphp5.so

Type (not copy):

aandy rules

Pressing a lets you edit the file. Now delete andy rules since it is not relevant. What you do need to do however, is delete the # (the numsign) in front of LoadModule…

Now Type:

esc

:wq!

Finally, in your shell, what you should be in right now, type

sudo apachectl graceful

That restarts apache so you have your php install online. It’s apachectl with a l for long by the way.

Now, go to Sites (don’t tell me you forgot how) again and rename index.html to index3.html. Open a new file in aquamacs and copy in:

<html>
<body>
<a href=”http://www.Internshipin.com”>Internshipin.com</a>
</body>
</html>

<?php echo “Rules!!!”;?>

<? phpinfo();?>

Almost done ><. Save in Sites as index.php and check your site again!

4: Mysql

This one’s pretty easy. Go here and download the mysql that matches your mac OS version. Click on the mac icon on the top left to find your OS version. Download and open the readme. Follow directions and install everything.

5: PhpMyAdmin

This thing’s really cool. Go here, download and extract it. Rename the entire folder into something simple like pma or phpmyadmin. Just get rid of the version number and stuff. Now, apparently, this phpmyadmin is not complete. Really stupid, I know. Open up a new file in aquamacs and name it config.inc.php. Save it in pma or whatever you renamed your phpmyadmin folder to be. It should contain:

<?php $cfg['blowfish_secret'] = ‘ae85mh04wq23′; // Enter a random string to be used for blowfish encryption
// Server(s) configuration
$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = ‘127.0.0.1′; // ‘localhost’ did NOT work!
$cfg['Servers'][$i]['connect_type'] = ’socket’; // ‘tcp’ did NOT work!
$cfg['Servers'][$i]['auth_type'] = ‘cookie’; // Using cookies is easiest and safest setup.
$cfg['Servers'][$i]['user'] = ”; // MySQL user - empty for cookies
$cfg['Servers'][$i]['password'] = ”; // MySQL password - empty for cookies?>

Move your folder to Macintosh>library>webserver>documents.

Reload apache again and now, when you goto http://localhost/pma, you should be able to see your phpmyadmin! Login as root with no password and make a user for yourself by going under priviledges.

My laundry’s done.

Written by Andy in: Knowledge, tutorial | Tags: , ,
Nov
09
2008
1

How to program

I had a really hard time figuring this out. I still probably don’t have it down completely.

First, what is programming?

People talk about programming as languages and they are literally correct. Learning programming is just like learning a language. You don’t know how to say something? Fine, write it down in English or whatever language you know and search for ways to express what you want to do. If your still screwing up, then you just have crappy grammar. It’s not like the SATs or anything, just fix your mistakes and you’ll get a 2400.

What requirements are there?

You don’t need to be a genius or anything. Always remember to look things up when you need it and life will go on. NEVER try code stuff without searching for a better solution first. Chances are, the function you’re looking for is already defined. If you think the function should be defined then it is defined.

How to start:

Most people and schools start with Java or C++ or Scheme. Sure, people can plow through manuals and learn Java or C++, in a couple of months. The thing with these languages is that they are very powerful but more useful for hardcore programmers. I believe that it would be better to learn a web development language such as Php first. It is simple, it can get you a job in lots of places, and you can use it to actually make something useful - namely a website.

Written by Andy in: Knowledge, tutorial | Tags: , ,
Nov
08
2008
0

Internshipin

Internshipin is the latest company that I’ve worked on. It got started quite fast and I learned a lot from it. Here’s practically how it started.

Two weeks after moving into Berkeley, I met Jessica Mah. After finishing our discrete mathematics howework that day, we started talking about making a company. Pretty soon, we drew out an outline for internshipin and got started.

Within a week, we had a rough search and employer posting page ready. We then rented a $160 server from Softlayer and pumped out more of the code. With midterms and homework bogging us down, we took a month to make the first beta and released it to employers.

The main thing is publicity. We had like 6 postings signed up and 1 paying internship. It wasn’t until the techcrunch post that we actually had people on our site. The moral here - know lots of people like Jessica and if you can get them to write a post about your site, great things will happen.

Written by Andy in: Business, School | Tags: ,
Nov
08
2008
0

Meeting people

Today, Jess and I went to a private party hosted by Andreas Weigend, a stanford professor. There, I met lots of really smart and admirable people in tech. Everyone seems really smart and their work were all so fascinating. I haven’t met so many interesting people in one night since SIMUW. I quickly realized that in order to be remembered, I must do something great in the tech world. Easier said than done. Well, first I’d better fix all the bugs in Internshipin.com

Written by Andy in: Uncategorized |
Nov
05
2008
1

What have I learned???

From School:
High school
1: Calculus (somewhat useful, easy concept people just don’t know how to teach.)
2: Chem, Physics, Bio - Oh yeah, very useful. Well, maybe Bio for chatting up about global warming.
3: 300 ways not to write an essay (haven’t found a way to write a good one yet).
4: How bad it feels when a know it all beats you on a test.

College (so far)
1: Multivariable Calculus - again, really impractical.
2: Memristors - really cool concept but not very great to learn about.
3: Scheme - interesting but outdated.
4: Proofs - you decide, a hobby or a nightmare.

Side Project
1: some below basic degree of unix.
2: installed apache, unfuddle, subversion, and enough stuff on the server.
3: Php
4: Some level of design.
5: Scalability.
6: Murphy’s Law - internshipin server went down as I type.

I need to go.

Written by Andy in: Knowledge, School | Tags: ,
Nov
04
2008
0

Experiences

Well, so far I haven’t really gone far in tech. As an average Asian, I’m quite good at math and science. Placed a couple of time in math competitions like Mu Alpha Theta and stuff. ARML was lots of fun even if I sucked. Got a couple of medals in Science Olympiad. Oh ya, I pretty much single handedly defeated the winners of the Science Bowl 2008 competition in Washington. Why are they the winners? Cause it was double elimination and they crushed us 96 to 14 or something later - on stage.

Now I’m in berkeley. Dying this semester because I have English R1B - very painful.
A schedule I suppose:
English R1B - I’m terrible with essays.
Computer Science 61a - I suck at tests. Why?
Computer Science 70 - SIMUW pretty much taught me most of it.
Math 53 - eck, not too bad. Should probably attend lectures more often.
EE42 - NEVER TAKE IT WITH CHUA.

We’re currently learning probability in CS70 and random useless crap in EE. I’ll talk more about the useful stuff we learn in later posts.

Written by Andy in: School | Tags: ,

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes