Coded zone

The place where all the coded stuffs reside.

Monday, July 23, 2007

Free webhosting

Free and paid webhosting started, as an e-commerce website.

http://sales.rajesh.com.np, Its getting positive feedbacks.

Monday, July 16, 2007

VI find and replace

Introduction: This tutorial is meant for VI text editor, mainly for linux, generally used in Console [my black Screen]

Tutorial Reference:
Linux.ie

Search (Wraped around at end of file):
  Search STRING forward :   / STRING.
  Search STRING backward:   ? STRING.
  Repeat search:   n
  Repeat search in opposite direction:  N  (SHIFT-n)

Find and Replace
First occurrence on current line: :s/OLD/NEW
Globally (all) on current line: :s/OLD/NEW/g

How did this happen?

Actually IPs changed from 203.91.136.234 to 116.90.239.10.
I had access to only vi editor and then, I need to replace the former with the latter. Later I found this :

:s/203.91.136.234/116.90.239.10/g

This just replaced 203.91.136.234 to 116.90.239.10 and the operator g was meant for global, same as in Perl.

Doing this, that is invoking the command in vi command prompt solved all my problem. But every time I had to press " n " for finding 203.91.136.234. Then invoking :s/203.91.136.234/116.90.239.10/g this solved them.

Mysql creating new users and assigning permissions

Recently I tried to create a database to install mambo.

mysql> use forum_mambo
Database changed
mysql> GRANT ALL PRIVILEGES ON forum_mambo to forum_mambo@localhost identified by 'forum_mambo';
Query OK, 0 rows affected (0.11 sec)

Thursday, July 12, 2007

Google Google Google..

Here is something.. Googling in Google for how much I Googled in Google.com returned this . lol. This shows that I google much time during the nights from 9-4 @morning. Normally I sleep at 5,6,7,8 and I am @college at 9,10,11,12.

Surfing starts either at 3 or at 5 (College closes at 4)

7 and 8 is the Dinner time and so.. relatively less stats indicates that too.

I am more active at weekends Fri, Sat and Sundays hmm.. 
and umm I don't use much at the start of the semesters like @Feb, March,  Aug, Sep and Oct . Okay cool

Google Trends created this Graph for me.

 

search trends

Wednesday, July 11, 2007

The world of Black Screen

 

This is a sample remote system we are going to investigate..

 1 nmap ku.edu.np

Then I started playing inside..

 2 dig  localhost

Later I made sure if the DNS server is working or not.. by using Dig command

 3 dig localhost port 53

Now I stopped the Name server: "service named stop"

4 service named stop

 

Dig localhost, to ensure which name server is working . Since our name server is stopped just a second ago, It might be another parent server that would reply by the dig. Here was the case that 202.52.242.65 replied at port 53. [This follows the precedence from /etc/resolv.conf]

5 dig localhost port 53 after named shutdown

Below is the famous "Cannot Find server" lol  .. because the name server is down 

6 cannot find server

The files resolv.conf contains the information about which servers to contact. It is usually found at /etc/resolv.conf .

I have here two of the name servers listed. If one fails it contacts the another. However most of the queries will be fetched from the first server.

6 resolv dot conf

Now since our local DNS (Domain Name Server) is down. Lets try to find the ip of hotmail.com by invoking : dig hotmail.com

This will return obviously the ip of hotmail.com as well as the ip of the Server which did the job for us. Most probably here will be 202.52.242.65 to do this for us , because we have kept its name at the second place. The one in the first place is 202.52.242.110, which is our local ip, and its DNS (Domain Name Server) is down now.

7 dig hotmail.com

Now lets start our name server. Service named start.

7 service named start

 

The Error logs, or any logs are printed inside the /var/log/messages at the last portion. You may use tail function, or cat to print the latest log messages about the starting of the name server. Usually during starting name servers.. when there are errors .. I have found no error log is printed at the console, rather errors are printed at the log files. So Its better to find these stuffs there.. Remember /var/log/messages

8 var log messages -- after named start

