Automate license compliance checks
In the previous tip, I showed you how to list your dependencies’ licenses. Now let’s make it more useful.
Generic scripting blog entries have the “scripting” tag.
In the previous tip, I showed you how to list your dependencies’ licenses. Now let’s make it more useful.
I have npm installed globally on my machine.
But in some projects, I have a local ./npm script that wraps docker exec to run npm inside a container.
When a new terminal opens in PhpStorm on macOS, I was getting a weird error: bash: warning: setlocale: LC_ALL: cannot change locale (en_US-u-hc-h12-u-ca-gregory-u-nu-latn): Invalid argument.. Strange, I use Oh My Zsh with the Zsh shell. Why am I getting that error? Why bash? I could ignore it each time - but I wanted a fix.
A common security pattern is to add environment-specific configuration and secrets into a local, unversioned file. You’re probably already doing this with a tool called DotEnv. Let’s see how we can reuse that between PHP and the shell.
I’m a huge fan of the live-server package for running local HTML servers to test my HTML and Javascript code. What about if you want to run a local PHP server quickly to test something? That’s easy. But I tend to forget the exact command - so I came up with a ZSH-based solution.
You’ve been there. The Zoom meeting is over and then everyone looks awkward at the bottom corner of the screen as they desperately try to leave. Nikki Glaser will show you what I’m talking about if you don’t know. Now, if you’re using Alfred (like you should be on Mac), you can easily leave the meeting.
In an earlier entry I detailed how I track things I do each day using an Alfred workflow. Basically, I wanted to track what I did from the Alfred launcher screen, one thing at a time. The end result was a txt file dated today.
I’m a huge fan of Alfred - but I had to upgrade to get the pro version to get workflows. Because I use Slack a lot, I’ve been trying to set up status automation and workflows. When using my phone, I have an automated system that sets my status. You can find that here. But, what about using Alfred for some automation?
For our agile workflow, it’s important to provide a check-in each day. What did you do yesterday, what do you plan on doing today, do you have any blockers? My biggest challenge is actually remembering what I did “yesterday” - especially after the weekend.
Using an Ansible configuration, I wanted to use postfix on ubuntu to send out mail. However, I couldn’t seem to figure out exactly how to get it to stop asking for input during the apt-get install postfix process. Turns out, you can use debconf to set the values that are necessary for the install.
Most of the development I do that needs to be tested on android is on a local subnet. Generally, this is because I am running the servers in virtual machines that mimic the production environment. When I want to test these websites via the android emulator, it would be nice to be able to surf to them locally (without putting them in a public QA environment) - as well as have the ability to use Android Chrome’s USB Debugging.
Normally I have multiple vm’s running for various different projects - all of these are in VMWare Workstation instances I toggle between suspend and started. I decided to create a script and an Ubuntu launcher icon for toggling the vms back and forth.
As most developers are lazy, I’m a huge fan of scripts. I’ve found myself lately having to add entries to iptables to block a single IP or a small subnet, so I made a quick script to make the job easier on myself.
Now, I won’t bore you with the actual details of how I came across this - let’s just skip to the explanation and example:
A while ago, I decided that I needed to have a better backup solution for my file server. After doing some research on various systems, I let my inner programmer take over - in addition to my desire to NEVER LOSE ANYTHING - and I defaulted to use SVN.
Lately, I’ve been trying to find ways to reduce the amount of time I spend on stupid sites like myspace (nevermind the fact that the time it took to reduce this amount took me enough time to visit myspace 1x a day for another month – heh). At any rate, I’ve been using Google Reader a lot more (I’m up to 180 or so feeds) and I thought: Why don’t I make an RSS feed o my comments – then I don’t have to go back to the site when someone sends me a comment.
So many times during development, I’ve missed little PHP errors because they were 1) on a processing page that was redirected or 2) output inside of a html tag - and rendered invisible.
For the setup I use at (“the triangle”), I have a lot of filesystem links - and these are made on win32 with the linkd.exe command (the version I got is from the windows 2000 resource cd). When I start a new project, I pass into my script which directories I’d like to make and checkout code into, and which I’d rather just linkd to. Well, every once in a while a link’d folder needs to be a real folder. So, since I’m a lazy programmer, I made a script called convertd which will unlink the folder and then make the folder. Chalk one up to efficiency by batch programming? Let’s see: