Installing and Configuring Monit on Ubuntu Server

Run the following to install:

sudo apt-get install monit

To configure, open the file

sudo nano /etc/monit/monitrc

I added the following to the file to monitor the user and system CPU usage. Not sure if this will work yet.

check system localhost    
    start program = "/opt/zimbra/bin/zmcontrol start"
        as uid zimbra and gid zimbra
    stop program = "/opt/zimbra/bin/zmcontrol stop"
        as uid zimbra and gid zimbra            
    if cpu usage (system) > 99% for 5 cycles then restart    
    if cpu usage (user) > 99% for 5 cycles then restart

Setup the Http server so you can check status remotely

 set httpd port 2812
    use address ipaddress
    allow 0.0.0.0/0.0.0.0
    allow user:pw

If you have csf installed, make sure you update your csf config file to open up port 2812

vi /etc/csf/csf.conf

and then to reload csf

csf -r

Reload monit

monit reload

Check monit status

monit status

References:

 

SQL Server: Get Fragmentation Level for Indexes

If using an older version of SQL Server,

DBCC SHOWCONTIG

Newer versions should use the dm_db_index_physical_stats

DECLARE @db_id SMALLINT;
DECLARE @object_id INT;
SET @db_id = DB_ID(N'AdventureWorks');
SET @object_id = OBJECT_ID(N'Production.Customers');
IF @object_id IS NULL 
BEGIN
   PRINT N'Invalid object';
END
ELSE
BEGIN
   SELECT IPS.Index_type_desc, 
      IPS.avg_fragmentation_in_percent, 
      IPS.avg_fragment_size_in_pages, 
      IPS.avg_page_space_used_in_percent, 
      IPS.record_count, 
      IPS.ghost_record_count,
      IPS.fragment_count, 
      IPS.avg_fragment_size_in_pages
   FROM sys.dm_db_index_physical_stats(@db_id, @object_id, NULL, NULL , 'DETAILED') AS IPS;
END
GO

Reference

 

Windows: Convert .wav to .m4a [PC Audio to AAC] using FFmpeg

The latest version of ffmpeg use the libvo_aacenc library. This means the libfdk_aac library is optional.

To convert, type the following

ffmpeg -i in.wav out.aac

Or run the following script in a directory to batch convert files.

@ECHO OFF

FOR /R %%G IN (*.wav) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.wav.m4a) DO (CALL :SUB_RENAME "%%G")
GOTO :eof

:SUB_VLC
 SET _firstbit=%1
 SET _qt="
 CALL SET _newnm=%%_firstbit:%_qt%=%%
 SET _commanm=%_newnm:,=_COMMA_%
 REM echo %_commanm%
 CALL "D:\Program Files (x86)\FFmpeg\bin\ffmpeg.exe" -i %1 "%_commanm%.m4a
GOTO :eof

:SUB_RENAME
 SET _origfnm=%1
 SET _endbit=%_origfnm:*.wav=%
 CALL SET _newfilenm=%%_origfnm:.wav%_endbit%=.m4a%%
 SET _newfilenm=%_newfilenm:_COMMA_=,%
 COPY %1 %_newfilenm%
 DEL %1
GOTO :eof

:eof

Convert m4a to mp3 [AAC to MP3] using ffmpeg

ffmpeg -i testing.m4v -b:a 192K -vn testing.mp3

Reference

Or.. modify the VLC batch script

@ECHO OFF

FOR /R %%G IN (*.m4a) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.m4a.mp*) DO (CALL :SUB_RENAME "%%G")
GOTO :eof

:SUB_VLC
 SET _firstbit=%1
 SET _qt="
 CALL SET _newnm=%%_firstbit:%_qt%=%%
 SET _commanm=%_newnm:,=_COMMA_%
 REM echo %_commanm%
 CALL "D:\Program Files (x86)\FFmpeg\bin\ffmpeg.exe" -i %1 -b:a 320K -vn "%_commanm%.mp3
GOTO :eof

:SUB_RENAME
 SET _origfnm=%1
 SET _endbit=%_origfnm:*.m4a=%
 CALL SET _newfilenm=%%_origfnm:.m4a%_endbit%=.mp3%%
 SET _newfilenm=%_newfilenm:_COMMA_=,%
 COPY %1 %_newfilenm%
 DEL %1
GOTO :eof

:eof

Change the command:

"D:\Program Files (x86)\FFmpeg\bin\ffmpeg.exe"

to the path where ffmpeg is located. Place the ‘.bat’  file in the directory where you want to convert files and run.