Here it goes .. Now our DNS is running and, there is at least one server who will reply to our query for the domain. Remember last cannot find server. This time.. it won't say  so.. Rather it worked.. See my domain is working now..

9 rapa.rajesh.com.np success

Okay what is there in the files of name servers? These files are situated inside the folder /var/named/ .  Actually name server is configured by a configuration file /etc/named.conf, in which the directory /var/named is defined. I too have used the same configuration. Hence my files reside at /var/named. Inside that file are other files, within which, we can define different zones, and different subdomains.. like I have used a domain here kucc.ku.edu.np and defined different subdomains within this domain. So simple create any file and define subdomains. like A records, the www subdomain of  kucc.ku.edu.np is defined inside kucc.ku.edu.np as :
www IN A 202.52.242.110.
Which means that, the ip of the subdomain "www.kucc.ku.edu.np"  is 202.52.242.110.

10 var named file list

Okay well we talked about named.conf Here is the screenshot of /var/named/named.conf

11 etc named.conf

Now lets check it out what the DNS analyzers say, like DNSSTUFF.com has something to say about us.. whether working or not..

12 dnsstuff.com

Okay just click the lookup button and there you go: the details of dns related stuff.

13 resolved dnstuff.com

/var/named/named.ca

14 named.ca

/var/named/kucc.ku.edu.np

15 named - kucc.ku.edu.np

Below is the history of whatever we did until now..

17 history upto now

Now lets start towards mail servers. Lets perform nmap scan to see which ports are open for us to watch. If mail servers are on, smtp port 25,and pop3 port 111 must be open.

18 mail server scan

Now lets check by telnetting the ports. telnet at port 25 and telnet at port 110.

20 telnet kucc.ku.edu.np 25 and 110

Okay our mail server is running.. Lets login
21 webmail login

and after logging we get mails inside it:
22 logged inside mail

One benefit of having a mail server is that, the system mails all the attacks and logs to the mail server, so that we can check them periodically. Not that you have to go to /var/log/message to check them all the time .. The logs are sent to the mail box as shown above. In traditional way, we had to check the attacks manually like below:

23 daily attack in ssh list

Monday, July 09, 2007

Windows Live writer for blogger

Windows Live writer is Cute and nice for blogger.com and you can use it with other accounts. windows live spaces, WordPress, or other blogging sites. This one is from windows live writer. Wow excellent !! This works and is great. I love this stuff. Yeah.

Friday, July 06, 2007

Photograph for Pulitzer 1995



I hope this picture will always serve as a reminder to us that how
fortunate we are and that we must never ever take things for granted.

We must all realise our social responsibilities.

Difference between Focusing on Problems and Focusing on Solutions

Case 1 When NASA began the launch of astronauts into space, they found out that
the pens wouldn't work at zero gravity (ink won't flow down to the writing
surface). To solve this problem, it took them one decade and $12 million.
They developed a pen that worked at zero gravity, upside down, underwater,
in practically any surface including crystal and in a temperature range
from below freezing to over 300 degrees C.

And what did the Russians do...?? They used a pencil.

Case 2 One of the most memorable case studies on Japanese management was the case
of the empty soapbox, which happened in one of Japan's biggest cosmetics
companies. The company received a complaint that a consumer had bought a
soapbox that was empty. Immediately the authorities isolated the problem
to the assembly! line, which transported all the packaged boxes of soap
to the delivery department. For some reason, one soapbox went through the
assembly line empty. Management asked its engineers to solve the problem.
Post-haste, the engineers worked hard to devise an X-ray machine with
high-resolution monitors manned by two people to watch all the soapboxes
that passed through the line to make sure they were not empty. No doubt,
they worked hard and they worked fast but they spent a whoopee amount to
do so.

But when a rank-and-file employee in a small company was posed with the
same problem, he did not get into complications of X-rays, etc., but
instead came out with another solution. He bought a strong industrial
electric fan and pointed it at the assembly line. He switched the fan on,
and as each soapbox passed the fan, it simply blew the empty boxes out of
the line.

