Ubuntu handles log rotation with a utility called logrotate. By adding your own profile to /etc/logrotate.d (just follow the examples already there) the utility will rotate any logs you want. Who knew?
Tag: ubuntu
Dec 30
Ubuntu to Ubuntu – Replacing a web server
So, the old web server is acting slow and I don't know why. Solution? Move to a new webserver, and upgrade to the latest OS along the way. It needs to be upgraded anyway, right?! That's what I just did and here are the most valuable command line arguments for doing so: [RAW]tar -pcvzf www.tar.gz …
Nov 18
If you want to use Sendmail, install it, dummy!
Right…I must have forgotten to install sendmail, because mail wasn't working for WordPress. First, to verify that sendmail wasn't working I ran this PHP script (thanks to phpeasystep.com) <? // send e-mail to … $to="me@localhost"; // Your subject $subject="Test"; // From $header="from: your name <your email>"; // Your message $message="Hello rn"; $message.="This is testrn"; $message.="Test …
Oct 28
More cron stuff in Ubuntu
So, I needed to make a cron job that runs every hour. This is crazy simple; at least in Ubuntu! Ubuntu has folders in the /etc/ folder… cron.daily cron.hourly cron.monthly cron.weekly It's pretty easy. As long as you don't need to control exactly when a process executes, just throw a script file in one of …
Oct 11
Self Signing a Certificate for a Test Server
While messing around with a new membership database I ran into a wall. The script that gives me a web interface simply would not continue until I secured my connection properly. So, I found myself in need of a do-it-yourself certificate (since I wasn't willing to pay $500+ for a real certificate yet). I found …
Sep 20
Strip out a bracketed piece of text using PHP
In WordPress I have a free, third-party theme that is displaying my image captions in article excerpts for some reason. The captions show up as a sort of bracketed markup. I tracked down the part of code that prepares the article excerpts and ran this regular expression to strip out any square-bracketed text: The 'Us' …
Jul 28
Remove a directory: rm -rf
I've Googled this about 10 times now, maybe if I write it down I'll remember: The -r means recursive, and the -f means force; which means it will ignore the fact that the directory is full.
Jul 15
Samba: Meh.
I'll start by saying Samba is not as easy as it should be, even when it's fully set up and working, but it gets the job done, and SFTP gets so tedious after a while. Here's what I had to do to get it working. First, install it: apt-get install samba Next, edit /etc/samba/smb.conf and …
Jul 14
There's inheritance, and then there's inheritance
…no, not the money kind of inheritance. I'm talking about the ownership and permissions in Linux. Linux permissions are tricky for a Windows guy like me. When I copy a file to a directory on a server I expect the file to inherit the permission of the containing folder on the server. Period. Why? Because …
Jul 09
Hrmph, you mean GD wasn't installed?
I couldn't embed thumbnail sizes on my new WordPress install on my new Ubuntu server; I could only embed the original size (which was 3072×2048). The options to embed other sizes were just grayed out. It turns out that the default LAMP install doesn't include php-gd, the graphics library that creates thumbnails. Well… I guess …