Featured Post

How to recover BCH sent to BTC address?

Published / by panduchunduri@gmail.com / Leave a Comment

Bitcoin and Bitcoin Cash use the same address format, Legacy address starts with “1..” and Segwit address starts with “3..”. If you have sent BCC/BCH to Legacy address (1) it is easy to recover.

  • On Ledger – You will find coins in BCH main account 
  • on Trezor – Go to https://trezor.io/recover-coins/ to recover BCH coins 
  • On Exchange – Contact Exchange support

If you have sent Bitcoin Cash to Segwit (3) address, you BCH are struck and it is not easy to recover. BCH is a fork of BitCoin network and SegWit is not activated on Bitcoin cash network. You can ask a single miner to run a non-standard transaction and hope miner doesn’t take all the coins, Miner might ask for your public key, transaction Id, and destination address.

Recently bch.btc.com launched a tool for this purpose and they charge 10% as recovery fee. I’ve used that service once and got back 90% of BCH in under 12 hours – Use it at your own discretion.


Featured Post

Your Intranet in Your Pocket: The SharePoint mobile app

Published / by panduchunduri@gmail.com / Leave a Comment

Microsoft launched SharePoint for iOS, its first mobile SharePoint app. The tool gives you access to the files, portals, sites and teams that you’re used to on the desktop. It’s also smart enough to hop between apps depending on what you’re accessing. It’ll jump to OneDrive if you’re peeking at the company’s document library, for instance, or switch to one of the Office apps if you’re opening a recent file.

Featured Post

Start/Stop EC2 instances by Tags using PowerShell

Published / by panduchunduri@gmail.com / Leave a Comment

In most cases, organizations will be running their AWS instances 24-hours a day, 7 days a week. You can reduce your costs significantly by scheduling non-production EC2  instances to shutdown when they are not required.

  • Start and Shutdown EC2 instances to run during business hours
  • Stop all non-production EC2 instances at evenings and weekends

Lambda function below can be scheduled to stop the instances and save costs

#Ge AWS credentials from metadata
$proxy = "x.x.x.x"
$webClient = new-object System.Net.WebClient
$proxy = new-object System.Net.WebProxy $proxyServerToDefine,"True","169.*"
$iam = $webClient.DownloadString("")
$iamProfileInfo= ConvertFrom-Json ($webClient.DownloadString("$iam"))
Set-AWSCredentials -AccessKey $iamProfileInfo.AccessKeyId -SecretKey $iamProfileInfo.SecretAccessKey -SessionToken $iamProfileInfo.Token
#This is to get all the instanced with a tag name Environment with value DEV
$instances = (Get-EC2Tag | where {$_.Key -eq "Environment" -and $_.ResourceType -eq "instance" -and $_.Value -eq "DEV"}).ResourceId
foreach ($instance in $instances)
$instancestatus = Get-EC2InstanceStatus -InstanceIds $instance
$InstanceName = (Get-EC2Tag | where {$_.ResourceId -eq $instance -and $_.Key -eq "Name" }).Value
#Instance Value is NULL for all stopped instances on AWS using Powershell
if($instancestatus -eq $null)
Write-Host "(NO ACTION)" $InstanceName "is stopped"
Write-Host "Stopping Instance: " $InstanceName
Stop-EC2Instance -Instance $instance

Execute SharePoint timer jobs on multiple computers

Published / by panduchunduri@gmail.com / Leave a Comment

The Invoke-Command cmdlet runs commands on a local or remote computer and returns all output from the commands, including errors. By using a single Invoke-Command command, you can run commands on multiple computers.

To run a single command on a remote computer, use the ComputerName parameter. To run a series of related commands that share data, use the New-PSSession cmdlet to create a PSSession (a persistent connection) on the remote computer, and then use the Session parameter of Invoke-Command to run the command in the PSSession. To run a command in a disconnected session, use the InDisconnectedSession parameter. To run a command in a background job, use the AsJob parameter.

