Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

April 30, 2014

How to add a static route in Windows 7

If you need to access internet /intranet resources on another network the easiest way to go around it is to add a route to your windows routing table. In windows based systems a simple syntax command will enable you do this easily.

Having used windows XP for a long time, adding a route was easy as taking candy from a kid but coming to windows 7 I had issues adding routes. I even thought the route command syntax must have changed on windows 7. But after a bit of try and error I finally managed to add a route to my routing table.

To add a route in windows you need to run a command on windows command prompt window (DOS)

Windows XP

To add a route in Windows XP, open the command prompt window

Start button go to Run, type cmd and press Enter/click Run

The window below appears

On the command prompt window type route print

This will display all the routes currently available on your system

If the route you need is not on the list this is how to add a temporally route
route add mask

Eg
route add 172.16.8.0 mask 255.255.255.0 172.16.1.250

(172.16.8.0 is the subnet I want to reach, 255.255.255.0 is a /24 subnet mask of the destination I want to reach while 172.16.1.250 is my gateway).

Press enter and the route is added to the routing table.

To make a route permanent i.e. a route that will always be there even after rebooting the PC add –p to the command above i.e.

route add 172.16.8.0 mask 255.255.255.0 172.16.1.250 –p

The route will be added on the routing table under persistent routes.

Well at times we do make mistakes and need to amend them, if by any chance you need to delete a route the command is

route delete
eg.
route delete 172.16.8.0

Windows 7

To add a route in windows 7 is exactly the same as in windows XP, same commands are used.

But here’s the catch, windows 7 has high user restrictions. This remits the ability to tamper with critical windows files which is good for general users but it’s a big minus when it comes to technical users. To add route to on a Win7 system you need to run the command prompt window with administrative rights.

Adding a route without admin rights will give you an error “The requested operation requires elevation”. I don’t understand why Microsoft could not simply display the error as “The requested operation requires administrative rights” or something closer to that.

To open the command prompt window with administrative rights go to

Start button, type cmd on the search combo box

A pop up list will appear with the cmd window as the first item on the Jump list.

Right click on the cmd icon and click, Run as administrator

The command prompt window should appear as below. Note the word 'Administrator' on the top bar.

With this you can add, delete and print routes just as it’s done on windows XP.

All the best as you route your network.
Posted 14th January 2013 by james mugambi
©

December 6, 2013

How To Put a LiveCD/DVD To USB

Scientific Linux Forum.org

In this how to I will describe 4 methods that I use to put a livecd/dvd to USB. All of these methods will delete/destroy any data that is on your USB stick!

