Tuesday, October 1, 2013

Printing mirror imaging in Windows

To resolve the issue, turn off mirror imaging in Printer Preferences. To do this, use the following steps:

1.    Click Start and then Control Panel.

2.    If your computer is in category view, click Printers and Other Hardware, and then click Printers and Faxes. If your computer is in classic view, click Printers and Faxes.

3.    Right-click the HP product from the list of printers, and then select Properties. The Properties dialog box displays.

4.    From the General tab, click Printing Preferences. The Printing Preferences dialog box displays.

5.    Click the Advanced tab.

6.    Under Printer Features, click Mirror Image, click the down arrow ( ) to the right of the field, and then click Off.

7.    Click OK to apply the change

Tuesday, September 24, 2013

How to change Windows 7 product key with command line?

This method works with Windows Vist, Windows 7 and Windows 8



  1. Click on the Start Button and type: CMD (into the 'Search programs and files' field in the Start Menu)


  1. The Start Menu will show 'CMD.exe', 


  1. Right-click the CMD.exe file and select Run As Administrator.
























  1. In the CMD window, type: slmgr.vbs -ipk <type your product key here>


















  1. To activate windows after changing the key, type: slmgr.vbs -ato





How to change Windows XP Product Key

  1. Click on Start and then Run.





  2. In the text box in the Run window, type regedit and click OK. This will open the Registry Editor program.







  3. Locate the HKEY_LOCAL_MACHINE folder under My Computer and click on the (+) sign next the folder name to expand the folder.










  4. Continue to expand folders until you reach the HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents registry key.
  5. Click on the WPAEvents folder.
  6. In the results that appear in the window on the right, locate OOBETimer.







  7. Right-click on the OOBETimer entry and choose Modify from the resulting menu.







  8. Change at least one digit in the Value data text box and click OK. This will deactivate Windows XP.
    Feel free to close Registry Editor at this point.

  9. Click on Start and then Run.

  10. In the text box in the Run window, type the following command and click OK.
    %systemroot%\system32\oobe\msoobe.exe /a








  11. When the Let's activate Windows window appears, choose Yes, I want to telephone a customer service representative to activate Windows and then click Next.











  12. Click the Change Product Key button at the bottom of the window.
    Don't worry about filling anything out on this screen.












  13. Type your new, valid Windows XP product key in the New key: text boxes and then click the Update button.












  14. You should now reactivate Windows XP by following the instructions on the Activate Windows by phone window which you should now be seeing or via the Internet by clicking the Back button and following the instructions on that screen.
    If you'd rather postpone activating Windows XP until a later date, you can click the Remind me later button.
  15. After activating Windows XP, you can verify that activation was successful by repeating steps 9 and 10 above.
    The Windows Product Activation window that appears should say "Windows is already activated. Click OK to exit."

Monday, September 16, 2013

454 4.7.0 TLS not available due to local problem

In /var/log/syslog, I found following error messages

Sep 16 15:16:22 main2 postfix/smtpd[24908]: warning: TLS library problem: 24908:error:0906406D:PEM routines:PEM_def_callback:problems getting password:pem_lib.c:105:
Sep 16 15:16:22 main2 postfix/smtpd[24908]: warning: TLS library problem: 24908:error:0906A068:PEM routines:PEM_do_header:bad password read:pem_lib.c:403:
Sep 16 15:16:22 main2 postfix/smtpd[24908]: warning: TLS library problem: 24908:error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib:ssl_rsa.c:669:
Sep 16 15:28:55 main2 postfix/smtpd[26361]: warning: TLS library problem: 26361:error:0906406D:PEM routines:PEM_def_callback:problems getting password:pem_lib.c:105:
Sep 16 15:28:55 main2 postfix/smtpd[26361]: warning: TLS library problem: 26361:error:0906A068:PEM routines:PEM_do_header:bad password read:pem_lib.c:403:
Sep 16 15:28:55 main2 postfix/smtpd[26361]: warning: TLS library problem: 26361:error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib:ssl_rsa.c:669:



Then, i use following solution and it worked for me,


To create a new ssl cert for postfix, run these commands:


cd /etc/postfix/ssl/

openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
(Create your pass phrase)

chmod 600 smtpd.key

openssl req -new -key smtpd.key -out smtpd.csr

openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt

openssl rsa -in smtpd.key -out smtpd.key.unencrypted

mv -f smtpd.key.unencrypted smtpd.key

openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650




Thursday, August 1, 2013

Install Rocketraid 2720 raid card driver in Ubuntu server

Install Rocketraid 2720 raid card driver in Ubuntu server

1.       Download Rocketraid 2720 raid card driver
#cd ~


2.       create a temporary folder
root@BACKUP-HOST:~#mkdir -p /tmp/df


3.       Extract the driver package to the /tmp/df folder
root@BACKUP-HOST:~# tar xvf RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz -C /tmp/df



4.       Install/update driver
root@BACKUP-HOST:~#cd /temp/df
root@BACKUP-HOST:/tmp/df# cd rr272x_1x-linux-src-v1.5/product/rr272x/linux/
root@BACKUP-HOST:/tmp/df/rr272x_1x-linux-src-v1.5/product/rr272x/linux#make install
root@BACKUP-HOST:/tmp/df/rr272x_1x-linux-src-v1.5/product/rr272x/linux#modprobe rr272x_1x

5.       Update fstab, add the following line in fstab

/dev/dm-0       /backup         ext4    errors=remount-ro       0       0


Reboot the server

Wednesday, May 22, 2013

Can't Search in Google Drive Folder in Windows 7


Problem:

I am trying to search files in Google Drive Folder in Windows 7 with Windows File Explorer, there is no search result returns.




Solution:

1. In Windows 7, open your Windows File Explorer


2. Select your Google Drive Folder


3. Click on "Organize" drop down menu (It located at the left top corner in Windows File Explorer)


4. Select "Folder and search options"


5. In the new pop windows, click on "Search" tab


6. Then, put a check mark on "Don't use the index when searching in files folders for system files (searches  
might take longer)"


7. Click "OK" button to finish and try again

Friday, May 17, 2013

Setting up a KVM virtual machine in LVM (Logical Volume)



1. Install Ubuntu Server 12.04 64bit (Total Hard Disk Size = 200GB and 4GB RAM)
Hostname: U-HOST
Partitioning method: Manual
Create #1 primary 30.0GB f ext4 /
Create #2 primary 8.0GB f swap swap
Create #3 primary 176.7GB k lvm
Choose software to install: [*] OpenSSH server
Install the GRUB boot loader to the master boot record? <Yes>



2. After the base server installed, do the update
root@U-HOST:/iso#apt-get update
root@U-HOST:/iso#apt-get dist-upgrade



3. Install packages
root@U-HOST:/iso#apt-get install ubuntu-virt-server python-vm-builder kvm-ipxe



4. Add the current user to the group libvirtd
root@U-HOST:/iso#adduser 'root' libvirtd
root@U-HOST:/iso#adduser 'root' kvm

To check if KVM has successfully been installed, run
root@U-HOST:/iso#virsh -c qemu:///system list

it should display something like this:

root@U-HOST:~# virsh -c qemu:///system list
Id Name State
----------------------------------



5. Install bridge-utils... (In Ubuntu 12.04, this is package is already installed)
root@U-HOST:/iso#apt-get install bridge-utils




6. configure a bridge,
root@U-HOST:/iso#nano /etc/network/interfaces
Before the modification, it file is looks as follows:

# This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).

 # The loopback network interface
 auto lo
 iface lo inet loopback

 # The primary network interface
 auto eth0
 iface eth0 inet dhcp



After modification, it will looks as follows,

# This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).

 # The loopback network interface
 auto lo
 iface lo inet loopback

 # The primary network interface
 auto eth0
 iface eth0 inet manual


 auto br0
 iface br0 inet static
        address 192.168.122.21
        network 192.168.122.0
        netmask 255.255.255.0
        broadcast 192.168.122.255
        gateway 192.168.122.1
        dns-nameservers 8.8.8.8 8.8.4.4
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off


After the modification of 'interface' file, restart networking service,
root@U-HOST:/iso#/etc/init.d/networking restart


It should now show the network bridge (br0):
root@U-HOST:/iso#ifconfig

