The other day I ran into an interesting issue with a Git repository. We needed to have a file included in a repo so it would would get created but we didn’t want to track any of the changes (in this case it was a log file from a legacy application). Normally, if we want to ignore a file inside a repo we add it to a
.gitignorefile but that wouldn’t work in this case because that would completely ignore the file or track the changes after we’ve added it.
Git has a quick feature that takes the file and ignores any change to it:
git update-index --assume-unchanged path/to/file.txt
It’s hard to believe it’s December already. :-)
One of the things you’ll find annoying if you’re trying to adhere to the PSR standards is that it’s hard to notice things like extra spaces at the end of lines and that you don’t have a blank line at the end of your file. You can run something like phpcbf to fix the file before you commit (and that’s a perfect option which will discuss in another article) but it’s nice to have sublime clean up whenever possible before you save.
Another feature that makes Sublime Text a little easier to work with is Plug-ins. Like all plug-in systems, Sublime Text’s Plug-in system allow for developers to extend Sublime Text’s functionality without having to submit a pull request or bloat the core. There are a huge number of plug-ins to pick from but I’m going focus on several that I’ve found to be very helpful in my PHP development.
On one of the servers I manage I was troubleshooting a problem where logrotate (check out our guide for setting up logrotate on a custom file) wasn’t running on a set of files. To troubleshoot problems with logrotate I always run the command with a specific configuration and the force (-f) and verbose (-v) options:
I assumed it was having trouble with the file it was trying to rotate so I messed with those permissions for a while but then I looked at the permissions on the configuration file:
Logrotate doesn’t like the fact that other people can write to the file so I changed the permissions so only root had write access:
Then everything worked.
As part of my morning fighting with Windows 10 Anniversary I learned something new. If vagrant can’t communicate with VirtualBox it will try to install the version it was tested with:
In my case it didn’t work because I already had a newer version of VirtualBox installed:
This morning my work laptop rebooted and installed Windows 10 Anniversary. When I tried to run
vagrant upI ran into some problems:
The only solution I found to this was to:
- Uninstall VirtualBox
- Install the current version of VirtualBox
- Update Vagrant
Just in case someone else needs help. :-)
As we talked about last time, Sublime Text will autocomplete specific keywords that are defined by either the Sublime Text crew or a plugins developers. What if I told you that it’s possible to create snippets to create your own keywords to speed up your development.
subscribe via RSS