Table of Contents: Linux

Most Popular: Linux

NextCloud – Purge Music Library from DB

I recently posted an old bash script I had written to forcefully rescan the music library for the music app in NextCloud when new files aren’t being found, but what happens when you delete or make some changes to the MP3’s or file structure of your music library, then you go to run the rescan library occ script, and NextCloud proceeds to go ape shit, spewing a whole lot of errors in RED, and you can’t do anything? What now, home slice?

Welp, after some research, I found the easiest fix was just to dump the corresponding “oc_music_tracks” table from the database and start fresh. So again, it’s script writin’ time, boyz and girlz!

Continue reading “NextCloud – Purge Music Library from DB”

NextCloud – Rescan Music Library for All Users

NextCloud is a kick-ass piece of open-source software for personal cloud file sharing, backing up cell phones, email, and other forms of data, syncing contact lists, online collaboration, communication, and a variety of other use cases, but over the last few years, I’ve come across a few pitfalls and annoyances that required manual interventions. In doing so, I’ve lost quite a few man-hours of my pitiful existence on this planet scouring forums and GitHub posts, so let my loss be your gain.

Continue reading “NextCloud – Rescan Music Library for All Users”

Bash Script – Test Veeam Linux Agent Socket and Restart Service if Needed

I recently started using the full version of Veeam Backup & Replication (Build 11.01.1261) in a corporate production environment and was kind of shocked to find that the Veeam Agent for Linux (Agent version: 5.0.1.4493) fails so regularly with the following warning and error messages:

Processing ServerName Error: Failed to execute agent management command print. Connection refused Failed to connect: /var/tmp/veeam/socket/veeamservice.sock. Failed to connect to veeamservice daemon.

and

Task failed. Error: Failed to execute agent management command print. Connection refused Failed to connect: /var/tmp/veeam/socket/veeamservice.sock. Failed to connect to veeamservice daemon.

Apparently, Veeam offers no error checking or resolution process for automatically restarting the service, so I had to write a quick script to resolve this ongoing issue.
Continue reading “Bash Script – Test Veeam Linux Agent Socket and Restart Service if Needed”

Ubuntu Server 18.04 – Postfix 3.3.0 Issues

After doing a release upgrade to Ubuntu Server 18.04, Postfix stopped working with the following messages in the syslog:

Mar 11 09:56:02 servername postfix/master[1046]: warning: process /usr/lib/postfix/sbin/smtpd pid 12628 exit status 1
Mar 11 09:56:02 servername postfix/master[1046]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling
Mar 11 09:57:02 servername postfix/smtpd[12650]: fatal: in parameter smtpd_relay_restrictions or smtpd_recipient_restrictions, specify at least one working instance of: reject_unauth_destination, defer_unauth_destination, reject, defer, defer_if_permit or check_relay_domains

The fix:

postconf -e 'compatibility_level=2'
systemctl restart postfix.service

Bash Script – Install HP Server Management Tools on Ubuntu Server

Here’s a quick and dirty, no-frills bash script to install the HP Server Management Tools on Ubuntu Server. As is, it will install the command line utilities to configure ILO and your RAID controllers. You can look up the other package names available for your distribution by examining the Packages file as in this example here:

Continue reading “Bash Script – Install HP Server Management Tools on Ubuntu Server”

How to Clone Windows with Clonezilla when the Destination Disk is Smaller than the Original – OR – Cloning a Large Drive to a Smaller SSD

I’ve done this dozens of times now over the last couple of years when it comes to swapping out workstation hard drives with SSDs and it’s pretty much become second nature at this point, but I think the world could use a good write up on this because I’ve wasted countless hours acquiring this knowledge.

So, for today’s lesson, we will be cloning a Windows 8.1 installation from a 500GB desktop hard drive onto a 250GB SSD. Basic knowledge of how to use tools like the command line and Disk Management are assumed. Continue reading “How to Clone Windows with Clonezilla when the Destination Disk is Smaller than the Original – OR – Cloning a Large Drive to a Smaller SSD”

Bash Script – Move Files into Subdirectories Based on Modified Date – OR – Moving Ntop Netflow Dumps into Subdirectories by Date

In a busy network environment, it is critical to have some form of network monitoring on all your servers and equipment. Network monitoring comes in many different forms and flavors, whether it be to monitor critical system services and applications via SNMP, WMI, or some proprietary third party software, or just generically pinging some devices to make sure they are up.

Nowadays, it is getting more and more necessary to dig deeper to be able to track what end users are doing and what websites they are visiting and this is where the Cisco Netflow comes in handy. Essentially, netflow allows us to peer down into the network traffic streams and give us vital source, destination, and protocol information coming to and from our network hosts but isn’t quite as storage intensive as doing a full fledged pcap dump, which makes historical accounting of this data a whole lot nicer.
Continue reading “Bash Script – Move Files into Subdirectories Based on Modified Date – OR – Moving Ntop Netflow Dumps into Subdirectories by Date”

Ubuntu – Icecast2 Startup Script with Ices2 Support

Recently I set up an Icecast server to be able to stream music on hold to my Asterisk servers at work. Here is an updated init script for Icecast2 that adds support to start the Ices2 source client at the same time. For streaming audio from a playlist with Ogg support, Ices2 is a good candidate. For streaming audio from an mp3 based playlist, have a look at Ices0 that can be downloaded on the same site. There is also an array of different Icecast source clients to choose from here. This just happened to be the first one that I tried out. I ended up bastardizing the code somewhat to make it conform to my own personal preferences by using functions and what not to make it all pretty like. I also chose to run Ices2 as the same user as the icecast user, so you would have to update any permissions on the Ices2 directories and config files as needed.
Continue reading “Ubuntu – Icecast2 Startup Script with Ices2 Support”