1. Using dd (IMMO this is the simplest, most reliable and my favorite)
2. By mounting a cd/dvd in a loop and copying the contents and installing grub
3. Using livecd-iso-to-disk (This method also works for install DVD's)
4. Using liveusb-creator

The USB stick I will be using throughout this how to has a device location of /dev/sdc . It is very important that you determine the correct location of your USB stick and change /dev/sdc to the device location of your USB stick in each of the commands in this how to. Do not just copy past the commands in this how to as that could result in the wiping/overwriting/erasing of your hard drive/s. YOU HAVE BEEN WARNED! rolleyes.gif

HOW TO DETERMINE THE DEVICE LOCATION OF YOUR USB STICK:
There are several ways to determine the device location of your USB stick. I will describe a few here. Use the method that you are comfortable with:

To determine the location of your USB stick from the command line use one of the following:
The lsblk command returns a easy to read summery of the installed drives, there size, there device location and there mount locations if mounted, etc.
CODE
lsblk


Fdisk is also able to list lots of disk info but requires root privileges:
CODE
su -c 'fdisk -l'


The command blkid will list disk info along with the UUID number.
CODE
blkid


To determine the location of your USB stick using the disk utility palimpsest:
Go Applications >> System Tools >> Disk Utility On the left hand side of the disk utility window there is a list of storage devices, locate the one that represents your USB stick and click on it. This will display the info for your USB stick on the right hand side of the disk utility window. The device location of the USB stick is displayed on the top right hand side of the disk utility window. Look for the line resembling “ Device: /dev/sdc “ . From this computer the USB device is located at /dev/sdc. Yours may be different and you will have to adjust the commands accordingly by replacing /dev/sdc with the location of your USB stick as shown by the info following the line “Device: in the disk utility window. Failing to do so may result in you wiping/overwriting/erasing your hard drive/s.



1. THE DD METHOD:
This method works on just about all the available livecd/dvds. I have found this method to be the most reliable method. I have used this method with many different distros including SL, Debian, Fedora, Centos, opensuse, Ubuntu ect.

Insert the USB stick,
determine the device location using one of the above methods
Unmount any mounted partitions that are mounted from the USB stick. (This can be achieved by right mouse clicking on the mounted partition/s on your desktop and selecting umount or opening the disk utility, clicking on your usb stick on the left hand side. Then click on the mounted partition on the right hand side and then click the unmount button. Or use the umount command from the command line)

The nest step is to wipe the USB stick with the following command (make sure to change /dev/sdc to your usb stick's device location for all of the following commands):
CODE
su -
dd if=/dev/zero of=/dev/sdc bs=512 count=1


Now to put the SL-62-i383-2012-02-16-LiveCD.iso to the usb stick. (Change path-to-iso to your real path to the iso file. ie. Something like /home/sluser/Downloads/SL-62-i383-2012-02-16-LiveCD.iso):
CODE
su -
dd if=/path-to-iso/SL-62-i383-2012-02-16-LiveCD.iso of=/dev/sdc


When the above command is finished you will have a bootable liveusb stick.


2. THE LOOP MOUNT, COPY AND INSTALL GRUB METHOD
This method allows for multiple partitions, allowing you to have 2 or more operating systems on one usb stick or use one partition for storage and one for the operating system. I am using a 4gb USB stick.

Insert the USB stick,
determine the device location using one of the above methods
Unmount any mounted partitions that are mounted from the USB stick.
Using the disk utility, format the usb stick
create a partition with the label “SL62” with the size equal to half the USB stick.
create a second partition with the label “Data” the size being the other half of the USB stick.
Mount the partition SL62 to the mount point /media/SL62 (you can just unplug and plugin the usb stick and it should mount both partitions for you in /media)
Create a mount point for the iso:
CODE
su -
mkdir /mnt/iso


Mount the livecd.iso and copy the data to the usb stick:
CODE
su -
mount -o loop /path-to-iso/ SL-62-i383-2012-02-16-LiveCD.iso /mnt/iso
cp -r /mnt/iso/* /media/SL62
unmount /mnt/iso


Install Grub on the USB stick:
CODE
su -
grub-install –root-directory=/media/SL62 /dev/sdc


Create a grub.conf file:
CODE
su -
gedit /media/SL62/boot/grub/grub.conf

and add the following stanza to the grub.conf file:
CODE
title SL62 i686
root (hd0,0)
kernel /isolinux/vmlinuz0 ro root=LABEL=SL62 rootfstype=auto liveimg
initrd /isolinux/initrd0.img


and click save and close. Unmount/eject the USB stick.

You now have a bootable usb stick with a data partition. Alternatively you could use the second partition for a second OS.



3. THE LIVECD-ISO-TO-DISK METHOD:
I use this method to put a install dvd to usb for computers without cd/dvd drives. With this method you can put livecd/dvds to usb as well.

Insert the USB stick,
determine the device location using one of the above methods
Unmount any mounted partitions that are mounted from the USB stick
CODE
su -
livecd-iso-to-disk –format –reset-mbr /path-to-iso/SL-62-i383-2012-02-16-LiveCD.iso /dev/sdc

Follow the onscreen instructions.

For more info on this method see: http://www.livecd.ethz.ch/usbdisk.html#livecd-iso-to-disk

4. THE LIVEUSB-CREATOR METHOD:
This method is also pretty easy and has built in functions to download a cd/dvd for you or use a iso that you have locally.

Insert the USB stick,
determine the device location using one of the above methods
CODE
su -
liveusb-creator –reset-mbr

Choose the target device, browse for a local iso or select one to download. Select persistent storage size if desired (this function does not always work)
Click the Create Live USB button and follow the instructions in the box.

For more info on this method see: http://www.livecd.ethz.ch/usbdisk.html https://fedorahosted.org/liveusb-creator/


Happy USB-ing cool.gif
©

Rufus Damaged my USB. Windows can not detect USB

I was able to fix the damaged USB by doing the following:

Go in Start > write “cmd” > right-click the Windows Command Prompt and choose to run it as an Administrator.
At the prompt, enter “DISKPART” to launch Microsoft’s disk management utility. It will take a second until it loads and when ready it will read “DISKPART>”.
Type in “list disk” to show a list of all disk drives. If your USB key is plugged into your PC, it should be listed here, along with other drives. Note the USB key’s disk number – you can pick it out by looking at the disk capacity.
Type “select disk n" (whatever is your USB disk number in place of "n").
Type “clean” for the utility to clean the disk, which DiskPart will confirm.
Create a new partition by entering “create partition primary”.
Choose this partition with “select partition 1", and then mark it as active by typing “active”.
Format the key by inputting “format fs=fat32". This should take a few minutes, and DiskPart will display a progress percentage.
Lastly, type “assign” to give this USB key a drive letter and “exit” to exit DiskPart.
©

June 25, 2013