Category: sql
-
Postgres tip of the day – show size of all databases
Here is a handy little query to show the size of all the databases on a particular postgres server: SELECT pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size FROM pg_database; datname | size ————–+——— template1 | 6369 kB template0 | 6361 kB postgres | 6589 kB foo | 55 MB bar | 5129 MB foobar | 85 GB (6…
-
Random featured images in wordpress
I’ve had random header images on the Fedibblety Family blog for quite some time. I originally implemented this by looking for images in a particular directory. However, I had to manually add pictures to this directory, which was a bit cumbersome. I started thinking, why not just select randomly from all the featured images I…
-
Site redesign
I started my website in 2003. At the time it was hosted by the University of Michigan, where I was a graduate student. They gave all students some space for a personal website. It was really great, though it did come with some limitations, like no php or cgi allowed. I managed to kludge some…
-
New WordPress plugin – Image Browser
Today I released my 8th wordpress plugin. This one is quite a bit different from all the other plugins I have written. A friend of mine was looking for a way to create a gallery on his family blog. “No problem!”, I told him, “there are lots of plugins for that”. But I then quickly…
-
Showing total number of replies in bbpress
For awhile now I have been wanting to show the total number of topics started and replies in a bbpress forum on the profile page. Today I finally figured out how. I like bbpress quite a bit, as it integrates very nicely into wordpress. The main downside of bbpress right now is that the documentation…