Two weeks isn't a ton of time, so I'd stick around SF with some short trips down to the Peninsula. Here are some ideas:
SAN FRANCISCO
1. Mission
Get off at 24th st BART and start at Ritual Coffee. Walk down Valencia street toward 16th st BART station and stop into the variety of stores. At lunchtime go to 18th street and grab a sandwich from Bi-rite -- eat it at Dolores park nearby. At night go to The Chapel and see what's playing, you might be able to get tickets. If not, try stopping by Noisebridge (google it!)
2. FiDi
Start at Philz (300 Folsom) and walk to the Google @ Spear St. If you know someone there you can get a tour. If not, you're now standing near the base of the Bay Bridge and it's quite beautiful. Mozilla is right next door as well if you want a tour. They have a nice monument outside their office. Walk away from the Bay Bridge toward the Ferry Building, and get lunch there. Take the Ferry to Sausalito and work from there in the afternoon -- get dinner there and catch a ferry back to SF. Alternatively you can stick around downtown. If you know someone at Salesforce they are right in the area as well.
Night: Try hitting up some local bars for drinks. Some popular ones include Local Edition, Novela, and Rickhouse.
Bonus: Go see a giants baseball game. It's super cheap and really fun. https://seatgeek.com/san-francisco-giants-tickets?oq=SF+gian... -- the cheap seats high up are the best. You get a great view and you can eat stadium snacks while watching an inconsequential baseball game.
I'm assuming others will give you more tips about San Francisco + tourist stuff, so I'll move on to the Peninsula.
PENINSULA
1. Palo Alto
Take Caltrain from 4th and King in San Francisco to the Palo Alto station. Get off and walk down University Avenue. There are lots of coffee shops you can work from (Philz is popular here). There's also lots of good food options. If you know someone who works at Palantir, their office is right here. Paxti's deep dish pizza is a local favorite and they have reasonable lunch specials. In the afternoon you can stop by Stanford Campus (it's on the opposite side of the Caltrain -- head back to Caltrain from University Avenue and walk down a palm-tree lined road). If you know someone there you can tour the insides of the buildings, otherwise the outside of buildings is nice too.
Night: Rose & Crown is an English pub that has pretty yummy food and is something different after a day of Palo Alto.
2. Mountain View
Get off Caltrain and walk down Castro street toward Red Rock Cafe. This is a non-profit cafe with free wifi and is a fantastic place to get some work done. For lunch there are myriad options -- just walk down Castro street some more, you can't quite go wrong.
If you have friends at Google you should ask for a campus tour, as there is a free shuttle from the Mountain View Caltrain to the Google Campus. Even if you can't get a tour inside the building, go to the campus and walk around. You can bike to Shoreline Park (there's a small lake there) and rent paddleboats / kayaks.
You can also visit Y Combinator HQ (320 Pioneer Way) but I'm not sure there's much to see.
For dinner I'd stay around Castro street as well. There are tons of great options. Afterwards try getting drinks at St. Stephen's Green or Tied House. Make sure you catch one of the Caltrains back to the city (they stop running at a certain time in the evening, probably around 11pm is the last train up from Mountain View).
3. Sunnyvale
When you get off the Caltrain head to Philz for morning work. Then for lunch go over to S. Murphy Ave -- if you don't know what you want to eat, Dish Dash is a local favorite. If you have friends at LinkedIn you should ask them for a tour here.
There's not much in Sunnyvale -- it's pretty suburban.
4. Menlo Park
I'm running out of steam so the basics here are -- Santa Cruz Ave is their downtown and there's a number of coffee shops to choose from. If you know someone at Facebook, get a tour, but it's not quite walking distance from Caltrain; I'd take an uber once you're in the downtown. Their campus is pretty cool...and their food is ridiculously yummy. Another interesting thing would be to go to Sand Hill Road and walk down -- you can see all the VC firms there. Not sure that's an interesting tourist thing to do, but it's something you can if you're interested.