Moral : Always look for simple solutions.
Devise the simplest possible solution that solves the problems

Always Focus on solutions & not on problems
So at the end of the day the thing that really matters is HOW ONE LOOKS INTO
THE PROBLEM, mere perceptions can solve the tough probs...

Thursday, January 04, 2007

Eleven Commandments of hi5

ONE
If you’re ugly, stop acting like you don’t know it & stop using cute
nicknames. The captions under your picture that says “top model pose”,
“sexy”, “arnt i hot” doesn’t convince anyone.

TWO
To the people who have like over 1000 friends, are you serious? Nobody
in this universe can keep up with that many friends. You’re just
stupid. Go play in traffic.

THREE
If you’re real pretty, dont approve all friends request and bitching
later on how u hate getting stupid comments & messages. You’re the one
who approved them in the 1st place!! Be realistic on what u’re getting into!!

FOUR
Don’t ever post pictures and say “OMG, I’m so ugly” “OMG,I’m so fat” because if you were, you wouldn’t post them.

FIVE
Stop peeping others scrap book to see wot that guy or gal have conversed. Also stop being a Tomboy looking for hot chicks in others profiles.
(vice versa too)


SIX
Writing tons of scraps a day, begging people to send a testimonial, etc.. ” IS PATHETIC & IMATURE. ” .PEOPLE WHO ACTUALLY CARE ABOUT YOU WILL SEND YOU TESTIMONIALS.. Pls dont junk others scrap book so to get your
scrap figures multiply!


SEVEN
If all your pictures look the same, don’t post them all. Please put some variety in your pics. Nobody wants to see your face 10 different ways.

EIGHT
Who really cares if I/U don’t accept you/me as a friend? MOVE ON!!!
Don’t send me another request or message asking “what’s up with you not adding me?” I don’t want you as a friend; that’s what’s up!


NINE
Little 6th graders, go somewhere else because nobody wants you here and than hi5, you have better things in dis world to get addicted!


TEN
Nobody cares about threats over the internet. Don’t try to act hardcore with the keyboard. Fighting online is like racing in the special olympics; even if you win, you’re still retarded.

ELEVEN
If you get a scrap message and it says something like “repost this
within 100 seconds or a ghost will rape your dog tonight!!,” IT’S NOT
REAL!!QUIT BEING AN IDIOT!!!!!!!!

Wednesday, January 03, 2007

Oops 16bit assembly

I tried to mess with some executables. I have
been using a Desktop manager and it is a trial version. So I tried to mess with their codes. And before
I could do anything I needed Assembly language to be run in my computer. I wanted to run some hello world
stuffs, those codes I had done previously, and which were familiar to me before
I used windows XP service pack2 .

I used to  run those codes in win98 and winxp(sp1).

Now after 1-2 years , I can't run TASM .
While I tried to compile and link using TLINK to  a "hello world" assembly
program in Windows, it gives an error like :

"16 bit MS-DOS Subsystem
c:\windows\system\cmd.exe -tlink ara.obj
X#=0D,CS=01B7 IP=00000231. The NTVDM CPU has encountered an unhandled exception.
Choose 'close' to terminate the application."




Then it gives a "Close" and "Ignore" options over a dialog button.
At both cases I can't link the obj file with the linker. This is a bullshit.
Windows takes all the control over the Operating System and what am I . Nothing.
A user who can't level up . Damn!!.


 I searched over the internet all around but everyone says: use 32 bit programming codes. and use TASM32 and TLINK32.

 Nah I don't wanna do that. I need TASM and TLINK cuzz I like playing with 16 bits. They are easier and give more control to me. 32 bits !! why 32 bits. If I am the programmer I need all the controls. Computers are for me , I am not for computers. Humans modify computers .. If computers start modifying humans thats unfair.
If I don't find a solution I have the solution, I will go back to windows98 and the service pack1 windows. Have the job done and return back. Thanks God I kept backup of all these.


Sources that I was using : 

Assembly Language for NewBies