Delete a folder before recreating it with ansible-playbook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/tmp/supervisor.sock ; path to your socket file | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
logfile_backups=10 ; number of backed up logfiles | |
loglevel=info ; info, debug, warn, trace | |
pidfile=/var/run/supervisord.pid ; pidfile location | |
nodaemon=false ; run supervisord as a daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Way #1 | |
function a (num) { | |
console.log('a', num); | |
num = num + 1; | |
if (num > 1000) | |
{ return num; } | |
else { | |
setTimeout(function () { b(num); }, 1000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var chalk = require('chalk'); | |
var app = express(); | |
app.all('*', function (req, res) { | |
console.log(chalk.blue('===========' + new Date())); | |
console.log('req.method', req.method); | |
console.log('req.url', req.url); | |
console.log('req.path', req.path); | |
console.log('req.headers', req.headers); |
Test the handlers around process.on('SIGTERM')
for pm2 restart|stop|kill
.
Run the following commands in separate shells:
- pm2 start index.json
- while true; do (curl localhost:5001 -m 7 2>/dev/null &) ; sleep 10; done
And trigger conditions with pm2 restart|stop|kill
Celery doesn't always restart. Try to make a reproducible test case for celery related code.
Run:
vagrant up
ssh-copy-id vagrant@localhost -p 2222
ansible -m ping all
ansible-playbook setup.yml
after SSH-ing into the machine:
Try running this:
clang -o argv argv.c
./argv abc def ghi jkl 123 456
clang -o pthread pthread.c -lpthread
./pthread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: backend | |
sudo: True | |
tasks: | |
- copy: src=main.js dest=/tmp/main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nyc.c4q; | |
import java.io.FileReader; | |
import java.util.HashMap; | |
public class Unit0Exercises { | |
/* | |
* Name of the method implies what the method should do. | |
* Some of these methods require that the method return signature change. | |
* For example, `returnPrimitiveBooleanTrue()` should return `boolean`, not `Object`. |