it will show following,

br0       Link encap:Ethernet HWaddr 52:54:00:14:81:b7
          inet addr:192.168.122.21 Bcast:192.168.122.255 Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe14:81b7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:152 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:12428 (12.4 KB) TX bytes:10608 (10.6 KB)

eth0     Link encap:Ethernet HWaddr 52:54:00:14:81:b7
          inet6 addr: fe80::5054:ff:fe14:81b7/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:157 errors:0 dropped:0 overruns:0 frame:0
         TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:14796 (14.7 KB) TX bytes:10962 (10.9 KB)

lo        Link encap:Local Loopback
         inet addr:127.0.0.1 Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING MTU:16436 Metric:1
         RX packets:16 errors:0 dropped:0 overruns:0 frame:0
         TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)


Reboot the server now.



7. Create the Physical Volume
#apt-get install lvm2


Check the partitions by run,

#cat /proc/partitions

It should looks like this,

root@U-HOST:~# cat /proc/partitions
major minor #blocks name

253 0 209715200 vda
253 1 29295616 vda1
253 2 7812096 vda2
253 3 172605440 vda3
11 0 1048575 sr0

The 'vda3' is the lvm partition, you can check it by this,
root@U-HOST:/iso#fdisk -l

Disk /dev/vda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders, total 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006e7b2

Device Boot Start End Blocks Id System
/dev/vda1 * 2048 58593279 29295616 83 Linux
/dev/vda2 58593280 74217471 7812096 82 Linux swap / Solaris
/dev/vda3 74217472 419428351 172605440 8e Linux LVM

Create physical volume
root@U-HOST:~# pvcreate /dev/vda3
Physical volume "/dev/vda3" successfully created 
 
Create volume group
root@U-HOST:~# vgcreate vgpool /dev/vda3
Volume group "vgpool" successfully created 
 
”vgpool” can be replace with any name you want


Create logical volume
root@U-HOST:~# lvcreate -L 30G -n win7 vgpool
Logical volume "win7" created 
 
30G is the partition size, win7 is the logical volume name, vgpool is the volume group that created from previous step




8. Now you can install virtual machine from command line

Install virtinst by run,
root@U-HOST:/iso#apt-get install virtinst


I am going to use a Windows 7 ISO file where is located at
/iso/Windows.7.SP1.ENG.x86-x64.MAFIAA.iso


Install the Windows 7 Virtual Machine by running following command,


root@U-HOST:/iso#virt-install --connect qemu:///system --name=win7vm --ram=2048 --disk path=/dev/vgpool/win7 --cdrom=/iso/Windows.7.SP1.ENG.x86-x64.MAFIAA.iso --network bridge=br0,model=virtio --os-type=windows --noautoconsole --graphics vnc,listen=0.0.0.0,port=5901 –hvm

Starting install...
Creating domain... | 0 B 00:01
Domain installation still in progress. Waiting for installation to complete.



9. Install an virtual machine via “Virtual Machine Manager”
You can install “Virtual Machine Manager” from Ubuntu Software Centre on a Ubuntu Desktop Then, connect to

In “Virtual Machine Manager”, go to File -> Add Connection


























Type “yes” in following windows
















 

In Nex Window, type in the user's password


















After enter the password, you will see the “win7vm” in “Virtual Machine Manager”
  


 

Double click the virtual machine “win7vm”, it will show you the virtual machine status,
You can finish the Windows 7 installation by using Virtual Machine Manager
  
















Convert KVM Qcow2 File to LVM Disk


Following steps involve moving some KVM VMs from file storage to block storage. 
This is basically converting the .qcow2 files to LVM LVs. It was surprisingly simple.







1. qemu-img convert disk0.qcow2 -O raw disk0.raw

2. ls -l


-rw-r--r-- 1 user user 44023414784 2011-03-27 09:09 disk.raw

3. lvcreate -L 44023414784b -n lv_disk vgroup

4. dd if=disk.raw of=/dev/vgroup/lv_disk





=============================================================



#Configuration Before:



<disk type='file' device='disk'>

  <driver name='qemu' type='qcow2' cache='none'/>

  <source file='/srv/virtual/vm_web/tmp5GWO4q.qcow2'/>

  <target dev='hda' bus='virtio'/>

</disk>





#Configuration After:



<disk type='block' device='disk'>

  <driver name='qemu' type='raw' cache='none'/>

  <source dev='/dev/vgroup/lv_disk'/>

  <target dev='vda' bus='virtio'/>

</disk>

Monday, May 13, 2013

iPad can join wireless but no internet

Problem:

I can join to my wireless network (says 'connected') on my iPad but cannot load any website. I have confirmed other device join to the same wireless has no problem with browsing internet.




Solution:
Go to "Settings" -> "Wi-Fi" -> Click on the blue '>" arrow where at the end of your Wireless Netowrk Name -> HTTP Proxy (Change Auto to Off)

This will fix the problem for most of the people, enjoy internet!

Saturday, May 11, 2013

How to Change a Degraded Drive with tw_cli commandline?


A failed RAID set looks like this:


dev306:~# /opt/3Ware/bin/tw_cli
//dev306> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -      256K    1117.56   ON     OFF      OFF   

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     372.61 GB   781422768     3PM0Q56Z   
p1     OK               u0     372.61 GB   781422768     3PM0Q3YY   
p2     OK               u0     372.61 GB   781422768     3PM0PFT7   
p3     DEGRADED         u0     372.61 GB   781422768     3PM0Q3B7 

 

 

Now I will remove this bad disk from the RAID set:


//dev306> maint remove c0 p3
Exporting port /c0/p3 ... Done.

 

 

With the bad disk identified and replaced, now I need to go back into the 3Ware CLI and find the new disk, then tell the array to start rebuilding.


dev306:~# /opt/3Ware/bin/tw_cli
//dev306> maint rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [none].
Found the following drive(s): [/c0/p3].


//dev306> maint rebuild c0 u0 p3
Sending rebuild start request to /c0/u0 on 1 disk(s) [3] ... Done.

//dev306> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    REBUILDING     0      256K    1117.56   ON     OFF      OFF   

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     372.61 GB   781422768     3PM0Q56Z   
p1     OK               u0     372.61 GB   781422768     3PM0Q3YY   
p2     OK               u0     372.61 GB   781422768     3PM0PFT7   
p3     DEGRADED         u0     372.61 GB   781422768     3PM0Q3B7 

 

Wednesday, May 8, 2013

How to get an inactive RAID device working again?

Problem:

After booting, my RAID1 device (/dev/md_d0 *) sometimes goes in some funny state and I cannot mount it

# mount /opt
mount: wrong fs type, bad option, bad superblock on /dev/md_d0,
       missing codepage or helper program, or other error
       (could this be the IDE device where you in fact use
       ide-scsi so that sr0 or sda or so is needed?)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


The RAID device appears to be inactive somehow:
# cat /proc/mdstat
Personalities : [linear]  [multipath]  [raid0]  [raid1]  [raid6]  [raid5]
                [raid4] [raid10]
md_d0 :  inactive sda4 [0] (S)
               241095104 blocks


# mdadm --detail /dev/md_d0
mdadm: md device /dev/md_d0 does not appear to be active.



Resolution:

run,

#mdadm --examine --scan >> /etc/mdadm/mdadm.conf
reboot the machine and you will found /dev/md0 will be active if you run

#cat /proc/mdstat

Tuesday, May 7, 2013

tw_cli ChatSheet


How do I check the health of my 3ware RAID array under any Linux distribution? How do I access 3ware RAID Array web interface?

You need to download required command line tools from 3ware support web site. You can also find the same on driver cd / floppy disk. For example, I've downloaded a file called tw_cli-linux-x86_64-9.4.1.3.tgz for my 64 bit Linux server from above site. You need to get tool according to your device.


1. First you download "tw_cli" from LSI website -> Support


2. untar the tw_cli-linu.xxxxxxx.tgz


3. find and run "tw_cli" or "tw_cli.x86" or "tw_cli.x86_64", you will enter CLI command line


4. Show raid card information
   // localhostname> show
   
    Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
    ------------------------------------------------------------------------
    c4    9650SE-8LPML 8         6        1       0       1       1      OK

    //localhostname>


