Skip to main content

Posts

Showing posts from September, 2007

Making Google Calendar a responsive embed with Mobile support

Google Calendar is amazing, but the embed code is pretty old.  They haven't updated it in many years. Since everything is Mobile First today, I needed a way to display better on cell phones. The following code does the following: Define a Responsive Cal types so that it uses 100% of the frame Define a DeskContent and a PhoneContent sizes (with a width of 768 being the switch point)  Wrap all of it in the Responsive Call Div so it all resizes automatically Display the Month view of the calendar if it's a desktop resolution Display the Agenda view of the calendar if it's a mobile resolution I've formatted this so that it can be placed inline in your HTML file. The first Embed should be your calendar code set to the Month view. The second Embed should be your calendar code set to the Agenda view.

Logrotate with Syslog-NG

I wanted to archive my logs that are created with Syslog-NG. But I also wanted to delete them after a while. Syslog-NG does a great job of rotating the logs. There is even a script on the Syslog-NG FAQ that will compress the logs.  My script has now been copied up there. (wohoo) But we have a pretty small Syslog server, and generating 10gigs of logs day fill it up pretty quick. Here's the script I wrote... It's pretty simple to follow: Find all files in the log directory that are not dated today, and that are not .gz, and archive them using gzip. We chose to use Gzip because of the time it takes compared to b2zip. Yes, we can get more space from B2zip, but we usually have to uncompress the file, and B2zip can take 20 minutes to do this. Then, find all files that have not been modified in 14 days, and delete them. Then, find all directories that are empty, and remove them. There is a small logic problem with this script. If you change the modification time of t