#iptables forward an IP address to another

Using #iptables to forward a whole IP address to another (server)

iptables -A PREROUTING -t nat -d $src -j DNAT --to $dst
iptables -A POSTROUTING -t nat -d $dst -j MASQUERADE

Connections from anywhere to $src will get forwarded to $dst (though source IP will be changed to that of eth0 or default outbound device). Useful when moving servers; keeps the old address alive for a bit. Though we lose ‘real’ source address.

For example, if forwarding IP address used by an SMTP server, all email will appear to come from $eth0. If $eth0 (could be the same as $src, but not guaranteed) is privileged, in the sense that it is allowed to relay, then anyone will be able to relay through the SMTP server. But works in a pinch, while DNS changes are propogating through the ‘net.

A somewhat more concrete example. Say you have IP address 1.2.3.4; if you do

iptables -A PREROUTING -t nat -d 1.2.3.4 -j DNAT --to 8.8.8.8
iptables -A POSTROUTING -t nat -d 8.8.8.8 -s 1.2.3.4 -j MASQUERADE

1.2.3.4 is now forwards to Google’s Public DNS Server. You can now use 1.2.3.4 as if it were 8.8.8.8.

Two Theories of Disruption

Tags

, , , ,

#Gyan

There are two ways to think about the @claychristensen theory of disruption. New market disruption and low end disruption. @monkbent believes in the first but not the second.

#1 New market disruption: competing on different attributes than the ones held dear by the incumbent’s best customers. Example windows versus iOS.

“This remains an incredibly elegant and powerful theory, and I fully subscribe to it. We are, in fact, seeing it in action with Windows – the incumbent – and the iPad and other tablets; new technology that is inferior on attributes that matter to Windows’ best customers, but superior on other attributes that matter to many others. (My belief in this theory is why I have been, to my own personal surprise, more sympathetic to Steve Ballmer – here and here – than most).” — @monkbent

 

#2 Low end disruption: i.e. integrated versus modular.

In a vertical – proprietary tech is usually the best in the beginning in but over time modular becomes good enough.

Once an industry moves to modular – money moves to whoever controls the performance defining subsystem.

“…the move to open modular architecture just happens over and over again. It happened in the personal computer. Although it didn’t kill Apple’s computer business, it relegated Apple to the status of a minor player. The iPod is a proprietary integrated product, although that is becoming quite modular. You can download your music from Amazon as easily as you can from iTunes. You also see modularity organized around the Android operating system that is growing much faster than the iPhone. So I worry that modularity will do its work on Apple.”@claychristensen

Since Apple has been a consistent outlier – it’s not being disrupted by modular forces, people question the theory. One explanation that I find appealing is this: It’s who the buyer is. Modularization happens when the buyers are enterprises and the users are not the purchasers. In such a market, the value of ‘user experience’ is greatly diminished. On the other hand, in markets where the consumer is the user/buyer ‘UX’ rules. For examples mobile phones and BYOD. In such a market, there is no limit to quality of UX and consequently the integrated solution is much better than modular alternatives (for much much longer than otherwise? forever? IDK).

Another explanation for Apple is that it keeps changing the goal posts. It’s not just the components on the phone, but also the ecosystem. And then how that ties in with your desktop / laptop / car / house (all also made by Apple). So the integrated system is a much wider system and it will take longer for modularity to do its work. Note that this also appears to be Xiaomi’s strategy. Born in intense competition as it is…

Apple shipped 3x as much battery capacity as Tesla in 2014

Tags

, , ,

So, everyone’s talking about the possibility of an Apple iCar; it looks certain that it’s got something to do with batteries (Apple’s being sued for recruiting scientists from A123) and arch-rival (wannabe arch-rival?) Samsung just bought out a company that makes automobile batteries…

So I was thinking – who sells more batteries today? Apple or Tesla? And because it’s not quite Apples to Apples I’ll try comparing battery-capacity.

Apple Battery Capacity 2014:

  • approx. 180m iPhones; the iPhone 6 has a 7.9 watt-hour battery, while the 6+ has 11 watt-hours. Presumably a decent chunk of the 180m phones were older 5, 5s, 4 etc. So let’s say the average capacity per iPhone is 8 watt-hours. Total: 180m * 8 = 1440 million watt-hours (i.e. 1.44 GWh aka Giga-Watt-hours)
  • approx: 60m iPads; the iPad Air 2 has a 27.6 Wh battery, while the Air (1) had a 32.9 Wh battery. Let’s hand-wave and say 28 Wh average. Total: 60m * 28 = 1680 million watt-hours (1.68 GWh)
  • approx: 19m MacBooks; MacBook Air’s have between 38 & 54 Wh, Pro’s 63.5 to 91 Wh. Let’s say 54 Wh on avg. Total: 19m * 54 Wh = (1.02 GWh)

Apple also sold a quite a few other devices with batteries, remotes, iPods, Beats headphones, Wireless keyboards and watt-have-you (haha), but’s let’s ignore it for now.

 

So Apple shipped 4 GWh (1.44+1.68+1.02=4.14 GWh) of battery capacity last year alone. That’s about $2 billion (cost) assuming Apple has the same cost as Tesla for battery capacity. I’d argue that it’s lower, but who knows.

 

“Tesla Motors may have the lowest rates for electric car batteries; the estimated battery costs for Tesla Motors is around US$200 dollars per kWh.” — From <http://en.wikipedia.org/wiki/Tesla_Motors>

 

Now Tesla shipped 17,300 Model S cars (http://insideevs.com/monthly-plug-in-sales-scorecard/). They can have a 65kWh or 85kWh battery-pack. Say 75kWh on average. Total: 17.3k * 75kWH = 1.3GWh.

 

So there you have it. Apple shipped 3x as much battery capacity as Tesla in 2014.

 

Some more fun napkin math (let me know if it’s all wrong…): Apple’s batteries pack 25% more energy per gram than Tesla’ (so for the same weight, using Apple battery tech in Tesla’s could improve range by 25%!)

 

The iPhone 5s battery is 26g -> 7Wh 26g (26/7 = 3.7 g/Wh)

(http://www.ebay.com/itm/Original-1560mAh-3-8V-Li-ion-Internal-Replacement-Battery-for-iPhone-5C-5S-/201227137579?pt=LH_DefaultDomain_2&hash=item2eda12722b)

 

Tesla cells are : 10Wh 45g -> (45/10 = 4.5 g/Wh)

(http://industrial.panasonic.com/lecs/www-data/pdf2/ACI4000/ACI4000CE17.pdf)

 

Apple’s batteries probably charge faster too (assuming that you can parallel charge the 1200 or so MacBook Air batteries that make up a single Tesla sized 65kWh pack).

 

Also interesting: Batteries like memory are super-high-margin. Like 60-70% gross.

 

Disclosure: I’m long Apple (+ve net delta) and have no position in Tesla.

$MU

Just putting this out here:

Recommended $MU on Oct 20 @ $29.69 (right here on this blog)

It’s up 11.5% to $33.08 since then (10 days).

image

I’m going to be replacing my stock with some PUTs. Perhaps 1/4th my position. +ve delta and theta.

And it turns out the scuttlebutt was right, the iPad Air 2 has 2Gb of RAM. (And a unexpected, to me at least, 3rd core)

Can anyone think of a reason why DRAM demand would fall from here on?

$MU, time to buy?

  1. Apple is one of the largest consumers of RAM (and a key customer for Micron via Elpida); It’s been tipped in the past, that Apple could make up as much as 25% of the world’s demand for DRAM.
  2. The iPad Air 2 looks like it will have twice as much DRAM as before (the iPad Air has 1GB)
  3. Apple’s been up’ing the base RAM across much of its Mac line
  4. And iPhone 6(+) sales are looking robust
  5. So, DRAM demand looks solid
  6. About 70% of Micron’s revenue is DRAM.
  7. Micron’s PE is 11.64; which is pretty low.
  8. The big risk is that while demand for DRAM is growing crazy fast, supply if growing equally fast.

 

Perhaps it’s time buy some (more) MU?

 

Disclosure: I am long $AAPL and $MU

Humor: Too smart for our own good

Tags

,

*NOTE: This collection of short jokes will only make sense if you speak Hinglish.

Boy: What’s your Name??
Girl: Palak and you?
Boy: Paneer
*BLOCKED!!!*

Girl: Hello i am Khusbu
Boy: khusbu ka dusra naam bharosa agarbati….kone kone me khusbu faila de
*BLOCKED!!!*

Boy: Hi, whats ur name??
Girl: its Neha Singhal.
Boy: oh. . M also Single.
*BLOCKED!!!*

Girl: What’s Up?
Boy: Uttar Pradesh.
*BLOCKED!!!*

Girl: tu soya hai…??
Boy: Nahi…! Schezwan hu..!
*Gets Blocked Instantly*

Girl: I’m free tommorow!
Boy: pehle kya paid thi??
*BLOCKED!!!*

Boy: Aaj mausam achha h mall chalte h.
Girl: waha kya karenge??
Boy: hawan karenge, hawan karenge.
*BLOCKED!!!*

Girl: see ya!
Boy: Var Ram chandar ki jai !
*BLOCKED!!!*

Girl: Have a Good Day.
Boy: No thank you… I like Parle-G more.
*BLOCKED!!!*

Girl: I need some Space.
Boy: Ok then go to Sonakshi Sinha’s forehead.
*BLOCKED!!!*

Girl puts up her status : “waiting for CHENNAIEXPRESS “.
Boy: COOLIE hai kya? ?
*BLOCKED!!!*

Boy: Thank you
Girl: My pleasure
Boy: My Bajaj Pulsar
*Reported as spam* *Blocked Forever*

After fight:

Girl: Tum mujhe manaate hi nahin!
Boy: Tum kya ho? Diwali ho? Ya Holi?
*BLOCKED!!!*

Apple getting hammered today (3-Sep-14)

Tags

Possible reasons:

iCloud Leak: A lot of celebs had nude selfies stolen from iCloud. (NSFW) example. (Apple PR). This story was catching fire for at least a couple of days before today though. For instance, Business Insider, dated Monday 1-Sep-14, 4.55am.

People could be jittery too; Apple has risen quite bit (~45%) this year. Perhaps people just want to get out before Sep 9?

Or it could be IFA
Basically every other device maker, showing off their latest & greatest

  • Samsung Galaxy Note 4 ‘egde’ looks interesting….
  • Gear S (the newest smart watch) also looks interesting…
  • Sony has a smart wearable too

Wonder if we’ll see a reversal tomorrow? Any other theories?

Be Specific

Diet

A blonde is terribly overweight, so her doctor puts her on a diet. “I want you to eat regularly for 2 days, then skip a day, and repeat this procedure for 2 weeks. The next time I see you, you’ll have lost at least 5 pounds.”

When the blonde returned, she shocked the doctor by losing nearly 20 pounds.

“Why, that’s amazing!” the doctor said, “Did you follow my instructions?”

The blonde nodded, “I’ll tell you though, I thought I was going to drop dead that 3rd day.”

“From hunger, you mean?”, asked the doctor.”

“No, from all that skipping.”

Moral: BE SPECIFIC

 

Wishes

A man got 2 wishes from GOD. He asked for the Best wine and Best Woman.

Next moment, he had the Best Wine and Mother Teresa next to him.

Moral: BE SPECIFIC

Funny One Liners…

  • Facebook: Roses are red, violets are blue, friend requests are awesome, but who the fuck are you??
  • Don’t feel bad. A lot of people have no talent.
  • Regular naps prevent old age, especially if you take them while driving.
  • I believe we should all pay our tax with a smile. I tried – but they  wanted cash.
  • You can’t buy love, but you pay heavily for it.
  • Laziness is nothing more than the habit of resting before you get tired.
  • Bad officials are elected by good citizens who do not vote.
  • Having one child makes you a parent; having two makes you are a referee.
  • Marriage is a relationship in which one person is always right and the other is the husband!
  • A child’s greatest period of growth is the month after you’ve purchased new school uniforms.
  • Don’t marry the person you want to live with, marry the one you cannot live without, but whatever you do, you’ll regret it later.
  •   Marriage is give and take. You’d better give it to her or she’ll take it anyway.
  • My wife and I always compromise. I admit I’m wrong and she agrees  with me.
  • Those who can’t laugh at themselves leave the job to others.
  • Ladies first. Pretty ladies sooner.
  • A successful marriage requires falling in love many times, always with the same person.
  • You’re getting old when you enjoy remembering things more than doing them.
  • It doesn’t matter how often a married man changes his job, he still ends up with the same boss.
  • Real friends are the ones who survive transitions between address books.
  • Saving is the best thing. Especially when your parents have done it  for you.
  • Wise men talk because they have something to say; fools talk because they have to say something
  • They call our language the mother tongue because the father seldom gets to speak!
  • There is only one perfect child in the world and every mother has it.

Funny programming quotes

Tags

“If Java had true garbage collection, most programs would delete themselves upon execution.”
-Robert Sewell

s/Java/php|perl|whatever/g

 

“C++ : Where friends have access to your private members.”
– Gavin Russell Baker

 

“If debugging is the process of removing bugs, then programming must be the process of putting them in.” – Edsger W. Dijkstra

Follow

Get every new post delivered to your Inbox.

Join 221 other followers