Today I migrated my whole site from apache to nginx. The main reason for this being that nginx seems to handle load and use less memory on smaller boxes. It’s also an opportunity for me to try something new.
I’ll cut straight to the chase. There’s some great information already available. At the time of this writing though, both sets of instructions didn’t work for me. I’ll come to why later.
With the increased number of drive-by attacks happening lately, I decided to investigate how these attacks work and what can be done to prevent them. Continue reading
One of the things that recent github outages have highlighted is that although git is designed to be decentralized version control system, many people are not treating it that way. Rather than having multiple remotes, people push to the same place and generally rely too much on github. I’ve seen people build their whole infrastructure around github, including deploy scripts for their sites and install scripts for new developers. Furthermore, dependency managers such as Composer & Cocoapods (not intending to single anyone out) rely on github to pull in dependencies. If github goes down, you can’t fix your dependencies or pull in new ones. In an ideal world these dependency managers should have built in support for mirrors, but I’m not aware of any such feature at the time of writing.
When logging in to a server via SSH using a private key with a password, OSX saves your password. The next time you try to login it will not prompt you for your password. To disable this behaviour simply run this command:
launchctl unload -w /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist
Hat tip to mr_dbr on reddit for this.
I’ll keep this short and sweet. This bash alias will allow you to export your git repo’s master branch to a zip file.
To use it:
- Make sure that your work is committed.
- Make sure you are in the root directory of your project.
To make this script work run the following commands:
echo alias gitpack=\'git archive --format zip --output download_$(date +%d-%m-%Y-%H.%M).zip master\' >> ~/.bashrc
Now just type
gitpack and you will get a zip file.