5. From above example, your raid card has been detected as c4, to show detail raid information,
     //localhostname> /c4 show
     
    Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
    ------------------------------------------------------------------------------
    u0    RAID-6    OK             -       -       256K    7450.54   RiW    ON

    VPort Status         Unit Size      Type  Phy Encl-Slot    Model
    ------------------------------------------------------------------------------
    p0    OK             u0   1.82 TB   SATA  0   -            Hitachi HDS722020AL
    p1    OK             u0   1.82 TB   SATA  1   -            Hitachi HDS722020AL
    p2    OK             u0   1.82 TB   SATA  2   -            Hitachi HDS722020AL
    p3    OK             u0   1.82 TB   SATA  3   -            WDC WD2001FASS-00W2
    p4    OK             u0   1.82 TB   SATA  4   -            WDC WD2001FASS-00W2
    p5    OK             u0   1.82 TB   SATA  5   -            WDC WD2001FASS-00W2

    Name  OnlineState  BBUReady  Status    Volt     Temp     Hours  LastCapTest
    ---------------------------------------------------------------------------
    bbu   On           Yes       OK        OK       OK       0      xx-xxx-xxxx

Linux: tar Extract Files


Linux: tar Extract Files

by  on FEBRUARY 16, 2010 · 3 COMMENTS· last updated at FEBRUARY 16, 2011
How can I extract or uncompress a file from tar ball downloaded from the Internet under Linux using bash command prompt?

You need to use the tar command to extract files from an archive or to create an archive (also known as tarball). A tarball or an archive is nothing but a single file that contains various individual files. It also includes information which allows your to restore files to their original form by one or more extraction programs such as tar command.

Extract or Unpack a TarBall File

To unpack or extract a tar file, type:
 
tar -xvf file.tar
 
To save disk space and bandwidth over the network all files are saved using compression program such as gzip or bzip2. To extract / unpack a .tar.gz (gzip) file, enter (note -z option):
 
tar -xzvf file.tar.gz
 
To extract / unpack a .tar.bz2 (bzip2) file, enter (note -j option):
 
tar -xjvf file.tar.bz2
 
Where,
  • -x : Extract a tar ball.
  • -v : Verbose output or show progress while extracting files.
  • -f : Specify an archive or a tarball filename.
  • -j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).
  • -z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).

How Do I Extract A Single File Called foo.txt?

To extract a single file called foo.txt, enter:
 
tar -xvf file.tar foo.txt
tar -xzvf file.tar.gz foo.txt
tar -xjvf file.tar.bz2 foo.txt
 
You can also specify path such as etc/resolv.conf, enter:
 
tar -xvf file.tar etc/resolv.conf
tar -xzvf file.tar.gz etc/resolv.conf
tar -xjvf file.tar.bz2 etc/resolv.conf
 

How Do I Extract a Single Directory Called etc?

To extract a single directory called etc, enter:
 
tar -xvf file.tar etc
tar -xzvf file.tar.gz etc
tar -xjvf file.tar.bz2 etc
 
Sample outputs:
etc/
etc/pulse/
etc/pulse/default.pa
etc/pulse/client.conf
etc/pulse/daemon.conf
etc/pulse/system.pa
etc/xml/
etc/xml/docbook-xml.xml.old
etc/xml/xml-core.xml
etc/xml/catalog
etc/xml/catalog.old
etc/xml/docbook-xml.xml
etc/xml/rarian-compat.xml
etc/xml/sgml-data.xml
etc/xml/xml-core.xml.old
etc/xml/sgml-data.xml.old
etc/mail.rc
etc/Wireless/
etc/Wireless/RT2870STA/
etc/Wireless/RT2870STA/RT2870STA.dat
etc/logrotate.conf
etc/compizconfig/
etc/compizconfig/config
.....
...
....
etc/python/
etc/python/debian_config
etc/ConsoleKit/
etc/ConsoleKit/seats.d/
etc/ConsoleKit/seats.d/00-primary.seat
etc/ConsoleKit/run-session.d/
etc/ConsoleKit/run-seat.d/
etc/opt/

Original Post from: http://www.cyberciti.biz/faq/tar-extract-linux/