Skip to content

Instantly share code, notes, and snippets.

View quocduongpy's full-sized avatar
🏠
Working from home

Quoc Duong quocduongpy

🏠
Working from home
  • Tuy Hoa Viet Nam
View GitHub Profile
Installing Nginx & Running it as a Service
*Note 1: There is an issue running NSSM created services on the Windows 10 Creator's Update, after you've created the services run the following command for each service nssm set ServiceName AppNoConsole 1 in cmd (run as admin)
*Note 2: For the above to work, you would also need to grab the latest pre-release build from https://nssm.cc/builds
Step 1: Installing Nginx
Download Nginx from: http://nginx.org/en/download.html
Install Nginx to your preferred location
Copy the Nginx folder to your preferred location e.g. c:\
If you want to run Nginx as a service then go the 'Running Nginx as a service' section, if not continue.
{
"app": {
"01": "ff3522",
"02": "ff3521"
}
}
@quocduongpy
quocduongpy / README.md
Created June 30, 2020 07:30 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@quocduongpy
quocduongpy / nginx_default.txt
Created August 21, 2019 04:31
Nginx default PHP FPM
server {
listen 80 ;
listen [::]:80 ;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name chovietkieu;
@quocduongpy
quocduongpy / MacOs_virtualbox_config.txt
Last active August 21, 2019 04:30
Config MacOs VirtualBox
VBoxManage modifyvm "MacOs" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "MacOs" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOs" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOs" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "MacOs" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "MacOs" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage setextradata "MacOs" VBoxInternal2/EfiGraphicsResolution 1440x900
@quocduongpy
quocduongpy / React Native Clear Cache
Created October 6, 2018 06:52
React Native Clear Cache
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@quocduongpy
quocduongpy / Install watchman
Created October 6, 2018 06:50
Install watchman
git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.9.0
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool
./autogen.sh
./configure
make
sudo make install