Skip to content

Instantly share code, notes, and snippets.

@Ammar-Azman
Ammar-Azman / README.md
Last active August 16, 2023 02:14
Scraping issue: Hidden Data? Meh.

Scraping issue: Hidden Data? Meh.

  • 15/8/2023

Details

On 15/8/2023, I have task to scrap a website. With simplistic mind, I thought I can just used BeautifulSoup and requests to get the information. However, the website that I intend to scrap has shown no text at all from the output of the code. I thought the website was purposely created to hide the information. After asking some colleague and read on internet, this is due to the JS framework that been used by the webdeveloper which is Tailwind and Bootstrap.

Title: Unsolve training Yolov5 on Sagemaker all night issue

Datetime: 1/6/2023, 10:25 am

Observation

  • What I want is to train the model all night on AWS. But running all night, I mean that I shut off my laptop and let it train on the cloud and wake up on the next morning monitoring it if it still running, or get the .pt file as the training completed.

Issues

  1. Cannot close the broswer and let it train
@Ammar-Azman
Ammar-Azman / troubleshoot-zsh-powershell.md
Last active June 20, 2023 01:32
Resetting my oh-my-zsh on WSL Ubuntu 20.06.4 after lose it on installing oh-my-posh on PowerShell

Title: Troubleshoot zsh

Datetime

31/5/2023, 11:34 am

Issue

I just want to decorate my Powershell on Windows with oh-my-posh. It worked well, but when I opened my WSL Ubuntu 20.06.4, suddenly it initialized with bash and not zsh. It also change the default user to root instead of ammar-user that I have created at the beginning of installing WSL.

After 4 hours troubleshooting, I found the solution as below.

@Ammar-Azman
Ammar-Azman / disable-left-toggle-jupyterlab-sagemaker-tmux.md
Last active May 30, 2023 04:29
How to disable the JupyterLab Sagemaker shortcuts on left-toggle to use tmux

Details

Datetime

30/5/2023, 12:06 pm

Issue

Most of the tmux shortcut required ctrl + b, <some_alphabet> which become a headache as it is similar to JupyterLab left-toggle shortcut that is ctrl + b. Hence, I want to disable the JupyterLab shortcut, so I can use tmux happily.

Solution

@Ammar-Azman
Ammar-Azman / revert-a-commit.md
Created May 22, 2023 08:19 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@Ammar-Azman
Ammar-Azman / first_gist_bruh.py
Created February 27, 2023 07:01
My First Gist
print("hello world")