Author: matt
-
Owning Content
So I’m reviving my personal site. In the past I was worried about owning the storage of my content so I self hosted this site on wordpress, which is honestly a pain for just wanting to write some stuff every so often. So what was my solution? I migrated the little bit of content I…
-
Replace a string inside of a MYSQL field
I recently needed to replace part of a URL found inside the body HTML of a page that was stored in a MySQL column. In order to do this I was able to use the handy Replace() MySQL function. UPDATE myPage SET pageBody = REPLACE(pageBody, ‘/oldirectory’, ‘/newdirectory’) WHERE INSTR(pageBody, ‘/olddirectory’) > 0; The INSTR() function is not technically…
-
Splitting Large Log Files
Every so often you run into a log file that doesn’t have a log rotation set up and has grown so large that it is near impossible to open in many editors. Today I ran into one of those files that was 1.5GB. Thankfully there is a handy split utility that can generate chunked text…