Siv Scripts

Solving Problems Using Code

Fri 16 October 2020

Redirecting requests in Kubernetes

Posted by Aly Sivji in Quick Hits   

This canonical URL for this blog used to be alysivji.github.io. I have also set up nginx to forward requests to alysivji.com and sivji.com to this blog.

This is all well and good when are you running nginx out of a VM, but what if you are …

Read more...





Sat 20 October 2018

Transfer Files with rsync

Posted by Aly Sivji in Quick Hits   

I recently purchased a new computer and needed to transfer files from the old computer to the new one. Tried a USB drive, no luck. Tried copying files over the network via the macOS Finder, but the sheer number of files (~500,000) made this an exercise in futility.

Googling …

Read more...










Wed 17 May 2017

A Gentle Introduction to Context Managers: The Pythonic Way of Managing Resources

Posted by Aly Sivji in Tutorials   

Summary

  • Explore with statements and the context manager protocol
  • Implement context manager class to query MongoDB
  • Convert try...finally block to with block and increase code readability

I recently read Steve McConnell's Code Complete to level up my software development skill-set. The book has helped me become more deliberate about programming and problem solving in general. Before I sit down to write a single line of code, I take some time to plan out the work I am going to do versus code by the seat of my pants

Read more...