invoke-command -computername computer1,computer2 {asnp *sharepoint*;stop-service spadminv4; Start-SPAdminJob;start-service spadminv4}

This command stops the admin service, executes the timer jobs and starts the admin service.


SharePoint – Render HTML files in the browser

Published / by panduchunduri@gmail.com / Leave a Comment

SharePoint 2013 web applications have browser handling level set to strict. This setting prevents browser from rendering HTML files. HTML files are one example file type that you may want to have open directly in the browser rather downloading and then opening. Use the below script to add HTML and HTM Mime types to Web Application.

$webApplication = Get-SPWebApplication "http:/contoso"
//HTML Files 
//HTM Files

AWS Lambda Function for Snapshots

Published / by panduchunduri@gmail.com / Leave a Comment

You can back up the data on your EBS volumes to Amazon S3 by taking point-in-time snapshots. Lambda function can be used to automate this for daily or weekly backups. Using Lambda is best option than running a machine with Bash or PowerShell scripts. This function also deletes the snapshots that are 30 days or old.

import boto3
 import collections
 import datetime
 import logging
 logger = logging.getLogger()
#Retention for 30 days - Change accordingly
retention_days = 30
def _getRegions():
 #logger.info('Getting list of regions')
 ec2Client = boto3.client('ec2')
 regions = []
 for region in ec2Client.describe_regions().get('Regions', []):
 return regions
 except Exception as e:
 raise e
 def lambda_handler(event, context):
count = 0
 regions = _getRegions()
 for region in regions:
 #logger.info(region.get('RegionName', ''))
 ec = boto3.client('ec2',region_name=region.get('RegionName', ''))
 reservations = ec.describe_instances()['Reservations']
 for reservation in reservations:
 for instance in reservation['Instances']:
 count = count + 1
 # retention_days = [int(t.get('Value')) for t in instance['Tags'] if t['Key'] == 'Retention'][0]
 # retention_days = 14
 instance_name = [str(t.get('Value')) for t in instance['Tags'] if t['Key'] == 'Name'][0]
 #logger.error("Name not defined for " + instance['InstanceId'])
 instance_name = str(instance['InstanceId'])
for dev in instance['BlockDeviceMappings']:
 if dev.get('Ebs', None) is None:
 vol_id = dev['Ebs']['VolumeId']
 #logger.info(instance_name + '-' + str(dev['DeviceName']) + '-' + datetime.datetime.now().strftime("%Y-%m-%d-%H:%M"))
 #logger.info('Found EBS volume %s on instance %s' % (vol_id, instance['InstanceId'])
 snap = ec.create_snapshot(VolumeId=vol_id,)
 value = instance_name + '-' + str(dev['DeviceName']) + '-' + datetime.datetime.utcnow().strftime("%Y:%m:%d:%H:%M")
 ec.create_tags(Resources=[snap['SnapshotId'],],Tags=[{'Key': 'Name', 'Value': value },])
 delete_date = datetime.datetime.utcnow() - datetime.timedelta(days=retention_days)
 delete_date = delete_date.strftime('%Y-%m-%dT%H:%M:%S.000Z')
 #logger.info('Deleting snapshots older than %d days (before %s) in region %s' % (retention_days, delete_date, regionname) )
 #logger.info('setting date to delete:' + str(delete_date))
 snapshotsobject = ec.describe_snapshots(OwnerIds=['XXXXXXXXXXX'])
 snapshots = snapshotsobject['Snapshots']
 for snapshot in snapshots:
 start_date = snapshot['StartTime'].strftime('%Y-%m-%dT%H:%M:%S.000Z')
 if start_date < delete_date:
 logger.info('Deleting snapshot: snapshotid-' + snapshot['SnapshotId'] +' createddate-'+str(snapshot['StartTime'] ))
 logger.error('error deleting snapshot: snapshotid-' + snapshot['SnapshotId'] +' createddate-'+str(snapshot['StartTime'] ))
return 'success'