Skip to content

Instantly share code, notes, and snippets.

View ammarsaf's full-sized avatar
🎯
Focusing

ammar ammarsaf

🎯
Focusing
  • Kuala Lumpur, Malaysia
  • 08:59 (UTC +08:00)
View GitHub Profile
BLACK => "\033[30m",
RED => "\033[31m",
GREEN => "\033[32m",
YELLOW => "\033[33m",
BLUE => "\033[34m",
PURPLE => "\033[35m",
CYAN => "\033[36m",
WHITE => "\033[37m",
# background color
@ammarsaf
ammarsaf / readme.md
Created January 5, 2025 04:43
Issue on connecting postgres server (container) to pgadmin (container) and Dbeaver workbench

Debugging the issue of failed to connect between postgres container and pgramdmin container

  1. [postgres] -- [pgAdmin] : Instead of using host.docker.internal as the Host name/Address in pgAdmin server register, change to the value of the service in the docker-compose.yaml. For example from the following yaml, the value is postgres
services:
 postgres:
@ammarsaf
ammarsaf / GoogleDorking.md
Created July 18, 2024 01:27 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@ammarsaf
ammarsaf / issue.md
Last active July 7, 2024 05:28
WSL cannot open VSCode [solved]

Cannot open VSCode on WSL. Error showed zsh: Input/output error: code

Solution: Kill with wsl.exe --shutdown

Source: microsoft/WSL#4377 (comment)

If command fail, then

Task Manager >> Windows for Subsystem for Linux >> End Task

@ammarsaf
ammarsaf / 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.

Unsolve training Yolov5 on Sagemaker all night issue [solved]

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
@ammarsaf
ammarsaf / 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.

@ammarsaf
ammarsaf / 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

@ammarsaf
ammarsaf / 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:

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