Wednesday, January 27, 2016

gdbm fatal: lseek error

 gdbm fatal: lseek error  
   
 on my nice ubuntu 10 system, i get the above when i run an non-existent commmand.  
   
 when i issue:  
 # lasal  
   
 i would expect to see something like:  
   
 No command 'lastal' found, did you mean:  
   Command 'lastal' from package 'last-align' (universe)  
  lasal: command not found  
  -bash: lasal: command not found  
    
 that function is dependent upon this package:  
   
 command-not-found  
   
 i issue:  
 # apt-get remove command-not-found  
   
 then when i run a non-existent command:  
 # /usr/bin/python: can't find '__main__.py' in '/usr/share/command-not-found'  
   
 oh... there appears to be a bug with command-not-do and amd64  
   
 # dpkg -L command-not-found-data  
   
 ...  
   
 # cd /usr/share/command-not-found/programs.d/  
 # rm amd*  
   
 and there we go.  

Tuesday, January 26, 2016

solaris 10 nfs client broken?

 [root@crapsun ~]# rpcinfo -u localhost nfs  
  
 instead of this:
 
 program 100003 version 2 ready and waiting
 program 100003 version 3 ready and waiting
 program 100003 version 4 ready and waiting

 i get errors.
 
 rpc is having a really bad day. no rpcinfo on the localhost means no mounting of nfs exports from other servers.
 rpc happens to be a good friend of nfs/client:default 
   
 so.  
   
 [root@crapsun ~]# svcs -xv  
 svc:/network/nfs/client:default  
   
 i n t e r e s t i n g  
   
 [root@crapsun ~]# svcs -xv  
 svc:/network/rpc/gss:default (Generic Security Service)  
  State: offline since Tue Jan 26 13:58:42 2016  
 Reason: Unknown.  
   See: http://sun.com/msg/SMF-8000-AR  
   See: man -M /usr/share/man -s 1M gssd  
 Impact: 6 dependent services are not running:  
     svc:/network/nfs/client:default  
     svc:/milestone/multi-user:default  
     svc:/system/webconsole:console  
     svc:/application/graphical-login/cde-login:default  
     svc:/milestone/multi-user-server:default  
     svc:/application/cde-printinfo:default  
       
 [root@crapsun ~]# svcadm enable svc:/network/rpc/gss:default  
 [root@crapsun ~]# svcadm restart svc:/network/rpc/gss:default  
   
 [root@crapsun ~]# svcs -xv  
 crickets  
   
 awesome.  
   
 [root@crapsun ~]# mount -a  
 it works!  
   
       
   

Monday, January 25, 2016

one-shot live linux system backup

 one shot live linux system backup:  
   
 1. install target system with same os as source.  
 2. boot into target system via a rescue disk.  
 3. rsync -aAXv root@source:/* /target-rootdirectory --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"}  
   
 or if you want to be simple:  
   
 rsync -aHxv root@1.2.3.4:/* /target-rootdirectory --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/swap  

these are nice:
http://djlab.com/2013/02/cloning-a-live-linux-system-with-rsync-over-ssh/
https://wiki.archlinux.org/index.php/full_system_backup_with_rsync

don't forget to:
updatedb
mandb -c

Tuesday, January 19, 2016

make my public vpn a work vpn please

 My work VPN network is not work but Public and no Internet for me.  
   
 Open Regedit. Go to:  
 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles  
   
 Copy the GUID of the network in question. Description/Network name keys are useful.  
   
 Run:  
   
 C:\Windows\system32\rundll32.exe" pnidui.dll,NwCategoryWiz {4DDC37BD-11FD-4AAE-8987-3B0814B155AD} 0  
   
 Select the network type and voila, you're online.  

Monday, January 18, 2016

recursive pkgadd on solaris10 zone

 #!/usr/bin/bash  
   
 rm -rf *.gz  
 rm -rf *.zip  
   
 if [ -f /var/sadm/install/.lockfile ] ; then  
     echo "sadm pkgadd lockfile present"  
       
     read -r -p "delete? [y/N] " response  
         case $response in  
         [yY][eE][sS]|[yY])   
           
         rm -rf /var/sadm/install/.lockfile  
           
         ;;  
     *)  
         quit  
         ;;  
     esac  
 fi  
   
 if [ -f /tmp/.ai.pkg.zone.lock-* ] ; then  
     echo "zone pkgadd lockfile present"  
       
     read -r -p "delete? [y/N] " response  
         case $response in  
         [yY][eE][sS]|[yY])   
           
         rm -rf /tmp/.ai.pkg.zone.lock-*  
           
         ;;  
     *)  
         quit  
         ;;  
     esac  
 fi  
   
 if [ -f /var/sadm/install/.pkg.lock ] ; then  
     echo "pkgadd lockfile present"  
       
     read -r -p "delete? [y/N] " response  
         case $response in  
         [yY][eE][sS]|[yY])   
           
         rm -rf /var/sadm/install/.pkg.lock  
           
         ;;  
     *)  
         quit  
         ;;  
     esac  
 fi  
   
 for i in *local; do pkgadd -d $i; done  

Monday, January 11, 2016

vcenter 5.5 root password hijinx

this:


Also when I connected with SSH to the Appliance I’m getting error messages that my password is not correct.

I know for sure that this password is the correct one. I opened a console screen from the vSphere Webclient and that one is also giving me the error.

Also the VMware vSphere Web Client is giving an error.
I am unable to logon with the root account of the appliance.
Ok.. This is a problem. I remembered reading a blog post of William Lam about a problem with the expiration date of the Root Password. So I started searching the VirtualGhetto blog site, and found the article. See http://www.virtuallyghetto.com/2013/09/how-to-recover-vcsa-55-from-expired.html
So I followed the steps described in Williams article.
  1. Boot up vCenter Server using a current Linux live CD. I am using a Ubuntu ISO that I had.
  2. Mount the VMware vCenter Server Appliance root partition. This should be /dev/sda3
  3. Edit the /etc/shadow file with your favorite editor. Advice make a copy of the shadow file before editing it.
  4. When the root password is expired there should be an x in front of the password string. This was the case
  5. Remove the x in front of the password string and save the shadow file.
  6. Reboot the VCSA. If everything went well you are able to logon with the root account.
I was able to logon into the appliance again, but to prevent future problems with the password expiration I disabled the expiration in the management page of the VCSA. Because this is my home lab this is ok.

In production environments this is not advisable
Lessons learned:
  • Configure a SMTP server and an alert email account so you will be notified when the password is going to be expired.
  • Or in a home lab environment, disable the expiration date of the root password.
More information:

Related articles:

Di