Launch SSH/putty from a URL
So,
you have a bunch of SSH sessions and you want to be able to launch them from a URL?
Well in order to do that you need a “handler” that will take in the SSH url and pass the command to putty
I found this post on stackoverflow that does exactly what I need
basically, you create a handler that will call a powershell command, the command will parse the url and launch putty
1 2 3 4 5 6 7 8 9 10 11 12 |
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\ssh] @="URL:SSH Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\ssh\shell] [HKEY_CLASSES_ROOT\ssh\shell\open] [HKEY_CLASSES_ROOT\ssh\shell\open\command] @="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"$uri = [System.Uri]'%l';&\"${env:ProgramFiles(x86)}\\PuTTY\\putty.exe\" -P $uri.Port $uri.GetComponents([System.UriComponents]::UserInfo -bor [System.UriComponents]::Host, [System.UriFormat]::UriEscaped)\"" |
Thank you Martin for your awesome hack!!
Sharepoint 2010 Profile Sync Stuck On “Starting”
I had an issue with my Profile Synchronization service. After a server reboot it wouldn’t start again.
What I did to fix it was:
- Stop the User Profile Service and the User Profile Synchronization Service from the Central Administration Page
- If it is stuck on starting, you need to use the SharePoint 2010 Management Shell / Powershell to stop it
1Get-SpServiceInstance
Now copy the GUID from the “User Profile Synchronization Service”
1Stop-SpServiceinstance <GUID>
You also need to delete any Setup Jobs still running
12$timerjob = Get-SPTimerJob | where {$_.Name -eq "ProfileSynchronizationSetupJob"}$timerjob.Delete() - Go to Central Administration -> Application Management -> Manage Service Applications and delete “User Profile Service Application”
- Recreated the “User Profile Service Application”
- Delete all the FIM Certificates in the MMC->Computer->Personal and MMC->Computer->Enterprise certificate stores
- Perform an IISReset
- Restart the User Profile Service and the User Profile Synchronization Service, they should now start cleanly
Solving the “java.lang.SecurityException: The provider self-integrity check failed” error with Crystal Reports Server 2011 on JBOSS 5.1
If you are deploying Crystal 2011 to JBOSS 5.1 you may get the following errors in your log
- java.io.IOException: Child not found MobileBIService/WEB-INF/lib/bcm.jar
- Could not initialize class com.businessobjects.bcm.BCM
- java.lang.SecurityException: The provider self-integrity check failed
The culprit to these two errors are the OpenSearch.WAR File and the MobileBIService.WAR File
There are a few workarounds listed in this JBOSS JIRA Ticket JBAS-7882.
The easiest solution to me was to just explode the two war files, and the errors went away

