Archive for: August, 2013

#!BIN/BASH

Sourced Bash Variables Not Working in Conditional Statements

The other day I was writing a bash script to make automatic backups of MongoDB. I had the main backup script ( backup.sh) and an options file ( options.cfg). The idea was that backup.sh would be committed to the project’s repository, while options.sh would be a local file, not added to the repo, because it might contain…

Read More →

Git Logo

Make Shell Script Committed to Git Executable

You wrote a shell script ( script.sh), say for a database backup or to regularly remove old files, and committed and pushed it to your Git repository. You go to your server, do git pull to pull the latest commit and try to execute the script with ./script.sh. Uh, oh, Permission denied, the script won’t run. Ah, no…

Read More →

Nginx

Nginx Ignoring Server Blocks (Virtual Hosts) in Sites-Enabled

I’ve been setting up a web server for my latest project – a Node.js / Express app. All was going well – I spun up a droplet on DigitalOcean, installed NVM, Node, Git, MongoDB and deployed and configured my app. Then I decided to add Nginx into the stack to act as a reverse proxy…

Read More →