About
Hey, this is my github page. Welcome~
Visit my web and my blog
#
Recent Notes/TodoList > here
this is just a list of some random links, code, projects and articles that I make and read.
Lists Repo
Useful Gists
- Install Datatable with laravel 5.3 > link
- Install and change php version on linux > link
- Add Custom CSS with Laravel Mix > link
- laravel .htaccess on shared hosting > link
- mongodb import > link
Random Commands
- Change permission All Folder & SubFolders
sudo chmod -R 755 /opt/lampp/htdocs
- Clone Private Repo
git clone https://username@github.com/username/repo_name
- Operate mongodb service
sudo systemctl (start/status/enable/stop) mongod
- create a sysmlink path so that command can be run on terminal (ex: heroku)
sudo ln -s /snap/bin/heroku /usr/bin/heroku
- check if repo updated on remote
git remote update
- fix username is not in the sudoers
sudo nano /etc/sudoers
and then add this line below root/admin under #user privilege spec user_name ALL=(ALL) ALL
- Make file excecutable
chmod +x filename
- copy all files in folder
cp -a ttf/. /usr/share/fonts/TTF/
- switch php version on arch linux STEP 1 -> go to /usr/bin dir then run this
sudo mv php php8
to rename current php to php8 then after that STEP 2 -> make a symlink ex: sudo ln -sf php7 php
for php 7.4. If you want to change back to php8 just run STEP 2 command with another symlink
- mysql login
mysql -u root -p
- copy file to remote server with scp
scp myfile.txt remoteuser@remoteserver:/remote/folder/
- install PM2 if you don’t have it:
npm install pm2 -g && pm2 install pm2-logrotate
pm2 start server/server.js --name process-whatever
> to add process
pm2 monit
> If you want to see the current console output
pm2 save && pm2 startup
> If you want to add it to startup
xrandr --output HDMI-1 --auto
> To set hdmi output (to set the layout go to > preferences > Display > Layout Editor)
mysqldump -u root -p db > db.sql
> To export data
sudo a2dismod php5.6 && sudo a2enmod php7.4
> To disable php module 5.6 and enable mod php 7.4
pactl unload-module module-bluetooth-discover && pactl load-module module-bluetooth-discover
> when bluetooth can’t connect to device
- github permission denied when add agent. It means need to add manually the key ->
ssh-add /path/to/my-non-standard-ssh-folder/id_rsa
more
- always enable firewall when want to access ip from other device
sudo ufw allow [PORT]/tcp
more.
docker update --restart unless-stopped $(docker ps -q)
> restart all docker unless it stopped
sudo chown -R _currentuser_:www-data /var/www/html && chmod -R g+sw /var/www/html
> change permission so home user could modified the webserver folder
- rysnc without permission change
rsync --no-perms -azP source/ destination/
Brew commands
- install different php
brew install shivammathur/php/php@5.6
- switch different php on mac
brew unlink php@7.4 && brew link --force —-overwrite php@5.6
Dev Articles/Cheatsheet/Etc
- Local Strapi + cloud MongoDB Atlas > link
- neofetch link
Useful Articles
- Forbidden : You don’t have permissions to access / on this server link
- create vhost with webmin link
- turn old laptop to server link
- give specific user to folder link
- make own git server link
- Install Node & NPM link
- Install PostgreSQL link
- Install Java link
- Crontab configuration link
- Info about docker link
- Download a git branch from remote server link
- Install PHP, integrate with webservers and its dependencies link
- MySQL password does not satisfy the current policy requirements link
- authentication method unknown to the client link
- install go on linux link
- change dateformat in javascript/jQuery link
- generate changelog link
- temporary hide and disable indexing on apache2 link
- make sysmlink on linux [link](https://](https://www.freecodecamp.org/news/symlink-tutorial-in-linux-how-to-create-and-remove-a-symbolic-link/)
- allow remote MySQL link
- installing php extension for php app/laravel link
- make virtual host and server block on webservers (nginx, apache) link
- install mysql on ubuntu [link(https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04)
- setting a new linux server (ubuntu) link
- installing apache2 on ubuntu and make vhost plus some config link
- install and config nginx & laravel on ubuntu link
- config multiple php on one server with apache & ubuntu link
- allow/opening outgoing and incoming port on WHM/CPANEL link
- remote access with mongoDB link