How to Change PlaceHolder values in Crystal Reports Server 2011 / BI4
I needed to update the placeholders in crystal reports server 2011 for the FRS services. In CRS2008 I changed them using placeholders.bat, but the current PlaceHolders.bat file is outdated and meant to be used on XI 3 I think. So first I had to take it upon myself to make placeholder.bat compatible with CRS2011 / BI4. (Because WE ALL KNOW SAP wont do it for us)
Here is the modified placeholders.bat script:
1 2 3 4 5 6 7 8 9 |
@echo off FOR /F "tokens=2* delims= " %%A IN ('Reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Config Manager" /v INSTALLDIR') DO SET BOHOME=%%B\ FOR /F "tokens=2* delims= " %%A IN ('Reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Config Manager" /v JAVAHOMEDIR') DO SET JAVA_HOME=%%B\.. FOR /F "tokens=2* delims= " %%A IN ('Reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Config Manager" /v SHAREDCLASSESINSTALLDIR') DO SET BOCLASSDIR=%%B\ FOR /F "tokens=2* delims= " %%A IN ('Reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\default" /v BINDIR') DO SET PATH=%%B\jdk\bin;%PATH% set CLASSPATH=.;%BOCLASSDIR%\* java Placeholders %1 %2 %3 %4 %5 %6 %7 %8 %9 |
Combine it with Placeholders.class from the placeholders.zip (SAP Note 1449399) and now you can change any pleaceholder
First lets test out the command
1 |
Placeholders.bat -cms @CMSCluster -pass $$password -allsia -display |
Now Lets update the 2 FRS Placeholders DefaultInputFRSDir and DefaultOutputFRSDir
1 |
Placeholders.bat -cms @CMSCluster -pass $$password -allsia -update DefaultInputFRSDir \\mycustompath\FileStore\Input |
1 |
Placeholders.bat -cms @CMSCluster -pass $$password -allsia -update DefaultOutputFRSDir \\mycustompath\FileStore\Output |
and the after
Enjoy!!
Running the Citrix License Server Virtual Appliance in Vmware
I thought it was cool when I found that Citrix had a Citrix License Virtual Appliance.
To me, it was one less server to “manage” plus it would allow add it to my VMWare environment to make it highly available. Well, i was disappointed to find out it was only for xenserver, so I set out to use it with VMware (because I dont like when a company tells me i cant)
This is going to take some time, and you will need to download a few things, so pay attention
You need:
Citrix License Server XVA from the Citrix Website
VirtualBox 4 from Oracle
CentOS 5 x64 Live CD ISO
XenServer ISO
How to Proceed:
Create a VM in VMWare and install XenServer (give it at least a 30GB disk)
Note the new IP of your XenServer and connect to it via your browser and follow the link to Install XenCenter
From XenCenter Load up the Citrix Licensing XVA file
Boot the VM once and then shut it down (dont configure it)
Export the License server again to an XVA (C:\Temp)
Right now you are wondering WHY we are going back to XVA, let me explain. Citrix “mangled” the header of the XVA file so only XenServer could import it. If you try to convert it directly with XenConvert you will get an error.
Install and Run XenConvert
Choose to Convert from “Xen Virtual Appliance” to “Open Virtualization Package” and just accept all the default options
When the Converter finishes, you will be left with a VHD and an OVF file.
Install and Run VirtualBox
Create a new VM called “Citrix License Server Virtual Appliance”
Choose Redhat 64-bit as the OS
Give it 512mb of RAM
Remove / Disable the Sound Card
Choose the previously created VHD (from XenConvert) as the harddisk
Boot it once, you will get an error “Error 13: Invalid or unsupported executable format”
Shut down the machine and from the menu choose “export appliance” and export it as an “OVF” <–THIS IS IMPORTANT
Open up the newly created OVF XML file with your trust text editor and change the line that read
Note: I take ABSOLUTELY NO CREDIT FOR THE FOLLOWING, this was a post from an excellent blog called IT Secure Net and you can find the post here
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
with
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
and also
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>
</Item>
to
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Caption>SCSIController</rasd:Caption>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSIController</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
Now deploy the OVF to your ESX Server. You will get a couple of warnings about the OS and asking you to continue, just hit YES
Once it finishes, start up your new VM, which should bring you back to the familiar “Error 13: Invalid or unsupported executable format” we saw earlier.
This whole time we spent it just converting the Appliance. Now we need to get it to run on VMWare.
Find that CentOS 5 X64 and Attach it to the new VM
Boot the VM and when prompted hit F5 “Linux Rescue”
Enable the Network Interface when prompted (you will need Internet Access)
From the shell, run the following commands
1 2 3 4 5 6 7 8 9 10 11 |
chroot /mnt/sysimage echo "nameserver 4.2.2.2" >> /etc/resolv.conf yum install kernel (say yes to the kernel and all its dependencies) grub-install --root-directory=/ /dev/sda --recheck echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT" >> vi /etc/sysconfig/iptables echo "3:2345:respawn:/sbin/agetty -L 9600 tty1 vt102" >> /etc/inittab |
now view your /boot/grub/menu.lst, if it already has an entry for the new kernel (2.6.18-348.6.1.el5) then you are good to go, otherwise lets use grubby to add it
1 |
grubby --add-kernel="/boot/vmlinuz-2.6.18-348.6.1.el5 --initrd="/boot/initrd-2.6.18-348.6.1.el5.img" --title="CentOS (2.6.18-348.6.1.el5)" --copy-default --make-default |
Now reboot (dont forget to disconnect the CentOS 5 ISO) and configure your new license server and Enjoy
If for whatever reason you get the “Error 13” screen again, re-load the linux rescue and delete the old entries for the el5xen kernel and img from the /boot/grub/grub.conf file
There you go Citrix, I just did your work for you!!
Combining Multiple Shares into One DFS Folder (With PowerShell)
I had the need to combine multiple Windows shares into one DFS Folder / Location. Anyone that uses DFS knows that you can either create links to the top level share or its sub folder and that there is no way to automatically combines all the folders together
Creating links to all the sub folders is fine if you have 10 or 20, but what if you have 350 links to create. Such as in my case, I had the need to create links to all the “Users” folders for every one of my departments.
Doing this would allow me to point all my scripts / group policies to one single location, without putting all the user folders on one server.
Here is the script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
<# User Home Script This cript will scan all the file server shares specified in the "UserShare" array It will then create a link for every folder in that share under the designated DFS path > $UserShare = "\\winsrv1\Users","\\winsrv2\Users","\\winsrv3\Users" $DFSRoot = "\\pinchii.com\data" $DFSPath = "$DFSRoot\userhome" function addUsers { foreach ($share in $UserShare) { #Echo $share Get-ChildItem $share | where {$_.psiscontainer} | Select-Object $_.Name | foreach {If (Test-Path $DFSpath\$_) {Echo "Skipping $_. Already Exists"} Else {Echo "Adding $_ From $Share"; dfsutil link add $DFSpath\$_ $share\$_}} } } function purgeUsers { #[xml]$xml = Get-Content c:\root.xml dfsutil root export \\ps.lan\data $evn:temp\root.xml [xml]$xml = Get-Content $evn:temp\root.xml foreach ($link in $xml.Root.Link) { #$Link.Name #$Link.Target.State #$Link.Target.'#Text' If ($Link.Target."#Text".contains("\\null") -eq $false) { If (Test-Path $Link.Target."#Text") { Echo "Skipping $($Link.Name). Target Is Good. $DFSPath" } Else { Echo "Removing $($Link.Target.'#Text') From $DFSpath"; dfsutil link remove $DFSRoot\$($Link.Name) } } } } #this is past the functions, now we process command line arguments of the script and use those to know which process to run $a = $args[0] #check if argument is null and assign a blank string if it is if (!$a) {$a = ""} switch ($a.ToLower()) { "/addusers" {addUsers} "/purgeusers" {purgeUsers} default {Echo "`r`nInvalid Argument.`n================`n `nIt must be one of the following: `n/addusers `n/purgeusers`n"} } |
That’s it. This script will scan the shares, take every sub folder and add a link to the sub folder under the DFS folder I designated. For my purpose, I used it to combine user folders, and its been working great in production for months now.
You can use this script to combine any folder, except for 1 catch. Last I checked, DFS has a limit of 5000 links per “name space”, so if you are worried about approaching that limitation, you can always create a separate namespace specifically for the user folders or whatever other folders you are planning to combine.
Unable to Connect Via RDP
I dont know why this happens,
but on some of my Citrix Servers you sometimes cannot connect via RDP
and guess what, a reboot doesn’t fix it.
Well, this handy little script will help solve your issue, not only with RDP, but also with ICA
RDP / ICA Reset Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
@Echo Off ECHO RDP / ICA Reset Script Echo. Echo. SET /p ServerName=Enter Server Name: || Set ServerName=Nothing If "%ServerName%"=="Nothing" goto _error reset session rdp-tcp /server:%ServerName% reset session ica-tcp /server:%ServerName% :_error echo Nothing was chosen :_end echo Done mstsc /v %ServerName% |
I dont remember exactly where I got this script but its been in my toolbox for a while, credit to the originator whomever you may be
NetScaler VPX and the “ssl_error_no_cypher_overlap”
If your management gui is not able to use SSL, or In order to fix the ssl_error_no_cypher_overlap error with the netscaler VPX
access your netscaler via http://yournsip/
Go to “Load Balancing” -> Services -> Internal Services
Open up the nshttps-127.0.0.1-443 service
Click over to the SSL Settings tab and click on the Ciphers button
Remove all ciphers and add “DEFAULT” under the “Configured Ciphers Group”
Do the same exact procedure for the nsrpcs-127.0.0.1-3008
After you click on, Hit the Save button, and try to connect to your NSIP with https
Check which Policy is being hit on the Citrix NetScaler
Want to know which policy is being hit on the netscaler. In real time!!
- From the Command line of the netscaler type
1Shell - issue the command
1nsconmsg -d current -g pol_hits - What to check for a specific Policy, just add the “grep” command
1nsconmsg -d current -g pol_hits | grep "Citrix"
where “Citrix” is the Policy you are looking to trace
Garbled Text in ADB Shell
When you “ADB Shell” into your android Device and perform an “ls” command, and you are seeing a log of gabled text with some numbers and some arrows, don’t freak out, your device is not broken. Those numbers and arrows are meant to be instructions for your console app to display the different folders with colors
no you don’t have to live with it, just tell your console not to display the color information anymore, just simply type
1 |
alias ls="ls --color=never" |
and then you should be ok when you issue a “ls” command