Syndicate content

peter's blog

Sep 27
0

Sensible Auto Git Tagging Deployments to Production on Jenkins

Tue, 09/27/2016 - 07:03 — peter

The Problem

You've built your code, and you have a spiffy Jenkins setup to pull from git and run your tests for you, and you want to keep track of the pushes you do to your production environment. By default, Jenkins produces a local tag on the job's workspace named something like this: jenkins-<job-name>-<sequence-number>. However that doesn't tell you much. And that is not pushed to the remote repo.

As a developer, I'd prefer to just look at the list of tags on a repo and know which ones refer to pushes to production, and also know some more information about them without having to check them out and without having to inspect their logs. As you must know, according to Uber-Geek Larry Wall, developers are lazy! And impatient! And full of hubris! And that is a very good thing!

Sep 23
0

Make word-back and word-forwards navigation work again on PhpStorm's Terminal

Fri, 09/23/2016 - 22:12 — peter

The Problem

JetBrains' IDEs are awesome! The more you get into them, the more you rely on them. One problem, however, has pestered me for a while: the built-in terminal doesn't have support for the word-back and work-forwards shortcut. You know, when you hold alt + left-arrow or alt + right-arrow? Most of the time I use a Mac, so in the past I used a pretty nifty program called "Keyboard Maestro" to create a shortcut that worked only on PhpStorm and other JetBrains IDEs that would do that for me, but as well as that worked, I always wondered if there was a nicer way. Turns out there is!

Sep 22
0

Create Diagrams Inside PhpStorm with PlantUML

Thu, 09/22/2016 - 20:35 — peter

Diagramming in PhpStorm (or any other JetBrains IDE)

A picture is worth a thousand words, and a well-constructed diagram is worth many pictures! And if it is super-simple to create these useful diagrams, why not, right? This quick post will guide you (and future me) on the steps necessary to get PlantUML - a diagramming library - setup in JetBrains PhpStorm.

Feb 26
0

Let's dance with DSH!

Fri, 02/26/2016 - 08:39 — peter

The Problem

You are a developer troubleshooting performance issues on production and you want to look at server logs. The web servers are in a load-balancing cluster that you have no access to, and the incredible folks responsible for the devops of this setup do not have the very basics of centralized logging configured... Not that I've found myself in this situation... Uh, I'm asking for a friend of a friend... ;)

Feb 25
0

There and Back Again...

Thu, 02/25/2016 - 09:05 — peter

Wow, it is hard to believe that the last post on I did here was over 2.5 years ago... I had recently finished my MBA, and was ready to get back into the game.

Jul 17
2

Fix MAMP Error: "General error: 2006 MySQL server has gone away"

Wed, 07/17/2013 - 19:46 — peter

While working on a local copy of a Drupal site I am helping develop, I ended up hitting the following error:

General error: 2006 MySQL server has gone away: SELECT ff.* FROM {filter_format} ff ...

Ugh! Now what?! We need to change a setting on MySQL that ships with MAMP. As it turns out, the default max_allowed_packet is set to 1M and it needs to be higher. Changing that to 100M did the trick for me. Locate your my.cnf file and add the following setting under the [mysqld] section:

Jul 17
0

quick fix for CentOS locale issue on new virtual environment

Wed, 07/17/2013 - 10:36 — peter

We've just setup a new virtual environment, and upon login found this nice error:

# ✔ peter@endor(ttys002) ~
ssh new-server
Last login: Wed Jul 17 08:27:23 2013 from 192.168.73.37
-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory

And...

Jul 17
0

easy way to change the current branch (HEAD) on a remote git repo...

Wed, 07/17/2013 - 10:00 — peter

Just had an interesting problem today where I needed to blast away the remote copy of a git master branch (don't ask!), but I couldn't do that because it was the current branch.

I quick question to a local git guru and the answer was very easy:

git remote set-head <remote> <branch>

Then I was able to delete the rotten origin/master branch, create it again from a good branch, reset it to HEAD and life was good again!

Easy Peasy!

-PCP

Oct 17
0

fix (workaround) the thousands of log entries that logitech solar service creates on osx

Wed, 10/17/2012 - 07:14 — peter

It turns out that you can "instruct" syslogd so that it ignores all messages from Solar Service instead of writing them to /var/log/asl. Here's how:

1. Add the following two lines in /private/etc/asl.conf:

# Ignore messages from Logitech's Solar Service.app
? [CS= Sender Solar] ignore

2. Reboot

OR simply restart syslogd by running:

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

Sources where I found all this information:

Oct 14
0

List custom URL Schemes in OS X

Sun, 10/14/2012 - 16:02 — peter

was playing around osx and figured out how to list all the custom url schemes (from the command-line)...

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
-dump|egrep "(bindings.*\:$)"|sort

The output is something like this: