background preloader

Suryaahuja

Facebook Twitter

Surya Ahuja

Java basics: a tutorial for beginners. If you have ever wanted to write your own Android app, for fun or for profit, you are probably going to need to do some programming. There are lots of different ways to write Android programs but the official language of Android is Java. If you don’t want to try your hand at Java, then I would recommend you read my article: I want to develop Android Apps – What languages should I learn? Not only is Java the official programming language for app development, Java itself is used by Google for large parts of the Android internals. There are two distinct parts to writing an Android app. One is the Java programming language itself, the other is understanding how to create an app in terms of its user interface, the Android OS, and the Android Software Development Kit (SDK). To start writing Java programs you need a way to compile source code and turn it into an executable for the Java runtime.

Java was first released in the mid-1990s by Sun Microsystems. And save it as HelloWorld.java. Strings. The Linux socket, TCP/IP protocols and client-server network fundamental concepts and model background story. From the Application layer of a computer at company A go downward the layer until the Physical (medium such as Cat 5 cable) layer, then exit Network A through the Network (router) layer in the middle of the diagram.After traveling through the carrier, reaches at the Network (router) layer of company B, travels through the Physical layer, goes upward until reaching at the Application layer of the computer at company B.

…Continue on next Module…More in-depth discussion about TCP/IP suite is given in Advanced TCP/IP Tutorials. The ultimate SO_LINGER page, or: why is my tcp not reliable. Edit The ultimate SO_LINGER page, or: why is my tcp not reliable Posted by bert hubert on 01/18/2009 This post is about an obscure corner of TCP network programming, a corner where almost everybody doesn’t quite get what is going on. I used to think I understood it, but found out last week that I didn’t. So I decided to trawl the web and consult the experts, promising them to write up their wisdom once and for all, in hopes that this subject can be put to rest. The experts (H. Willstrand, Evgeniy Polyakov, Bill Fink, Ilpo Jarvinen, and Herbert Xu) responded, and here is my write-up. Even though I refer a lot to the Linux TCP implementation, the issue described is not Linux-specific, and can occur on any operating system.

What is the issue? Sometimes, we have to send an unknown amount of data from one location to another. “TCP provides a reliable, stream-oriented, full-duplex connection between two sockets on top of ip(7), for both v4 and v6 versions. The right answer, sadly, is ‘D’. How come? Which Programming Language Should I Learn First? CCIE Practical Studies: Configuring Route-Maps and Policy-based Routing > Route Map Overview. Perhaps one of the most colorful descriptions for route maps is that route maps are like duct tape for the network—not necessarily because they can be used to fix or mend something broken, but because they can be applied to numerous situations to address many issues. At times, they may not be the most "pretty solutions," but they will be very effective. After you learn to configure and use route maps, you will soon see why some engineers refer to them as route tape.

In policy-based routing (PBR), for instance, you may use a route map when traffic has to follow a particular path through the internetwork. This path may differ from the path the routing protocol wants to forward traffic on. PBR, along with route maps, enables the network engineer to essentially override the route table and influence which way traffic flows. You also can apply route maps in a number of ways. Route maps are much like the "If . . . Example 2-1 Route Map Logic Example 2-2 Route Map Function During Redistribution. How I Hacked Ola, India's Biggest Startup. This post originally appeared on Medium. A few weeks ago I was monitoring my phone traffic from a proxy server. While doing that I saw Ola API calls going from my phone (since I was booking a cab). For those who don’t know about Ola, Ola Cabs is the biggest cab provider in India and also biggest competitor of Uber (again in India). It has raised $500 million in funding, and processes 150,000 bookings a day.

After seeing those flashing binary data going from my system I forgot my weekend project and started tweaking and reverse engineering Ola’s APIs which eventually resulted in breaking their money transaction system. For a long time I was thinking about publishing this work on the web, but have been too busy.

Chapter 0 : Something is not right I was working on a small side project in which I was monitoring my phone traffic. These calls were simple HTTP requests without any OAuth token mechanism or any other encryption to guard the APIs. Response JSON Chapter 1: Digging the tunnel. Blog, Integrating GNS3 and VirtualBox - DigiNinja. Having come from a development background rather than a sysadmin one, my knowledge of layer 2 is not as good as I'd like it to be so I've decided to do something about it.

I've always been interested in VLANs and the idea of bypassing them so thought that would be a good place to start. Having two small children at home means having a bunch of physical routers and switches sitting about in my home office wasn't really an option as they tend to be noisy things so I set off on the quest to virtualize everything so it would be nice and quiet, easy to snapshot and portable. When I mentioned this on Twitter and asked for advice there were two schools of thought: Should be possible, no real reason why notWon't work, you can only virtualize routers and GNS3 doesn't handle switching well Turns out it is possible and is actually pretty simple to set up.

The Plan This diagram shows the basic lab I'll be setting up: The Setup The first thing to do is to set the router up. Summary. How to Configure HSRP on a Cisco Router - Router Freak. Hot Standby Routing Protocol or HSRP, is a Cisco proprietary protocol that allows two or more routers to work together to represent a single IP address for a particular network. HSRP, as well as Virtual Route Redundancy Protocol (VRRP) are considered high-availability network services that allow for almost immediate fail over to a secondary interface when the primary interface becomes unavailable. HSRP is one of the so called FHRP or “First Hop Routing Protocols”.

You can read more about FHRP in this new article. HSRP is a fairly simple concept that works by having one router within an HSRP group be selected as the primary, or active router. That primary will handle all routing requests while the other routers within the HSRP group simply wait in a standby state. To really dig into the Nitty Gritty of HSRP, check out RFC 2281 for full details on the inner workings of this widely used protocol.

Basic HSRP Configuration R1 and R2 will both be configured to be in standby group 1. Hijacking HSRP. First hop redundancy protocols including HSRP, VRRP, and GLBP can be used to emulate a virtual router on a subnet, typically hosts' default gateway. However, if adequate authentication is not enabled, a malicious user can claim a higher priority and become the active router, which positions him to create a denial of service (DoS) or man in the middle (MITM) attack. All three protocols mentioned posess this vulnerability, but the following example demonstrates exploitation only of HSRP. The Vulnerability Consider the following topology, in which routers 1 and 2 provide a redundant virtual default gateway at 172.16.40.1 for LAN hosts in the 172.16.40.0/24 subnet.

Both routers have an HSRP group configured on their FastEthernet0/0 interface. R2 is configured as the standby router with a priority of 90 (R1 has the default priority of 100). We can verify that R1 is the active HSRP router using the show standby command: The Attack >>> send(ip/udp/hsrp, iface='eth1', inter=3, loop=1) The Fix. Hijacking HSRP. Reading C type declarations. Even relatively new C programmers have no trouble reading simple C declarations such as int foo[5]; // foo is an array of 5 intschar *foo; // foo is a pointer to chardouble foo(); // foo is a function returning a double but as the declarations get a bit more involved, it's more difficult to know exactly what you're looking at. char *(*(**foo[][8])())[]; // huh ?????

It turns out that the rules for reading an arbitrarily-complex C variable declaration are easily learned by even beginning programmers (though how to actually use the variable so declared may be well out of reach). This Tech Tip shows how to do it. In addition to one variable name, a declaration is composed of one "basic type" and zero or more "derived types", and it's crucial to understand the distinction between them. The complete list of basic types is: A declaration can have exactly one basic type, and it's always on the far left of the expression.

The "basic types" are augmented with "derived types", and C has three of them: Today I Found Out | Learn Interesting Facts Every Day.