Skip to content

Instantly share code, notes, and snippets.

View theramiyer's full-sized avatar

Ram Iyer theramiyer

View GitHub Profile
@theramiyer
theramiyer / Get-TotalItemSize.ps1
Created March 6, 2016 14:04
PowerShell script to get the Total Item Size of an Exchange mailbox database
$Date = Get-Date -UFormat %Y%m%d
$FileName = "TotalItemSizeReport" + $Date + ".csv"
$DbList = (Get-MailboxDatabase | select Name -ExpandProperty Name | Sort-Object) #Query a list of all databases and sort it.
$SizeTable = @{} #Define an empty hash table.
foreach ($Db In $DbList)
{
$TotalItemSize = (Get-MailboxStatistics -Database HQMB1DB1 | ForEach-Object {$_.TotalItemSize.Value.ToBytes()} | Measure-Object -Sum).Sum/1GB
$SizeTable.Add($DB,$TotalItemSize) #Add content to the hash table.
}
$SizeTable.GetEnumerator() | Sort-Object -Property Name | Export-Csv "\\Server\Path\$FileName"
@theramiyer
theramiyer / Update-ScepVersionHistoryTable.ps1
Created March 6, 2016 15:02
Script to read the "What's new" page for System Center Endpoint Protection definition. It collects the version number and the time it was released, and updates a predefined CSV file.
#region Initial variable declaration
$Uri = "https://www.microsoft.com/security/portal/definitions/whatsnew.aspx"
$ScepVersionInventoryPath = "C:\Users\Ram\Downloads\SCEP Version History.csv"
#endregion
Clear-Host
# Function to convert UTC time to local time.
Function Get-LocalTime($UtcTime)
{
$TimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById('Central Standard Time')
$LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc($UtcTime, $TimeZone)
@theramiyer
theramiyer / Jekyll > BitBucket > Wercker > AWS S3 > CloudFront.md
Last active April 18, 2019 08:16
How to host Jekyll code on BitBucket, build it with Wercker, and host the site on AWZ S3

Jekyll is, no doubt, one of the best blog-aware static site generators available out there. While hosting the Jekyll site on GitHub Pages seems to be a very common practice, there are situations where we need the code source-controlled privately. GitHub charges for private repositories. BitBucket is the next go-to choice.

If the code is stored on BitBucket, GitHub pages may not be a possible hosting option, which brings us to Amazon Web Services. This gist is about having the code on BitBucket, having Wercker build the site and deploy it to AWS S3, and then having CloudFront deliver the site.

Here's a gist of how this is done:

  1. You add data to the code (basically Markdown files) as posts. These changes are pushed to BitBucket, the source control provider for the site.
  2. Wercker (a Docker-based continuous delivery platform) is triggered as soon as there's a push; it picks up the code from BitBucket.
  3. Wercker has two pipelines, build and deploy, which, of course, builds the site using Jekyll (on a R
@theramiyer
theramiyer / arch-arm-rpi3-b-plus.md
Last active March 28, 2024 19:39
Install Arch Linux (ARM) on Raspberry Pi 3 Model B+

Install Arch Linux (ARM) on Raspberry Pi B+

Created 17 Aug 2018

This is a simple installation that I did on my Raspberry Pi. Of course, this is only one of the many reasons to do it.

Here are my requirements:

Keybase proof

I hereby claim:

  • I am theramiyer on github.
  • I am ramiyer (https://keybase.io/ramiyer) on keybase.
  • I have a public key ASBCIQSZ0F2g_AMd-1IUAnHWH-W_50RJCNAI0Ha1Oz1GnQo

To claim this, I am signing this object: