Category: MySQL
-
Delete MYSQL Entries Older Than Two Weeks
I have an old cacti install plugging away that chokes on the number of syslog entries if I let them stack up longer than two weeks, so here’s a simple cron job I scheduled that runs nightly deleting everything older than 2 weeks: mysql -e 'delete from syslog where date < current_date() – interval 14…
-
RadiusManager Time Expiration Update Script
RadiusManager by DMASoftlabs is a cheap, easy to use radius front end that will authenticate pppoe, hotspot, whatever accounts. One downside is the support isn’t the greatest. You occasionally have to do some hacking on your own. The particular fix I made with this script is that if you have date expiration customers(as in they…
-

How To Setup A Backup Radius Manager Install
Radius Manager is a product from DMA softlabs that acts as a radius authentication system for your wireless or hotspot clients. I personally use it for my hotspot clients in Mikrotik. The point of this article is to show you how to add some redundancy to your configuration. The software is licensed via a MAC…
-
Cacti – Syslog Alert SQL Insert
I was inserting lots of new syslog alerts and didn’t want to do it through the GUI, so I wrote a quick mysql query: INSERT INTO syslog_alert (name,type,message,user,date,email) VALUES("MessageTitle","messagec","MatchMe","ADMIN",1186586067,"[email protected]"),("MessageTitle2","messagec","MatchMe2","ADMIN",1186586067,"[email protected]")
-
WordPress Pingback SPAM
I’ve been getting tons of WordPress pingback spam. Pingbacks are a little wordpress notification that will tell you when some other wordpress user links to your blog. It tries to pop into your comment section. This is great unless you are me. I get 20 spam pingbacks a day. By default they are allowed on…
-
Replace String in Mysql
I switched to a new wordpress code highlight plugin, so I had to replace the old highlight string with a new. I issued 3 SQL commands that crawled my posts and updated them. update wp_posts set post_content = replace(post_content, ‘<code lang="text">’, ‘<p lang="text" line="1">’); update wp_posts set post_content = replace(post_content, ‘<code>’, ‘<p lang="text" line="1">’); update…