Saturday, March 5, 2011

the specified key name or identifier already exists

SkyHi @ Saturday, March 05, 2011
ERROR:
  • a virtual machine or a template having the same name is already registered
  • the specified key name or identifier already exists
Solution:
HOME->Inventory->REMOVE the old VM or template from inventory

Friday, March 4, 2011

Ubuntu: Sending command line mail

SkyHi @ Friday, March 04, 2011
user@Januty:~/BashTuts$ mail -s "user1" user1@gmail.com
The program 'mail' can be found in the following packages:
 * heirloom-mailx
 * mailutils
Try: sudo apt-get install

user@Januty:~/BashTuts$ sudo apt-get install mailutils
didn't configure postfix


Mar  4 15:26:22 Januty postfix/error[10911]: 8226929760: to=, relay=none, delay=2.1, delays=2/0.01/0/0.09, dsn=5.0.0, status=bounced (gmail.com)

ERROR:
fatal: open /etc/postfix/main.cf: No such file or directory

Solution:
user@Januty:~/BashTuts$ sudo dpkg-reconfigure postfix





Please select the mail server configuration type that best meets your needs.
            â
            â  No configuration:
            â   Should be chosen to leave the current configuration unchanged.
            â  Internet site:
            â   Mail is sent and received directly using SMTP.
            â  Internet with smarthost:
            â   Mail is received directly using SMTP or by running a utility such
            â   as fetchmail. Outgoing mail is sent using a smarthost.
            â  Satellite system:
            â   All mail is sent to another machine, called a 'smarthost', for delivery.
            â
            â          



=======================================================================
Ubuntu: Sending command line mail
I needed to send email from the command line, specifically for cron jobs, and there are many programs which can do this. I'm going to use the gnu mailutils package so first off let's install the mailutils package:
# apt-get install mailutils

This will add a few extra packages, then bring us up into an exim4 configuration screen. My systems are behind a dsl router, and I'm not going to route the mail through any relay host, I just want everything sent direct (for some sendmail agents this might cause problems, but you'll have to look at your logfiles). In the exim4 config screen I pick "internet site... mail is sent and receieved directly using SMTP". On edgy you might have to answer a few more questions, but I had to run a dpkg-reconfigure.

At this point we have exim4 listening on port 25 and I don't need that, so I need to stop the daemon and remove the startup links:
# /etc/init.d/exim4 stop
# update-rc.d -f exim4 remove


The update-rc.d command removes inits startup/shutdown links, but unfortunately if the exim4 packages get updated the links will be back so we need to run that command again.

Now lets try sending a test mail:
# echo testing | mail -s Bla myemail@somewhere.com

and take a look at /var/log/exim4/mainlog. You should be good to go!

REFERENCES
http://www.quietearth.us/articles/2006/09/25/Ubuntu-Sending-command-line-mail                      

How to Control a Mac From a Windows PC With TightVNC(RealVNC)

SkyHi @ Friday, March 04, 2011
VNC, short for "Virtual Network Computing," is a graphical way of remotely controlling another computer. When you're connected to another computer with VNC, you see that computer's desktop as if you were right in front of it. You control that computer's mouse with your mouse, keyboard with your keyboard, and see exactly what's on the other computer's display on your monitor.

Because VNC is cross-platform, meaning it can be used on Windows, Mac and Linux computers, you can control a Windows PC from a Mac, Linux PC from a Windows PC and all other variations you can think of.

The controlled computer is called the Server and the controlling computer is called the Client.

Here is how it works.

Instruction 

How to Set Up the Server

1.Click on the blue Apple logo on the top left of your screen and select "System Preferences."

2.Select "Sharing" in the Internet & Network section, the third down from the top.

3.Click on the check box next to "Apple Remote Desktop" to activate it. In Mac OSX Leopard, this will be "Remote Mangement."

4.Click the "Access Privileges" button to the right of the "Services" box. In Mac OS X Leopard, click on the "Computer Settings" button.

5.Check "VNC viewers may control screen with password" and enter a secure password. Strong, secure passwords are a combination of numbers and letters with the occasional symbol thrown in. Remember your password.

6.Type in your Mac password in the "Authentication" dialog box that pops up on your screen. This will allow System Preferences to set the password for VNC users.

7.Write down the IP address of the Server Mac, which is located under the "Services" box of the "Sharing" preferences window.

How to Set Up the Client and Control the Server

8.Download and install TightVNC. See Resources below to download.

9.Uncheck "TightVNC Server" and "Web pages and documentation" on the "Select Components" part of the TightVNC install. Leave "TightVNC Viewer" checked.
Run TightVNC after installation is complete.

10.Enter the Mac Server's IP Address and hit "OK"

Enter the Mac Server's password that you set up in Section 1. A window should pop up with the Mac desktop.

 

REFERENCES: 

http://www.ehow.com/how_2193968_mac-windows-pc-using-tightvnc.html 

Mac Screen sharing with Windows: Server did not offer supported security type

SkyHi @ Friday, March 04, 2011
Mac screen sharing from a windows machine using tightvnc(realVNC).
Mac to Mac, go->vnc://ip

ERROR:
I'm getting the error
"Server did not offer supported security type"

SOLUTION:
in System Preferences, Sharing, Screen Sharing, Computer Settings: you have "VNC viewers may control screen with password:" checked. And a password filled in.

realvnc setting:
[Options]
UseLocalCursor=0
UseDesktopResize=1
FullScreen=1
FullColour=1
LowColourLevel=1
PreferredEncoding=ZRLE
AutoSelect=1
Shared=1
SendPtrEvents=1
SendKeyEvents=1
SendCutText=1
AcceptCutText=1
DisableWinKeys=1
Emulate3=0
PointerEventInterval=0
Monitor=
MenuKey=F8
AutoReconnect=1


REFERENCES

http://apple.stackexchange.com/questions/6362/connect-to-vnc-from-windows
http://www.ehow.com/how_2193968_mac-windows-pc-using-tightvnc.html
http://forums.macrumors.com/archive/index.php/t-380251.html
http://shebangme.blogspot.com/2010/11/mac-remote-control-options-screen.html

Thursday, March 3, 2011

Password protect GNU screen sessions

SkyHi @ Thursday, March 03, 2011
Or, How do i get a crypted password for .screenrc ?
Here is a quick tip, hopefully it helps someone, I struggled with this for some time…
I have been using GNU screen program since a long time. This program is like a window manager for terminals and is especially useful for ISP and home shell accounts. You can have multiple shells running under the same session and can easily detach the sessions and reattach them from a different computer later etc.
I usually password protect my sessions by using the password command (ctrl A :password). But I had a hard time figuring out how to set that password in .screenrc file. The file obviously does not store it in plaintext and uses a crypted version of password. To get the crypted password, simply set your password in the screen session (ctrl A :password and then enter the password twice), then the crypted version gets automatically saved to screen’s copy buffer! All you need to do is have a line in your .screenrc which looks like this
password DTWxS2voQWkgI
After this all your new screen sessions will be automatically password protected (meaning you will need the password to reattach a session.)


REFERENCES
http://amit.chakradeo.net/2009/02/04/password-protect-gnu-screen-sessions/