Skip to content

Instantly share code, notes, and snippets.

View anonymoustafa's full-sized avatar

Mostafa Ramezani anonymoustafa

View GitHub Profile
@anonymoustafa
anonymoustafa / mongodb-authentication-error.md
Created May 27, 2022 14:09
Solution to the MongoDB authentication error

You can find the same question [here][1] I just encountered this error:

    Server is running on port: 5000
MongoServerError: bad auth : Authentication failed.
    at Connection.onMessage (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/connection.js:202:30)
    at MessageStream.<anonymous> (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/connection.js:62:60)
    at MessageStream.emit (node:events:527:28)
    at processIncomingData (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/message_stream.js:108:16)

at MessageStream._write (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/message_stream.js:28:9)

@anonymoustafa
anonymoustafa / node-core-modules.md
Created June 21, 2022 10:57
How to get an exact list of Node core modules

Do this in the REPL mode: console.log ( require('repl')._builtinLibs ); Or put this line of code in your app.js file and execute: console.log ( require('repl')._builtinLibs ); return;

Some guidance on using find command in unix like systems

Finding files bigger than one gigabytes

$ find . -size +1G

#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
cur_dir=$(pwd)
@anonymoustafa
anonymoustafa / gitautomation
Created November 17, 2023 10:48
git automation
echo $@
git add .
git commit -m "$@"
git push
https://chatgpt.com/share/1d47cc33-1e69-4ae2-8f5b-c6a24b851e1b
xrandr --output eDP-1 --brightness 0.5
setxkbmap -layout us,ir
setxkbmap -option 'grp:alt_shift_toggle'
@anonymoustafa
anonymoustafa / JetBrains trial reset.md
Last active July 19, 2024 10:01
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@anonymoustafa
anonymoustafa / instructions.txt
Created September 6, 2024 08:48
How to rename git default branch name
$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
@anonymoustafa
anonymoustafa / portforward.sh
Last active September 6, 2024 08:54
port forwarding
ssh -L 3000:localhost:3000 <devuser>@<remote server ip address>
@anonymoustafa
anonymoustafa / render.sql
Created January 8, 2025 04:40
Oracle Apex Plugin from scratch boiler plate pl/sql
procedure render
( p_item in apex_plugin.t_item
, p_plugin in apex_plugin.t_plugin
, p_param in apex_plugin.t_item_render_param
, p_result in out nocopy apex_plugin.t_item_render_result
)
as
-- attributes
l_attribute1 p_item.attribute_01%type := p_item.attribute_01;
l_attribute2 p_item.attribute_02%type := p_item.attribute_02;