Wednesday, December 2, 2020

How To : Create Symlinks on Windows

To Link to a directory/folder


d:\>mklink /D LINK_PATH TARGET_PATH


To Link to a file


d:\>mklink LINK_PATH TARGET_PATH


More reading

Tuesday, August 21, 2018

Disabling MSN Feed while opening Edge Browser

Microsoft Edge browser opens up the MSN feed whenever it is started. I don't really find any use of that feed and wanted to hide it. Follow the steps below if you too want to do the same:

  1. Click on the "Hide Feed" Settings button on the page. Show below:                                               
  2. That takes you to the following page to customize your feed:                                                         
  3. Click on "Hide by news feed" and "Save"


Monday, December 19, 2016

Stop the annoying beep when pressing TAB on bash windows

I find the constant beeping by bash when I press the tab key super annoying. Especially if you have headphones on, its a killer. The simple way to turn it off is as follows:

Add the following line to the ~/.inputrc file:

set bell-style none


Restart your bash and you shall attain beepless nirvana!

Saturday, July 16, 2016

Paste JSON as Class ! [Visual Studio]

One of Visual Studio's coolest feature - copy the json that you to 'class'ify ;). And click on "Paste JSON as Classes" and voila you a class made of your json ingredients !



Sunday, June 26, 2016

Add custom CSS to your blogger blog

Once you start writing stuff regularly on your blog you will soon start to need custom stuff - like adding custom styles to the blog. This is how you do it on blogger.

1. Select the blog to update and in the Options Menu click Options

2. Click on the Customize button next


3. Next Select Advanced and Add Css as shown below


Add your CSS there and refer it in the HTML of your blog.

Monday, June 20, 2016

Azure Command line tools - uploading blob to storage account

Most of your "cloud" workflows would require automating some operations that are part of your cloud service. I recently had to upload a blob to blob storage as part of a batch file. How to do that ? azure cli comes to the rescue.

Install Azure CLI as mentioned here : https://azure.microsoft.com/en-in/documentation/articles/storage-azure-cli/

That makes available the 'azure' command on your command line.



The help is quite exhaustive.

To upload a blob I used the following :

azure storage blob upload -f FILE_ON_DISK --container YOUR_CONTAINER_NAME --connection-string STORAGE_BLOB_CONNECTION_STRING

Use the --quiet option if you want to overwrite an existing blob on the cloud.

Sunday, June 5, 2016

Loading Excel (.xlsx) files in C#

So I needed to write an app (console) that would read and process an excel file. A quick search would lead me to this stackoverflow post which suggests using the Linq-To-Excel package.

Linq-To-Excel has a Nuget package and is easily installed. This nice little snippet in that post is self explanatory:

var data= new LinqToExcel.ExcelQueryFactory(@"MyFile.xlsx");

var query =
    from row in data.Worksheet("MySheet")
    let item = new
    {
        Id = row["Id"].Cast<string>(),
        Name= row["Name"].Cast<string>(),
        Age= row["Age"].Cast<int>(),
    }
    select item;

    foreach ( var item in query) {
        Console.Writeline(item.Id "\t" item.Name);
    }

Except that the following run time exception will be thrown when you start iterating through the results (the microsoft.ace.oledb.12.0 provider is not registered)


This is easily resolved by installed the Microsoft Access Database engine from this page : - and there you go - load up any excel file just like any simple TSV!