Skip to content

Instantly share code, notes, and snippets.

View MahbbRah's full-sized avatar
🎯
Focusing

Mahbub Rahman MahbbRah

🎯
Focusing
  • Dinajpur, Bangladesh
View GitHub Profile
@MahbbRah
MahbbRah / gist:9e22230cdc2028daf782516e4dad4a71
Last active March 30, 2024 16:33
ফরহাদ শেখ 01729770923 অনলাইন স্কামার!

অনলাইন দুনিয়াতে ব্যাবসা করা/লেনদেন করা খুবি কঠিন। আর মানুষ কে বিশ্বাস করা তার চাইতেও বড় কঠিন। অনেকের শুধু ধান্দাই হল অনলাইনে মানুষ কে ধোকা দিয়ে ২ পসা রোজগার করা। কিন্তু তারা বোঝেনা আখিরাতে এটা তাদের জন্য কত ধারালো আর মোটা সুই এর মত কাজ করবে। আমি যদি অনলাইন লেনদেন করিনা, করলেও রিস্ক হবেনা বা আমার জন্য অতটা ক্ষতি হবেনা এই রকম এমাউন্ট করি পরীক্ষা করার জন্য। আজ আপনাদের সাথে পরিচয় করিয়ে দিব এই রকম এক অত্যন্ত চালু বাটপাড় এর সাথে। যে এতো সুন্দর আর বড়লোকি ভাব নিয়ে আলাপ করবে, মনেই হবেনা যে সে আসলে ঠকবাজ। ফেসবুক এ বিভিন্ন গ্রুপ এ ইদানিং 'ফরহাদ শেখ' নামে এক ব্যাক্তি ডিপো রেট এই সেই বলে চিনি, ডাল, তেল সহ বিভিন্ন কিছুর ছবি দিয়ে অত্যান্ত কম রেট দিয়ে ক্রেতা আকর্ষণ করার চেস্টা করছে (এই রকম আরো অনেক বাটপাড় আছে) তারা শুধু কুরিয়ার চার্জ অগ্রিম নেয়। আপনি ভোটার চাইলে দিবেনা, কুরিয়ার কোম্পানি কে অগ্রিম দিতে চাইলে তাও রাজী হবেনা। আমি খুবি নগন্য একটা এমাউন্ট দিয়ে তাকে টেস্ট করতে চেয়েছিলাম এবং যা বুঝলাম ব্যাক্তি পুরা দস্তরে ঠকবাজ। উনার মোবাইল নাম্বারঃ 01729770923 facebook profile: https://www.facebook.com/profile.php?id=10008884

@MahbbRah
MahbbRah / mongodb-cli-commands.md
Created July 15, 2022 06:38
MongoDB helpful commands; and export/imports commands as well.

We'll list down here some helpful MongoDB commands these are helpful and requires in day job!

Export mongoDB collections from mongo Cloud via mongo cli

Sometimes it requires to dump all the collections or specified one's I'm gonna mention here how you can get backup (dump) file from MongoDB for each collections Let's say you want to take a backup for users colleciton for that the command will be like below mongoexport --uri="mongodb+srv://[username]:[password]@cluster0.dtwwj.mongodb.net/[database_name]" --collection=users --out=users.json The command above self descriptive, on --collection param we're providing our target collection name then on --out we're simply naming the file that would should be exported as.

@MahbbRah
MahbbRah / ssh-copy-id passwordless login
Created December 15, 2021 04:46
Passwordless login with `ssh-copy-id` to a regular VPS or EC2 instances
# Passwordless Login
**NOTE:** For all the commands below if you use windows then use `git bash` terminal otherwise it will won't work
## Get Ready
First check if you have generated ssh keys in your local machine or not. hit this command on terminal to see if you've already
a ssh key `cat ~/.ssh/id_rsa.pub` if you see data then you're ready for next step otherwise generate ssh key first by hitting\
this command `ssh-keygen` on terminal and it will ask you some prompt, you can just keep them blank and keep pressing enter, till
it's done!
@MahbbRah
MahbbRah / data-sample.json
Created October 18, 2021 02:53
P21 SQL query response with contact ID
This file has been truncated, but you can view the full file.
{
"Name": "Order",
"UseCodeValues": false,
"Transactions": [
{
"Status": "New",
"DataElements": [
{
"Name": "TABPAGE_1.order",
"Type": "Form",
@MahbbRah
MahbbRah / elasticsearch-guide
Last active September 2, 2021 11:39
Workaround and starting guide with ElasticSearch | Bulk Upload Data to Elasticsearch ES | Fix issues Y& enable Pagination | Add datetime date field to ES collection
In this gist I'm gonna write personalized walk-through that I have been completed with `ES` and the issues while working with it.
I Bought a `EC2` instance from AWS, the instance was `t2_large` Initially I bought 8GBs memory then it was too short
then I extended with another 8GB.
As a beginner it was quite tough for me getting familiar with it.
I need ES stack to do full-text search with speed, with one of our existing a real big database.
@MahbbRah
MahbbRah / pattern-for-requestAnimationFrame.js
Last active March 31, 2021 09:54
Pattern for using requestAnimationFrame instead setInterval or setTimeout because it's much efficient and faster
let request
const performAnimation = () => {
request = requestAnimationFrame(performAnimation)
//You can do whatever you want continously or conditional based on your needs, have fun!
//Here your code goes for using as setTimeout simply call cancelAnimationFrame(request) or to use as setInterval don't use the cancelAnimation
}
requestAnimationFrame(performAnimation)
@MahbbRah
MahbbRah / check_username_in_password.js
Last active September 19, 2019 13:23
Check if password includes user name or part of it
function checkPasswordForUserName(userFullName, userPass) {
const userNamesList = userFullName.toLowerCase().split(" ");
const firstThreeChars = userFullName.substring(0, 3);
const lowerCasePassword = userPass.toLowerCase();
const isUserNameInPassword = (name) => (
lowerCasePassword.includes(name) ||
lowerCasePassword.includes(firstThreeChars)
);
@MahbbRah
MahbbRah / enableExec.php
Created August 27, 2019 02:58
Enable exec shell_exec in php
By default in Xampp, wamp server you can't run these functions `exec` or `shell_exec` to run these shell commands you
need to edit `php.ini` file and add/edit this command to like this `set safe_mode_exec_dir (line after = is empty, so IT IS ON!!!) set it off!`
for more: https://stackoverflow.com/questions/12757891/enable-shell-exec-in-wamp-server
@MahbbRah
MahbbRah / ffmpeg_commands.md
Last active August 5, 2019 11:17
I will try to include useful commands for ffmpeg video processing library :)

#Extract Audio from video ffmpeg -i 'input_file' -f mp3 -ab 192000 -vn 'output.mp3'

#Remove Audio From Video ffmpeg -i 'input_video_file' -vcodec copy -an 'output_video_file'

#Merge audio with a video. `ffmpeg -i video.mp4 -i audio.wav \

@MahbbRah
MahbbRah / gitPush.bash
Last active July 7, 2019 04:35
merging git all commands in a bash function to use as a command
# to use this function as a bash command add this to your bash_profile ~ root directory in windows and then reload bash profile
# and you're ready to go simply type: gitPush "commit message that you want to add";;
gitPush() {
git add .
#Here "$1" as the arugment that'll collect the mnessage for commit
git commit -am "$1"
git push -u origin master
}