Skip to content

Instantly share code, notes, and snippets.

View vutranvn's full-sized avatar

Vu Tran vutranvn

View GitHub Profile
* [nodemon] Internal watch failed: watch ENOSPC
- sudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -p
* Git
- git remote set-url origin git@bitbucket.org:repo.git
- git submodule add -b develop git@bitbucket.org:repo.git config
- If you don’t wish to send usage data to Microsoft
"telemetry.enableTelemetry": false
- Send crash data to Microsoft
"telemetry.enableCrashReporter": false
* Services
lsof -PiTCP -sTCP:LISTEN
or
lsof -Pn -i4
or
lsof -Pni4 | grep LISTEN
lsof -Pni4 | grep LISTEN | grep nginx
* Network
netstat -ap tcp | grep -i "listen"
@vutranvn
vutranvn / Switch multi version php
Created March 30, 2018 14:46
Switch multi version php on brew in macOS
- To launch php-fpm on startup:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
- Open ~/.bash_profile and add:
export PATH="/usr/local/sbin:$PATH"
- To have launchd start homebrew/php/php56 now and restart at login:
brew services start homebrew/php/php56
@vutranvn
vutranvn / Open sublime text by terminal
Created March 30, 2018 14:30
Config open any app by terminal on macOS
sudo mkdir -p /usr/local/bin
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
- Open ~/.bash_profile and add
export PATH=/usr/local/bin:$PATH
- Testing
sublime filename
or
sublime foldername
or
sublime . (current directory)
1. docker stop $(docker ps -aq)
2. docker rm $(docker ps -aq)
3. docker rmi $(docker images -q)
/usr/libexec/java_home -v 1.8.0_152 --exec javac -version
or
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_152`
1. Install Nginx:
apt-get update && apt-get upgrade
- remove apache2
systemctl stop apache2
apt-get remove --purge apache2
apt-get install nginx
-start & enable nginx on boot
systemctl start nginx
systemctl enable nginx
** Create swap **
- Check swap info
> swapon --show
> free -h
- Check available space disk
> df -h
- Create swap
> sudo fallocate -l 2G /swapfile
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour0"="219,219,219"
"Colour1"="255,255,255"
"Colour2"="0,0,0"
"Colour3"="0,0,0"
"Colour4"="187,187,187"
"Colour5"="255,255,255"
"Colour6"="0,0,0"