Meta

Category: Note to Self

Although it’s happening a bit less recently, every once in a while when I add new media to Plex, the metadata does not appear. When this happens I first try doing the usual things like manually refreshing the metadata and emptying the library trash. If it’s still not working, I’ve found that manually deleting the cache files from the computer running the Plex server seems to almost always fix the problem.

I recently discovered that Chrome does not allow the loading of local resources when I tried to link a stylesheet from one local project to another. Here is an example of what I tried to add to the HTML in my project:

At some point Apple decided to remove the option in the Messages app to choose the location to save chat history. Ever since that change, I always seem to forget where my chat history is saved. Here is where chat history is now stored:

~/Library/Containers/com.apple.iChat/Data/Library/Messages/Archive

Update

The location of the Messages history has moved in Yosemite. Here is the new location:

~/Library/Messages

That directory contains the Messages chat history, as well as all attachments.

Here’s another DreamHost tip, this time for using mysqldump to export a MySQL database. You could always use phpMyAdmin to export a database, but there are times when the mysqldump command is either easier, better, or in my case when I had an extremely large database, the only option.

DreamHost has a mysqldump page in their wiki that explains how to set up a mysqldump script as a cron job, but I wanted to run this as a standalone command. Here is what I came up with:

Note: Any of the values needed for this command can probably be found on the “MySQL Databases” section under the “Goodies” menu item in the DreamHost control panel.

[domain] is the hostname associated with the database you are wanting to export.

[user] is a user with access to the database.

[password] is the password for the user.

[database] is the name of the database.

[filename] is the name of the file you would like to save from the export, ending in .sql. You can put a file path in here as well. If you don’t supply a path, it will just save the file in your current directory.

Recently, I needed to make some modifications to the PHP.ini settings on a shared DreamHost server. Specifically, I needed to increase the file upload size limit (the default was only 7 MB) and increase the PHP memory limit a bit. This turned out to be much easier than I expected.

Changing the PHP.ini settings on a shared server works by creating a phprc file for each version of PHP you want to alter. Any settings in the phprc file will override the ones in the PHP.ini file. Any settings not specified in the phprc file will default to the server PHP.ini file.

Determine which PHP version your website uses. The easiest way to do this is to login to your DreamHost panel, navigate to the “Manage Domains” section, and click edit next to the domain. On the edit page, you will be able to see the PHP version that has been selected for that domain.

Open a terminal and SSH into your DreamHost server.

Create a new directory in your user home directory that will store a phprc file with custom PHP.ini settings. For PHP 5.3 run this command:

mkdir -p ~/.php/5.3

or for PHP 5.4, run this command:

mkdir -p ~/.php/5.4

Inside your newly created directory, add a phprc file by running this command:

touch phprc

Edit the phprc file to add your custom settings. At this point, I find it easier to just SFTP into the server and edit the file. Just make sure you have your “view hidden files and folders” option turned on.

Add your custom settings. For an example, here are the settings I added to increase file upload and memory limits: