Showing posts from 2017

AUTOMATE: Restart router when the connection drops

How good is your ADSL line? Does it drop every now and then? Does it have a terrible SNR and are you using a cheap router with bad noise reduction capabilities? Most importantly, does your router start working at full speed right after you restart it? Have you tried calling the provider and asked them to check the telephone line and couldn't they figure out what the problem is?

Well, I am having all these issues and my days are really slow because of this damned router doesn't do what it does best. And a high end router is not affordable right now.

As with everything in a software guys' life, I automated the process of restarting my fucking router with a python script. I have some photos being uploaded to google drive and I have installed this great cFosSpeed software which monitors my connection and has a great command line interface. Every router supports telnet connections so I created the following python script. It will contact cfosSpeed to get the upload rate, if it…

How to create a .NET Core MVC File Uploader Module - Part 1

Fine UploaderEver since I started developing websites, file/image uploading really gave me a hard time because I just couldn't figure out how to make the upload more generic and pluggable. After seeing Google/Facebook/500px♥ does it, I figured, it must be possible and should be simple. I always tend to over-complicate stuff. A prime example is this SO question (Adjusting dates in an array based on a start date) I asked a few days back. After a few tries, I came up with a solution. This is done using .NET Core MVC6 and You are free to steal this and modify according to your needs. (Give credits where necessary, be human)

So my requirements are simple:
To be able to upload files into a central file repositoryTo be able to select uploaded files and attach them to a postIf it's an image, show a previewTo be able to add metadata related to the file as we upload themTo be able to validate the said metadata before uploadingTo be able to plug it into any page without too much configura…