Diary

May 20, 2010

Windows authentication and run as

Filed under: Uncategorized — Himanshu @ 5:58 am

We have multiple DCs in our organization for a reason, and we need to access SQL Server hosted on different DC several times. To login into SQL Server using windows authentication I use following:

C:\Windows\System32\runas.exe /netonly /user:<different domain name>\<username of different domain name”> "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

February 24, 2010

Cisco VPN throwing error as “Failed to enable Virtual Adapter”

Filed under: Uncategorized — Himanshu @ 10:50 am

In Windows 7, I have see this error many times when trying to connect using Cisco VPN Software.

failed to enable virtual adapter

I could resolve the issue by

  1. Enable Cisco Network adapter
  2. Diagnose the adapter by option given in context menu
  3. Disable adapter
  4. Try connecting to the network again

Update: If above do not solve the problem and surprisingly it wouldn’t sometime! Restart the machine.

January 8, 2010

Linux, setting system wide variable

Filed under: Uncategorized — Himanshu @ 12:11 pm
 
my-box:~$ sudo su -
Password:
root:~# cat >> /etc/profile
JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME
root:~# 

January 1, 2010

refcardz.dzone

Filed under: Uncategorized — Himanshu @ 5:20 pm

 http://refcardz.dzone.com/

I  like some of the cards, can really give a good quick start on sometime.

September 8, 2009

SQL Server DB Diff and Sync

Filed under: Uncategorized — Himanshu @ 7:49 am

Haven’t tried it but, seems good, though if someone wants to pay, tryout this as well

August 24, 2009

mono issue: Standard output has not been redirected or process has not been started.

Filed under: Uncategorized — Himanshu @ 6:04 am

Fix is found from http://www.debianadmin.com/running-aspnet-applications-in-debian-and-ubuntu-using-xsp-and-mono.html

   1:  
   2:  sudo find /usr/bin | grep gmcs
   3:  
   4:  if result is NOT
   5:  /usr/bin/gmcs
   6:  /usr/bin/gmcs2
   7:  
   8:  try
   9:  1)install mono-gmcs package (if only have “/usr/bin/gmcs”)
  10:  or
  11:  2)in case you have only “/usr/bin/gmcs2? make symlink on it named gmcs
  12:  sudo ln -s /usr/bin/gmcs2 /usr/bin/gmcs

restart apache2 or xsp or your web server and check result in browser.

August 19, 2009

Setup SSH to authenticate only by key

Filed under: Uncategorized — Himanshu @ 6:23 am

Assumption:

  • Client is windows and you will connect to server using putty
  • Server is Ubuntu, I have tried this with Ubuntu 9.04 and it worked
  • Root login is possible to server and have access to command line

 

Step 1: Prepare server for ssh server

   1: apt-get install ssh
   2: sudo apt-get install openssh-server

First line will install ssh on the server and second line with install openssh-server. If you are doing apt-get for the first time, make sure you have done apt-get update once so that server is updated for repositories.

Step 2: Create public - private keys

   1: ssh-keygen

This will create public - private key on the server, keys can also be created using PUTTYGEN.EXE but in this post, we will do it on server. Once public - private keys are generated. they will be placed in ~/.ssh folder. Private key will be in id_rsa and public key will be id_rsa.pub. One server we need only public key.

Step 3: Download private key using PSFTP

Login to server using psftp, see help of putty (putty.chm) in case if you need help in using psftp. You will need to use open, lpwd, lcd, cd and get command of psftp

Step 4: Generate private key (of .ppk format) using PUTTYGEN.EXE

Open downloaded private key from server into puttygen.exe. You may need to type in passphrase if you have setup one while using ssh-keygen. Once key is open click on save private key button in puttygen.exe. This will generate .ppk file which can be later used with putty.exe

Step 5: Copy public key content to authorization key file on server

On server go to ~/.ssh using console where public and private key was generated, and execute following commands

   1: cat id_rsa.pub >> ~/.ssh/authorized_keys
   2: rm id_rsa.pub
   3: rm id_rsa

This will create authorizaed_keys which server will use while authenticating user. And also delete public - private key file generated by ssh-keygen

Step 6: Make sure server accepts login using RSA keys

open /etc/ssh/sshd_config this is configuration file of ssh server. Make sure file has following configured

   1: RSAAuthentication yes
   2: PubkeyAuthentication yes 

Use /etc/init.d/ssh reload to reload the changed configuration

Step 7: Try out login using RSA key file

Open putty.exe from client and type in host (name or ip) and supply .ppk file. On logon to server, it should ask user name, will also ask for passphrase if setup while generating key files.

ssh

Step 8: Disable plain text password authentication

open /etc/ssh/sshd_config file again and make sure you have following configuration entries to disable plain text password authentication

   1: ChallengeResponseAuthentication no
   2: PasswordAuthentication no

Use /etc/init.d/ssh reload to reload the changed configuration. Also try out that its disabled using putty and supply user name without RSA key file

Step 9: Optionally change the port number for extra security

open /etc/ssh/sshd_config file and change configuration for port.

July 30, 2009

jQuery theme

Filed under: Uncategorized — Himanshu @ 8:01 am

It’s awesome again. Everything around jQuery, I found it awesome and really usefull. I haven’t seen other ajax and or javascript librarry/framework.  But I think I should also look into YUI, dojo Toolkit, Ext

By the way, post is about jQuery theme and if you want to create jQuery theme, easier way is this:http://www.dojotoolkit.org/

July 28, 2009

Image MagicK | image convention, .NET integration

Filed under: Uncategorized — Himanshu @ 6:09 pm

This seem interesting, it allows to convert image from command line and also has .NET interface to it

http://www.imagemagick.org/script/index.php

http://www.imagemagick.org/script/api.php#dot-net

Also has some cool usage http://www.imagemagick.org/Usage/color/#replace_draw

Any element: Round corner, many type of corner using jQuery

Filed under: Uncategorized — Himanshu @ 2:06 pm

jQuery is awesome. I think all browsers should support jQuery in-built.

http://malsup.com/jquery/corner/

Older Posts »

Powered by WordPress