loadYOURSELF

loadYOURSELF

How to find multiple ip address for one domain name (with c programming)

Some domain’s serve under multiple ip addresses for example google.com

if you want to query this ip addresses then you can use this code block

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv) {
 if (argc < 2) {
   fprintf(stderr,"Usage: ./app www.google.com\n");
   exit(1);
 }

 struct hostent *hp = gethostbyname(argv[1]);

 if (hp == NULL) {
   fprintf(stderr,"query failed\n");
   exit(1);
 } else {
   unsigned int i=0;
   while ( hp -> h_addr_list[i] != NULL) {
     printf( "%d -> %s ",i, inet_ntoa( *( struct in_addr*)( hp -> h_addr_list[i])));
     i++;
   }
   exit(0);
 }
}

Buy me a beer

drive new drive unavailable…try again problem on nokia n series

If your nokia n series phone asks you to connect to internet or another place frequently,
you need to delete

. tools / settings / connection / Remote Drives .. delete "New Drive" ..

this can be a solution for the problem.

hope this helps.

Buy me a beer

shell counter script (remember the number next restart)

This script counts one by one every time the user runs the script. “./scriptname reset” reset the counter.


!/bin/bash
if [ "$1" = "reset" ]
then
rm -rf fstore
fi
sayi=0
if [ -f fstore ]
then
sayi=`cat fstore`
fi
let sayi=$sayi+1
echo "INCREMENTING"
echo $sayi > fstore
echo -e -n "CURRENT="
echo $sayi

uses fstore file to remember the previous number.

Buy me a beer

Default access control for classes

Default class access may trigger some error which the compiler complain about the source.

  • package 1

  • package car;
    class BMW { }

  • package 2

  • package utils;

    class Tool extends BMW {}

    second package creates a new class which extends the “BMW” class. But the first class definition has no any access specifier so the access permissions are set to default. Default access is the package level access which the second package must be in the same package with “car” or you can define “BMW” class with public.

    SEGA Announces BLEACH: The 3rd Phantom for Nintendo DS

    SEGA® of America, Inc. announced that BLEACH™: The 3rd Phantom™ videogame will be available exclusively for the Nintendo DS™ portable handheld system. Based on the critically acclaimed animated series, BLEACH: The 3rd Phantom marks the first time the series ventures into the Strategy RPG genre. The game features an enormous cast of BLEACH™ characters with voices lent by the actors from VIZ Media’s award winning animated series.

    Nokia launches the Nokia 6210s in Korea

    Nokia announced it will start to sell WCDMA 3G mobile devices in Korea. The first model to be launched in Korea is the Nokia 6210s.

    This is the first time that Nokia will sell 3G mobile devices in Korea.

    “The time is now right for Nokia to enter the Korea market,” said Colin Giles, Senior Vice President, Greater China, Japan and Korea, Nokia.

    Ericsson and Telenor to introduce net-centric collaboration services to the enterprise market

    Ericsson and Telenor Sweden today announced the first ever contract for Ericsson’s Business Communication Suite (BCS), which will enhance multimedia experiences for Telenor’s enterprise customers with collaboration services in Sweden. Ericsson will also be responsible for the expansion, upgrade and systems integration of Telenor’s IMS network.

    Ericsson’s Business Communication Suite is the first service of its kind to be based on IMS. It is a communication tool that enables mobile, unified communication for business users and increases efficiency with easy-to-use social-networking tools, such as presence, messaging, chat, video, incoming call management, file sharing and corporate directory. It can be used to communicate both with colleagues and other business associates.

    G-SHOCK AND BABY-G HANG TEN ON THE WRIST OF PRO SURFER

    Casio Computer Co., Ltd., Tokyo, Japan, is proud to announce a year-long sponsorship of pro-surfer Erica Hosseini. Hosseini will represent the popular G-Shock and Baby-G timepiece lines. G-Shock and Baby-G are known for their shock resistance and stylish looks.

    Activision Confirms PROTOTYPE(TM) Launch Timing

    Activision Publishing, Inc. (Nasdaq: ATVI) confirmed today that the long-awaited open-world action thriller video game PROTOTYPE will ship in European territories on June 5 and to North American retailers on June 9, arriving in stores shortly thereafter. Fans of the infamous Alex Mercer should also be sure to check out the newly updated official game web site located at www.prototypegame.com to gain access and view newly added game information and content, including the first half of PROTOTYPE’s must-see intro cinematic.

    High CPU usage solution for vmware on linux (files on NTFS)

    If you have high cpu usage problem for your vmware application which runs on linux and the virtual machine files in NTFS partition,

    you have to add:


    mainMem.useNamedFile= FALSE"

    to your .vmx file of you virtual machine.

    this will solve the high cpu usage of mount.ntfs-3g.

    Buy me a beer