Category Archives: Information

Security images pruning

Well, I have been procrastinating about this.  My security videos get saved on the linux security server, and are limited to a month or so.  Daily, those sql event images get combined into an .avi video and saved locally and sent via ftp to my main server.  They DO pile up, though, as evidenced by the image on the right.  1.2TB.  They have been saving since 12 Apr 2018, when I added that feature to the script that I wrote that created the video files from the sql images.  The reason I did that was that it made it easier to review and archive the security alerts.  Hand deleting all those directories would be a major pain in the ass.  Enter this command:  😉

[root@cap Cameras]# find -mtime +365 -exec rm -R {} \;

It took a short while to parse through all the directories, but, eventually it finished. I checked on things with du -h –max-depth=0. The max-depth argument will stop all the sub directories from printing to the screen.  The results are in the image below.  436GB.  That’s quite a bit of space saved.  Now, instead of directory saved images dating back to 2018, there is only one year.  While the find/rm command above is suitable to enter directly into a terminal and have it operate on the current directory, it is rather dangerous to use.  Far better to schedule a potentially dangerous command in the cron.  First step, is to create the command.  In order to do that, as root do: nano /sbin/shear , or the name you choose to use.  I chose shear.  Add this & save: find $1 -mtime +365 -exec rm -R {} \;  If you have sharp eyesight, you will notice that I inserted $1 after find.  This is a command variable.  Last part of creating the command will be to make it executable by root, and not even readable by other users.  Do this  as root to do that; chmod 700 /sbin/shear.  Of course, if you can’t use root directly on your system, then use sudo.  Now, you can directly use the command that you created as:

# shear /path/to/directory/you/wish/. (/sbin/ should be in your path. If you saved it elsewhere not in your path,  </path/shear>) 😉

Final step is to create a crontab entry to run it monthly or so.  crontab -e will allow you to edit your crontab,  Of course, you might have to do sudo crontab -e if you can’t become root.  If you need help with the syntax: cat /etc/crontab.  I also have the MAIL=root commented out, so as not to get emails filling up root’s email box.  Then, restart crond.  That’s it.  If anybody needs a review of crontab and how to use systemctl to restart crond, either reach out to me, or just add a comment, and I’ll create a little tutorial. 😉

WordPress suckiness

Well, in making yesterday’s post, I encountered a wordpress error when I wanted to edit the post.  It would give me a ‘critical error‘.  However, it would only give that error for yesterday’s posting.  If I tried editing a previous post, either without embedded graphics, or with, it worked fine.

I tracked it down to an issue with WP User Manager plugin that I use for various system settings.  If I temporarily disabled it, I could edit yesterday’s post fine.  So, after I did, I re-enabled that plugin.

I may have to look into upgrading the main blog version, as I have 5.3.2 installed, and I believe 5.7.2 is available.  However, that can wait for awhile, I think.  But, this issue is most definitely worth remembering.

More cost savings

As if cutting my internet costs in half from about $140/month to about $70/month wasn’t enough, I finally cut the cable cord (well, almost).

Many people nowdays get most of their viewing content over the internet, myself included.  My monthly cable bill was about $170/month, and I don’t think I had anything special like HBO or NFL channel.  That is steep.  So, I went to ‘basic’, which is basically local networks.  Xfinity still gets $70/month for that, which is highway robbery.

I did that a month ago, and I’m fairly happy, as things like Netflix, Hulu, Disney+, XBMC, etc are all internet-served.  Same thing with many new movie releases.  You can stream them when they get released.  So, net savings per month for the ISP and the cable is about $170/month.  🙂

So, a fiber internet upgrade allowed me to rely more heavily on streamed content, and will save me about $2000 per year.  Not too bad.  😀 

Issues with servers

With every upgrade paths there are bound to be hiccups.  Yesterday, the power company disrupted my service for an hour or so to replace a pole.  Unfortunately, only the ONT power supply was on the UPS, and the fiber router was not.  I have a fairly stout UPS that will keep up my two main servers, and various other items a couple hours or so.

Well, the only thing that should have happened would be a connectivity disruption. I am business class with a static IP address, and when everything came back up together, it gave me a dynamic IP address.  Spent awhile on the phone today with Frontier, and a tech has to come by.  They think the router is defective and not maintaining static connection versus dynamic.

The nice part about business class, is that calling them, you usually get connected almost immediately.  Another nice thing is my tech visit appointment to replace the router is TOMORROW.  😉

So, for the moment, the krabradio.net domain still points to the IP that is supposed to be my static address.  I have set crabradio.net to the current dynamic address.  That should hold things until tomorrow.  After the router issue gets taken care of, I shall point all domains back to the static IP.  For now, webpages (to include blogs), ftp, icecast stream, ssh, etc should all be working fine.  Unfortunately, the ircd won’t be working until this matter is resolved.

P.S.  Besides, the servers, now the ONT power supply and the fiber router are both on the UPS. 😉

Thanks for your patience.

<the management>