Category Archives: Setting up Applications

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.

 

C#, XML, XML Prefixes, and Signing XML Documents with Prefixes

For those tasked with integrating an API from a company that starts with an R and ends with a one. Here are some links that may prove useful:

Digitally Signing an XML Document and Verifying the Signature

Here’s a PDF of the article, in case it ever get’s taken down.

I didn’t use C# to create the XML document. Instead, I used a Razor template to generate the XML.

How did I sign an XML document with an XML prefix?

Reference this Stack Overflow thread. Check the answer submitted by George Dima. [Thank you George.]  Reference in case it ever gets taken down.

I didn’t realize that you can’t sign an XML document with a prefix in .NET using the objects provided as is. It took me awhile to figure out that this was causing a validation issue with the XML signature.

How do I Http Post in C#?

Reference the code here or just download it here.

There’s an easier way using the WebClient object, but if you can’t use the latest version of the .NET framework, the above will work fine in all cases.

 

 

Ubuntu Change Boot Order for a Service

Use the update-rc.d command.

First remove the link fron the /etc/init.d directory to the rc.d directories

sudo update-rc.d -f my_old_script remove

Then change the boot order. The following updates the scripts boot order to 98.

sudo update-rc.d my_script defaults 98

This command can also be used to remove or add a service during boot.
Source