How to increase the laptop battery life in Ubuntu?


Solution : Pm-powersave  is the command in Ubuntu put your computer into low power mode.

Options:

  1. $sudo pm-powersave true  will enable the laptop to work under reduce energy consumption and extend your battery life.

2. $sudo pm-powersave  false will turn off the energy consumption mode.(low power mode)

 

Ref : http://manpages.ubuntu.com/manpages/hardy/man8/pm-powersave.8.html

Linux server monitoring tool & Backup of ubuntu


NMon is an application which gives entire report utilization of linux server. To install this

$sudo apt-get install nmon

Please see the screenshot of example below

 

 

 

 

 

 

 

2. To backup and restore of Ubuntu machine please go through the url below.

url : http://ubuntuforums.org/showthread.php?t=35087

Cool tips in Linux


1. In a terminal we enter and come out of many directories available in the file system.  But when we want to go back to the earlier same directory, there is an option available to toggle between directories using the command cd –

Please find the example and screenshot below.

Eg:

root@hostname:~/winshare# pwd

/root/winshare

root@hostname:~/winshare# cd ..

root@hostname:~# cd –

/root/winshare

root@hostname:~/winshare#

 

 

 

 

2. If you are a terminal user and works with terminal for a long time, you need an alarm to get rid of this terminal as you have some personal commitments. Leave is a command which sets alarm in terminal mode. Please see the example below

Eg:

root@:~# leave +1

Alarm set for Fri Jul 27 11:56. (pid 13727)

Just one more minute!

root@:~# Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

Time to leave!

That was the last time I’ll tell you.  Bye.

root@:~#

 

 

 

 

 

The virtual directory ‘PowerShell’ already exists under ‘exchange hostname (FQDN)/Default Web Site’.


Error:
The following error was generated when “$error.Clear();
$vdirName = “PowerShell”;
$InternalPowerShellUrl=”http://” + $RoleFqdnOrName + “/powershell”;
new-PowerShellVirtualDirectory $vdirName -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false;
” was run: “The virtual directory ‘PowerShell’ already exists under ‘exchange hostname (FQDN)’/Default Web Site’.
Parameter name: VirtualDirectoryName”.
The virtual directory ‘PowerShell’ already exists under ‘exchange hostname (FQDN)/Default Web Site’.
Parameter name: VirtualDirectoryName
Click here for help… http://technet.microsoft.com/en-US/library/ms.exch.err.default(EXCHG.141).aspx?v=14.1.218.11&e=ms.exch.err.Ex88D115&l=0&cl=cp

Solution:

On the offending Exchange Server open ADSIEDT.

Click on Action and select “connection”.
Select “Configuration” from the drop down in the   “Connection  Settings” dialog

 

 

 

 

 

Navigate to:
CN=Configuration,DC=domain,DC=suffix
CN=Services
CN=Microsoft Exchange
CN=[your domain]
CN=Administrative Groups
CN=Exchange Administrative Groups
CN=Servers
CN=[your server]
CN=Protocols
CN=HTTP
Find the (in the right pane) CN=Powershell (Default Web Site), CN=HTTP…  and delete it.

 

 

 

 

Open the registry editor and navigate to

KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\MailboxRole

Find the “Action” key and delete it.

 

 

 

 

Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager
Locate the “PendingFileRenameOperations” key and delete it.

 

 

 

 

Restart the setup fromnthe command line as shown in digram 4.  NOTE: in my

example I am using the:

Setup.com /mode:uninstall /roles:mailbox

You may be using:
Setup.com /mode:install /roles:mailbox  for an install or upgrade, in my case I was uninstalling the server.

 

 

 

This will uninstall the existing Exchange roles and you can install exchange 2010 freshly without any errors.

 

 

PDF file compression by opensource


There is a requirement to reduce the PDF file size of 47MB by open source tool.

The options I come across

1. Ghost script:

Installed ghost script by $sudo apt-get install ghostscript and tried the below command

$gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

dPDFSETTINGS=/screen —> in this syntax there are various method of compression tools available like /printer instead of /screen for the size variation according to the requirement.

But this never works to me and also corrupts the source file.

2. PDFTK:

Installed pdftk by $sudo apt-get install pdftk and tried the below command

$pdftk file1.pdf output file2.pdf compress

The size remain unchange (same 47MB)

 

3. I tried to convert the pdf file to ps and PS to pdf. It works !!!

The syntax is

$pdf2ps  file1.pdf   file1.ps

$ps2pdf  file1.ps   file2.pdf

The size reduced from 47 MB to 2MB.

This is a simple option and nevertheless to worry about ghostscript syntax.

VMware health and report generation – community products.


Today I come across two products which gives more information and customized report for ESX Host,Vcenter and SAN connected to ESX.

With the help of these two products we can generate health report easily without scripting knowledge in VMware.

The two products are 1. PowerGUI communitypack for VMware and 2. RV-tools.

Please find the screenshot below.

1. PowerGUI community pack

 

 

2. RV-Tools

 

 

 

Download url

  1. Rvtools: – http://www.robware.net/
  2. PowerGUI community pack. You need to download and install powergui application and then the power pack.
    1. http://community-downloads.quest.com/powergui/Release/3.2/PowerGUI.3.2.0.2237.msi
    2. http://www.virtu-al.net/featured-scripts/vmware-powerpack/

Hardening in Vcenter – Inactivity Timeout


Scenario:

If you open a vcenter application and forget to close the application, unauthorized person can able to change or view the configuration in Vcenter. Hence it requires session timeout if the Vcenter is not in use.

Solution:

To configure the session time out in Vcenter, you need to locate the file VpxClient.exe.config. This file is available in the following path

32bit – %PROGRAMFILES%\VMware\Infrastructure\Virtual Infrastructure Client\Launcher

64bit – %PROGRAMFILES(x86)%\VMware\Infrastructure\Virtual Infrastructure  Client\Launcher

Edit the file using text editor like Notepad, Wordpad etc…

Insert and type the text in between as given below.

 

“<!– ignore sertificate validation problems:

    <ignorecert />”

<inactivityTimeout>X</inactivityTimeout>  

 

</cmdlineFallback>

 

Save the file and close. Here X represent the time in minute.

The example screenshot of the inactivity timeout given below.

 

 

Also type the -inactivity timeout X,  by right click the VSphere client icon available in Desktop and select the shortcut option. Go to target, you will see the path of the VPXClient . At the end of the line type the –inactivity timeout X. please see the below diagram.