megacolorboy

Hey there,
I'm Abdush Shakoor.

A not-so-typical software engineer & designer with a knack for problem solving and building stuff for fun.

  • Linux

    How to create an ISO image from CDs/DVDs?

    23.10.2021 1 minute read

    I used to create ISO images using DAEMON Tools but I wanted to try something different and see if there's a way to create it using the Linux CLI.Turns out, you can do in just a single line using the utility like so:The stands for input file and stands for output file.Looks like, I don't have to use DAEMON Tools for stuff like this, I guess.Hope you found this tip useful!

  • Linux

    How to identify which Linux distribution is running in your system?

    02.10.2021 1 minute read

    If you've read my earlier post, I was using Ubuntu, at that time, and I thought that was how you identify which distro is running in your system but using is not always going to work as some distributions may not have it installed.Try the following command to identify the distribution you are running in your system:And you'll get the following output:Hope this helps you out!

  • Linux

    Truncate a file using redirection in Linux

    02.10.2021 1 minute read

    Simply put, sometimes, there are situations in where you just want to clear the contents of a file without deleting it.This could be for many reasons like to avoid permission related issues, or maybe the file could be having useless logs that amasses to a size that measures in GBs.So, the easiest solution is to clear it away from a terminal is by shell redirection like so:Let me break down the command here:The symbol means and doesn't produce any output.The '>' symbol is used for redirecting the output of the preceding command (in this case, it's empty!) is the file that you want to truncate. If it doesn't exist, the file will be created.Alternatively, you can do the same by using the command to output the contents of the device (which only contains a EOL character) to empty a file:Hope this comes in handy!

  • Linux

    Display list of files with their extension and file sizes

    20.09.2021 1 minute read

    Last month, I was trying to free up some space in my company servers and I realized that there were a lot of files taking up a lot of space.So, I wrote the following command to list files by their extension:And later to determine which files are the largest, I executed this command to sort the list by file size:Hope this tip helps you too! 😄

  • JavaScript

    How to fetch a JSON object from an array of JSON objects by property value?

    13.08.2021 1 minute read

    Say, for example, you have an array of JSON objects that contains the following data:Hmm, that's pretty basic but how will get the information of "Bob Smith" using his email? Well, that's where the method comes into the picture.Try reading the Mozilla Documentation on and implement the following:This works fine on all browsers except Internet Explorer (I mean, it sucks anyways!), which is okay!Hope you found this useful!

  • Git

    How to use GitHub Personal Access Token to authenticate your git commits?

    13.08.2021 1 minute read

    On November 2020, GitHub had announced that they would no longer accept basic username/password to authenticate git commits and it would be deprecated by Mid 2021.Instead, they recommend you to authenticate your git commits using a Personal Access Token from your GitHub account.Generate a personal access tokenUnset your credentials from your remote repository: Login to your GitHub account and go to Settings Then navigate to Developer Settings -> Personal Access TokensClick on Generate new tokenGive a name to your Personal Access Token and the necessary permissions required.Once done, hit on Generate tokenThe token will be shown once, so make sure to copy it and store it somewhere that you can remember.Update your remote repositoryOnce you've generated a token, you just have to update your remote repository by following the below steps:1. Update remote repository URL2. Just git pull onceNow, just perform operation once and you should be good:Hope this helps you out!

  • MySQL

    How to update values of a column from one table to another?

    13.08.2021 1 minute read

    Sometimes, I come across situations where I would need to update a newly added in a pivot table and this query does come in handy:Hope you found this useful too!

  • DevOps

    View your wget progress even after closing your SSH session

    13.08.2021 1 minute read

    Few days back, I ran a command to download a file and accidentally closed the SSH client.I logged in again and checked the list of active processes and thankfully, the process was still running except that I wasn't able to know the current progress of it.So, I did a little research and found a way to view the progress, so I tried the following command:And, I was able to view it's current download progress again.Hope this helps you out!

  • VSCode

    How to switch between integrated terminal and editor in Visual Studio Code?

    21.07.2021 1 minute read

    While, I'm trying to adjust myself to using Visual Studio Code, I found it quite annoying that there isn't a shortcut to switch focus between the editor and the integrated terminal. For a guy, like me, who makes use of the keyboard all the time, that's pretty important.I did some research and found a way on how to do it. Just type and type and add these lines:Save the file and now, you'll be able to switch between the two by pressing keys.Hope you found this tip useful!