Install Windows 7 From Pendrive: Make bootable usb drive in xp/vista

You can make your USB Flash Drive/Pendrive Bootable & Use it to install operating systems (like Windows 7)

You can also Check: Install Ubuntu from pen-drive – if you are running Ubuntu

In this tutorial, we will be describing how to install Windows 7 from your pen drive. I assume you are running Windows.

Important: Your motherboard must support booting from flash-drives. Before you boot from flash-drives, you must go to your BIOS settings panel & change Boot priority to USB drive.

First Step: You need a copy of bootable Windows 7 DVD/ Image – ISO. Mount this ISO on your pc using any virtual-drive software. If you don’t have any, get Magic ISO (Free)

Second Step: If you are using XP, go to the section below.

Windows Vista/Seven Users:

  1. Plug-in your pen-drive.
  2. Go to Start menu > All programs > Accessories, right click on Command Prompt and select Run as administrator.
  3. Type DISKPART and hit enter
  4. type LIST DISK command and note down the Disk number (i.e: Disk 1) of your USB flash drive. In my example, I assume that it was Disk 2. Type and execute the commands below one by one:
  5. SELECT DISK 2
  6. CLEAN
  7. CREATE PARTITION PRIMARY
  8. SELECT PARTITION 1
  9. ACTIVE
  10. FORMAT FS=NTFS QUICK (Format process may take few seconds)
  11. ASSIGN
  12. EXIT
  13. Now minimize the Command-Prompt window. Insert your Windows7/Vista DVD or mount ISO by virtual drive then check the drive letter of the DVD drive. Suppose your DVD drive letter is “D” and USB drive letter is “H” (open my computer to know about it).
  14. Go to the Command-Prompt & type D: and hit enter.Where “D” is your DVD drive letter.
  15. Type CD BOOT and hit enter to see the below message. Next, type command given below to update the USB drive with BOOTMGR compatible code.
  16. Type BOOTSECT.EXE/NT60 H: where “H” is your USB drive letter. Once you enter the above command you will see the below message.
  17. Copy the contents of your Windows-7 DVD to your pen-drive. You’re Done!

Windows XP Users:

  1. Download MBR Wizard (Freeware) & Extract it in a folder. Remember the folder location, we will use it later!
  2. Connect your pen-drive & Format it. Insert Windows 7 DVD/Mount it from an ISO image. I assume “I” is your USB drive latter.
  3. Go to Start menu > All programs > Accessories, right click on Command Prompt and select Run as administrator.
  4. Type convert i: /fs:ntfs I assume “I” is your USB drive latter.
  5. In the command promt, go to the directory where you extracted the MBR Wizard software. If you extracted it in D:\my_folder, Then first type D: and hit Enter. Then type cd my_folder & hit Enter.
  6. Type mbrwiz /list (note down disk number of your USB Pen drive)
  7. Type mbrwiz /disk=1 /active=1 (Assume 1 is Disk Number of your USB Drive)
  8. Type exit
  9. Open another Command-Prompt window and type G: (Drive letter of Windows 7 DVD/Image)
  10. CD boot
  11. bootsect /nt60 I: (I is drive latter of your USB drive )
  12. Copy the contents of your Windows-7 DVD to your pen-drive. You’re Done!

How to make JAR from Java Source/Class files

You can make executable .JAR files from your java class files. This .jar file is a compressed single file which can be executed from desktop by opening double-clicking!

Fist of all, you need your class files of your program. So if you have three java sources, named my.java, you.java & they.java, First of all go to command-prompt & make classes of the sources.

javac *.java

Assumed that you are running the command from the directory where your class files are located.

Next, we need to let the JAR know what’s the main class of the program. For this, create e text-file (i.e mainclass.txt) & write in the following manner:

Main-Class: they

IMPORTANT: the text file only needs the one line of text for this purpose. However,
the file must end with a blank line or this will not work, ie the file has two lines in it
– the second one is empty. Note too the class is called “they” and not “they.java”
(the file containing the source code) or “they.class” (the file containing the byte
codes). If your class file is in a package hierarchy, you must use the fully qualified
name of the class (eg “myPackage.MyClass”).

Finally, run the jar utility with this command line:
jar cmf mainclass.txt example.jar *.class

That’s it!

Further reading:

http://neptune.netcomp.monash.edu.au/javahelp/howto/jar.htm

Java’s Tutorial on Jar files:
http://java.sun.com/docs/books/tutorial/jar/
Roedy Green’s JAR file page:
http://www.mindprod.com/jglossjar.html#JAR

