Skip to content

Instantly share code, notes, and snippets.

@lucasdamianjohnson
Created November 23, 2021 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasdamianjohnson/2202c7702f7b219f0fdfb5364c4ff069 to your computer and use it in GitHub Desktop.
Save lucasdamianjohnson/2202c7702f7b219f0fdfb5364c4ff069 to your computer and use it in GitHub Desktop.
Commands I Use A Lot
** Basic Commands **
// remove directory
sudo rm -R -f ./directory
// Show file sizes
ls -s
// Show file permissions and hidden files
ls -a -l
// Search if a file exist
ls | grep "search term"
// Search in a file
cat ./path_to_file | grep "search term"
** Install Node.JS **
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm list-remote
nvm install v16.2.0
nvm use v16.2.0
node -v
** Start Electron TypeScript Project
npm init
npm i --save-dev typescript tslib @types/nodes electron
** Set Up LAMP Stack **
// install apache
- Debian
$ sudo apt update
$ sudo apt install apache2
$ sudo ufw show app list
$ sudo ufw allow 'Apache'
$ sudo ufw status
- Cent
# yum install httpd
# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# firewall-cmd --reload
# systemctl enable httpd.service
// stop/start/restart apache
- Debian
$ sudo systemctl stop apache2.service
$ sudo systemctl start apache2.service
$ sudo systemctl restart apache2.service
- Cent
# sudo systemctl httpd stop
# sudo systemctl httpd start
# sudo systemctl httpd restart
// install php
- Debian
$ sudo apt install php libapache2-mod-php
$ sudo systemctl restart apache2.service
- Cent
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install yum-utils
//can use what ever php version
# yum-config-manager --enable remi-php56
# yum install php php-mysql
# systemctl restart httpd
// instal maria db
- Debian
$ sudo apt update
$ sudo apt install mariadb-server
$ sudo mysql_secure_installation
- Cent
// 5.5
# yum install mariadb-server
# sudo systemctl start mariadb.service
# sudo mysql_secure_installation
// 10.4
# sudo yum install wget
# wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
# chmod +x mariadb_repo_setup
# sudo ./mariadb_repo_setup
# sudo systemctl start mariadb.service
# sudo mysql_secure_installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment