Skip to content

Instantly share code, notes, and snippets.

View ciamac-da's full-sized avatar
🦖
<Läuft bei mir! />

Cia ciamac-da

🦖
<Läuft bei mir! />
View GitHub Profile
@ciamac-da
ciamac-da / gist-00-chrome-install-update.txt
Last active June 22, 2021 08:07
This is how to install or upgrade Chrome on Linux!
# Install
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Only Upgrade
sudo apt-get --only-upgrade install google-chrome-stable
@ciamac-da
ciamac-da / gist-01-remove-node_modules.txt
Created June 22, 2021 12:50
How to get rid of node_modules folder from Github
# This is how to get rid of node_modules folder from Github!
1- Add .gitignore file(must be located in the root directory of your repo).
2- Write node_modules/ in .gitignore file.
It means ignore all directories called node_modules in current folder and any subfolders.
As alternative you can also use /node_modules or **/node_modules.
** is used for a recursive call in the whole project.
3- Open Terminal
@ciamac-da
ciamac-da / gist-02-generate-random-color-hex
Last active June 24, 2021 14:58
This is how to to generate a random color HEX code
const decToHex = (number) => {
return number.toString(16).padStart(2, "0")
}
const getRandomNumber = (min, max) => {
min = Math.ceil(min)
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
@ciamac-da
ciamac-da / gist-03-update-node-npm
Last active December 23, 2021 07:50
Updating Node and Npm ==> This is how to completely uninstall node js and npm on Ubuntu or Debian and installing v14 or v16
sudo apt-get remove nodejs
sudo apt-get remove npm
installing nodejs-legacy works if you first apt-get remove node (or better yet, purge)
Then go to /etc/apt/sources.list.d and remove any node list if you have
sudo apt-get update
@ciamac-da
ciamac-da / gist-04-port-in-use-node
Created June 28, 2021 13:11
Port already in use problem in Nodejs(This is how to kill all nodes)
Sometimes there may be some issue with the NodeJS like the server is listening to some other port or
there may be some services which you want to run, but it shows an error like service is already running
or process is already running. At that time you need to kill all the instances of the NodeJS server at that time.
This method will help you to kill all the instances in NodeJS.
Command/CMD: Killings all instances of a NodeJS process via command line ==> killall node
@ciamac-da
ciamac-da / gist-05-install-insomnia
Created June 29, 2021 07:28
Insomnia Installation on Linux
sudo apt update
sudo apt install snapd
sudo snap install insomnia
Take a look for more information ==> wgethttps://snapcraft.io/install/insomnia/ubuntu#install
Documentation ==> https://insomnia.rest/download
@ciamac-da
ciamac-da / gist-06-install-or-update-vscode(Visual Studio Code)-on-debian.txt
Created July 6, 2021 09:01
Install-or-update-vscode(Visual Studio Code)-on-debian
#installing vscode on Debian
You can install vscode using following commands:
1- Start by updating the packages index and installing the dependencies by typing:
sudo apt update
2- sudo apt install software-properties-common apt-transport-https curl
3- Import the Microsoft GPG key using the following curl command:
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
4- Add the Visual Studio Code repository to your system:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
@ciamac-da
ciamac-da / gist-07-automatic-date-and-time.txt
Created July 10, 2021 08:12
Forcing Debian to update automatic date and time
This is how to force Debian updating automatic date and time when enable/disable button doesn't works!
1- Open Terminal and check System clock synchronized, therefore type ==> timedatectl
2- if it's not synchronized (System clock synchronized: no NTP service: deactive)
then try to set ntp using ==> timedatectl set-ntp on
3- Remove cached ntp ==> apt remove ntp
Date and Time should be activated now!
@ciamac-da
ciamac-da / gist-08-github-deployment-vanilla-javascript.txt
Last active July 11, 2021 12:13
Github Deployment for Vanilla JavaSript Repos
1- Add a new branch in your Project useing ==> git checkout -b gh-pages
2- Try to change at least one character of your project's files and save(you need this to be able to push again)
3- git add -A
4- git commit -am "deployment branch added"
5- git push --set-upstream origin gh-pages
@ciamac-da
ciamac-da / gist-09-github-deployment-react.txt
Last active September 1, 2021 10:33
This is how to deployment React projects on Github
1- Open package.json file and add a homepage at the top before name
==> "homepage": "https://<USERNAME>.github.io/<PROJECT NAME>",
2- install gh-pages using ==> npm i gh-pages
3- Add pre-deploy and deploy to scripts field in package.json file ==>
"pre-deploy": "npm run build",
"deploy": "gh-pages -d build"
4- type npm run pre-deploy in terminal