Dynamic Google Adsense Generator – PHP

By calling the PHP-function defined below, you can put Google-Adsense code as many times you want. All you need to do is simply call the function. It takes a line to call & thus doesn’t mess up your codes!

Download the code

How to Use:

After Downloading, rename it like google.php. Then, call any of the methods:

<?php
require_once("google.php");
google_ad(); // Default values will be used
google_ads("1987234563", "300", "100");
// last 2 values will be used from default-values.
?>

HTTP Response Codes

After receiving and interpreting a request message, the server responds with an HTTP response message.

Here is the complete reference:

  1. Status Code Definitions … 10
    1. Informational 1xx … 10.1
      1. 100 Continue … 10.1.1
      2. 101 Switching Protocols … 10.1.2
    2. Successful 2xx … 10.2
      1. 200 OK … 10.2.1
      2. 201 Created … 10.2.2
      3. 202 Accepted … 10.2.3
      4. 203 Non-Authoritative Information … 10.2.4
      5. 204 No Content … 10.2.5
      6. 205 Reset Content … 10.2.6
      7. 206 Partial Content … 10.2.7
    3. Redirection 3xx … 10.3
      1. 300 Multiple Choices … 10.3.1
      2. 301 Moved Permanently … 10.3.2
      3. 302 Found … 10.3.3
      4. 303 See Other … 10.3.4
      5. 304 Not Modified … 10.3.5
      6. 305 Use Proxy … 10.3.6
      7. 306 (Unused) … 10.3.7
      8. 307 Temporary Redirect … 10.3.8
    4. Client Error 4xx … 10.4
      1. 400 Bad Request … 10.4.1
      2. 401 Unauthorized … 10.4.2
      3. 402 Payment Required … 10.4.3
      4. 403 Forbidden … 10.4.4
      5. 404 Not Found … 10.4.5
      6. 405 Method Not Allowed … 10.4.6
      7. 406 Not Acceptable … 10.4.7
      8. 407 Proxy Authentication Required … 10.4.8
      9. 408 Request Timeout … 10.4.9
      10. 409 Conflict … 10.4.10
      11. 410 Gone … 10.4.11
      12. 411 Length Required … 10.4.12
      13. 412 Precondition Failed … 10.4.13
      14. 413 Request Entity Too Large … 10.4.14
      15. 414 Request-URI Too Long … 10.4.15
      16. 415 Unsupported Media Type … 10.4.16
      17. 416 Requested Range Not Satisfiable … 10.4.17
      18. 417 Expectation Failed … 10.4.18
    5. Server Error 5xx … 10.5
      1. 500 Internal Server Error … 10.5.1
      2. 501 Not Implemented … 10.5.2
      3. 502 Bad Gateway … 10.5.3
      4. 503 Service Unavailable … 10.5.4
      5. 504 Gateway Timeout … 10.5.5
      6. 505 HTTP Version Not Supported … 10.5.6

CCNA

Cisco Certified Network Associate (CCNA®) validates the ability to install, configure, operate, and troubleshoot medium-size route and switched networks, including implementation and verification of connections to remote sites in a WAN. CCNA curriculum includes basic mitigation of security threats, introduction to wireless networking concepts and terminology, and performance-based skills. This new curriculum also includes (but is not limited to) the use of these protocols: IP, Enhanced Interior Gateway Routing Protocol (EIGRP), Serial Line Interface Protocol Frame Relay, Routing Information Protocol Version 2 (RIPv2),VLANs, Ethernet, access control lists (ACLs).

Source | Syllabus

CCNA Tutorials

CCNA Tutorials: Site 2

Books for download

Useful Link 1

Useful Link 2

PHP: Get Script’s Absolute Location/Directory Location

I was curious to get the absolute location (the path beginning with http://) of my Script. In another case, I only needed the Directory location of my script, (that means in this case I didn’t want my filename.php in the path). So I wrote a function to do both of the jobs quite easily ;)

<?php

function current_URL($dironly = false)
{
/*
* if No argument is passed, returns full path of current script, i.e. http://server.com/dir/file.php
* else returns dir of current script, i.e http://server.com/dir/
*/

$cur_URL = "http://" .  $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if(!$dironly )
return $cur_URL;
else
return dirname($cur_URL) . "/";
}

// USAGE
$myScriptPath = current_URL(); // Gives the path including your script-file-name.php

$myScriptPath = current_URL(true); // Gives the path NOT including your script-filename.php
?>