Skip to content

Instantly share code, notes, and snippets.

View ibnsamy96's full-sized avatar
😶
trying to find hope

Mahmoud Samy ibnsamy96

😶
trying to find hope
View GitHub Profile
@ibnsamy96
ibnsamy96 / get-all-stored-wifi-passwords.md
Created April 9, 2025 07:05
get all stored wifi passwords

Use this command: sudo grep -r '^psk=' /etc/NetworkManager/system-connections/

It will give you output like this:

/etc/NetworkManager/system-connections/<wifi1-ssid>:psk=<wifi1-password>
/etc/NetworkManager/system-connections/<wifi2-ssid>:psk=<wifi2-password>
/etc/NetworkManager/system-connections/<wifi3-ssid>:psk=<wifi3-password>
@ibnsamy96
ibnsamy96 / linux_issues.md
Last active April 6, 2025 10:38
Issues I've faced during using linux and what I've done to fix them.
@ibnsamy96
ibnsamy96 / ssh_git_authentication.md
Last active March 27, 2025 02:58
authenticating new github account to the git cli using ssh
  1. Create the ssh public key using this command in the terminal, enter the command and follow all the presented steps
    ssh-keygen -t ed25519 -C <account_email>
  2. Terminal will show the path of the file which has the public key in your system, copy that path and open it.
    cat <file_path> ## ~/.ssh/id_ed25519.pub
  3. You'll see the key, copy all the file content and go to this page https://github.com/settings/keys and click New SSH key.
  4. In the opened page, use any understandable title, use Authentication Key as key type, and add the copied key to the key box.
@ibnsamy96
ibnsamy96 / startup_script_linux.md
Last active November 19, 2023 00:43
linux shell script that open apps when the system starts

Script to start apps in shell:

#!/bin/bash

# Open Google Chrome with specific tabs
google-chrome "https://www.google.com" "https://www.stackoverflow.com" "https://www.github.com" &

# Open Visual Studio Code
code &
"files.associations": {
"*.js": "javascriptreact"
}
In the workspace create 'settings.json' file in '.vscode' folder and put this peice of code in it.
{
"liveSassCompile.settings.generateMap": true, // good for debugging
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../css",
"indentType": "tab",
http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
// adding branch2 commets to branch1
$ git checkout <branch1>
$ git merge <branch2>
// merging a branch to main
$ git checkout main
$ git merge <branch needed to be merged to main>
As described in this file, all windows store apps are blocked from accessing localhost, you need to enable that by cmd.
https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md
To give Nightingale the permission to access your localhost you need to open cmd in administrator mode and enter that command:
checknetisolation loopbackexempt -a -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446

I faced a problem that I couldn't use vercel environment variables with a deployed angular app. I used to write my sensitive information in an env file while writing backend code and I forgot that browsers don't support the process module. So I searched for a while and got the result I want by following these steps:

  1. install the next package:
    npm install --save-dev @angular-builders/custom-webpack
    
  2. open angular.json and use "builder": "@angular-builders/custom-webpack:browser" instead of "builder": "@angular-devkit/build-angular:browser"
  3. add customWebpackConfig key in options object with a path to a file that you will create later:
     "options": { "customWebpackConfig": {"path": "custom-webpack-config.js"} }
@ibnsamy96
ibnsamy96 / Using the unfamiliar css units
Created January 15, 2022 13:40
A summary talking about some css units and their best use cases
rem:
- relative to the font size of the root elemnt (initially 1rem = 16px)
- better for font-size as it works well with browser font-size preferences (user may change his default font-size value)
- working with rem can be by setting font-size value in the HTML element to be 62.5% ( now 16px = 1.6rem & 37px = 3.7rem ...)
- can be used with margin/padding if you don't want them to change with the font-size space of the element
- if you set *{margin-top:1rem} then all elements has the same top spaceing
em:
- relative to the font-size of its direct or nearest parent
- better to be used with media-query values as px & rem have some compatibility issues for some browsers