Skip to content

Instantly share code, notes, and snippets.

View ratulcse10's full-sized avatar

Abu Shahriar Ratul ratulcse10

View GitHub Profile
@ratulcse10
ratulcse10 / gist:51fa17bc60750222ee1b279f07361a77
Created May 13, 2024 07:10
copy file from localserver to remote server with pem authentication
scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/
@ratulcse10
ratulcse10 / gist:bd364a5e990521670a2fc6efdb30fc4e
Created January 17, 2024 14:36
how to install node in ubuntu
Installing Node Version Manager
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
Once you have Node Version Manager installed
run in your terminal nvm install 18 to install version 18 of Node
run nvm use 18 to start using version 18 of Node
@ratulcse10
ratulcse10 / eventregister.php
Created December 8, 2022 15:03
laravel event listeners
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
'App\Events\LoginEvent' => [
'App\Listeners\CreateNewProduct',
'App\Listeners\CreateAnotherNewProduct',
]
];
https://askubuntu.com/questions/337443/what-is-a-full-path-name
https://www.markhesketh.com/switching-multiple-php-versions-on-macos/
lsof -i tcp:3306
kill -9 PID
https://www.educative.io/answers/how-to-install-nodejs-on-ubuntu
https://www.programmersought.com/article/95776663199/
https://stackoverflow.com/questions/67399785/how-to-solve-npm-install-error-npm-err-code-1
When I try to run the npm install command in an older project, I faced the same issues and I resolved it by updating the dependencies in package.json to the latest versions by following these steps:
delete folder node_modules folder and file package-lock.json
install npm-check-updates globally, to update all packages to a new major version
run npm install -g npm-check-updates
run ncu -u to update dependencies in package.json to latest version
lsof -n -i4TCP:3000
OR lsof -i:3000
Where 3000 is the port number the process is running at
this returns the process id(PID) and run
kill -9 "PID"