The following guide will show you how to deploy a simple microservice written in JavaScript using π« now.
It uses Open Source tools that are widely available, tested and understood:
- Node.JS
- NPM
- Express
| import cv2 | |
| import cv2.cv as cv | |
| def detect(img, cascade_fn='haarcascades/haarcascade_frontalface_alt.xml', | |
| scaleFactor=1.3, minNeighbors=4, minSize=(20, 20), | |
| flags=cv.CV_HAAR_SCALE_IMAGE): | |
| cascade = cv2.CascadeClassifier(cascade_fn) | |
| rects = cascade.detectMultiScale(img, scaleFactor=scaleFactor, |
| <?php | |
| namespace cPanel; | |
| /************************************************************************************** | |
| * Copyright (c) 2013, cPanel, Inc. * | |
| * All rights reserved. * | |
| * * | |
| * Redistribution and use in source and binary forms, with or without modification, * | |
| * are permitted provided that the following conditions are met: * | |
| * * |
| #!/bin/bash | |
| #==INSTRUCTIONS | |
| # - Add EMAIL and PASS infomation | |
| # - Replace script path with your path `/home/USER/scripts/` in the script | |
| # - Check your machine timezone `date +"%Z %z"` output ex: UTC +0000 | |
| # - patckpub.com is UTC +0000, find the best hour for you to use in the crontab | |
| # - Execute `crontab -e` | |
| # - Add `0 1 * * * /bin/sh /home/USER/scripts/packtpub_redeem.sh > /home/USER/scripts/packtpub_redeem.out` , this mean everyday 1am | |
| # - Restart Service `sudo service cron reload` (optional, crontab -e, will reload) | |
| # - Add Permission `chmod 755 /home/USER/scripts/packtpub_redeem.sh` |
The following guide will show you how to deploy a simple microservice written in JavaScript using π« now.
It uses Open Source tools that are widely available, tested and understood:
| # stop script on error signal | |
| set -e | |
| # remove old deployment folders | |
| if [ -d "/home/forge/weather-deploy" ]; then | |
| rm -R /home/forge/weather-deploy | |
| fi | |
| if [ -d "/home/forge/weather-backup" ]; then | |
| rm -R /home/forge/weather-backup | |
| fi |
This gist assumes:
| server { | |
| listen 80; | |
| server_name domain.com; | |
| root /var/www/domain.com; | |
| location ~ /.well-known { | |
| allow all; | |
| } | |
| location ~ /\.ht { |