<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: c3phas</title>
    <description>The latest articles on DEV Community by c3phas (@c3phas).</description>
    <link>https://dev.to/c3phas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F110179%2Fd7e819ef-1484-4a2b-8a74-3bee3d6aa8e0.png</url>
      <title>DEV Community: c3phas</title>
      <link>https://dev.to/c3phas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/c3phas"/>
    <language>en</language>
    <item>
      <title>Convert Your media files</title>
      <dc:creator>c3phas</dc:creator>
      <pubDate>Thu, 27 Jun 2019 09:48:42 +0000</pubDate>
      <link>https://dev.to/c3phas/convert-your-media-files-456i</link>
      <guid>https://dev.to/c3phas/convert-your-media-files-456i</guid>
      <description>&lt;h3&gt;ffmpeg&lt;/h3&gt;

&lt;p&gt;So you have the video but can’t play it ‘cos of the format ?&lt;br&gt;
You want an mp3 but have got the mp4 or other video format ?&lt;br&gt;
You want the Video without the sound&lt;br&gt;
You have an image that should be the background of your mp3 file&lt;/p&gt;

&lt;p&gt;ffmpeg according to the man page is  a &lt;b&gt;fast video and audio converter&lt;/b&gt;&lt;br&gt;
ffmpeg library is cross platform thus can be used in any operating system ,&lt;br&gt;
 ffmpeg can be used for a torn of things but we only look at the basic here, This library is used in the background by famous video editors .&lt;/p&gt;

&lt;p&gt;Install ffmpeg on debian based system&lt;/p&gt;

&lt;p&gt;&lt;b&gt;apt-get install ffmpeg&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Lets begin by converting a video(mp4 to an mp3)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;NOTE: ffmpeg is a command line program.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;ffmpeg -i input.mp4 -vn output.mp3&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;-i is used to specify the input file , the file can be an mp4 ,webm or other video formats&lt;br&gt;
-vn – this option is used to disable the video recording. It grabs the video and gets rid of it&lt;br&gt;
output.mp3 is the output file name&lt;/p&gt;

&lt;p&gt;The above command will convert the input.mp4 to output.mp3 &lt;br&gt;
Other related options include&lt;br&gt;
-sn – disable the subtitle&lt;br&gt;
-an -disable the audio recording&lt;/p&gt;

&lt;p&gt;examples&lt;br&gt;
&lt;b&gt;ffmpeg -i input.mp4 -sn output.mp4&lt;/b&gt;&lt;br&gt;
if the input had subtitles enabled the output will be free of subtitle&lt;/p&gt;

&lt;p&gt;&lt;b&gt;ffmpeg -i input.mp4 -an output.mp4&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;will result into a video with no sound&lt;/p&gt;

&lt;p&gt;Convert a video from one format to another( say from flv to avi)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;ffmpeg -i input.flv -q:a 0 -q:v 0  -f avi output.avi&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;-i specify the input file&lt;br&gt;
-q used to set the quality of the audio and video file , a is for audio and v is for video &lt;br&gt;
 -q:a 0 means the output audio quality should be the same as the input audio quality(mainly called streams&lt;br&gt;
-f -is used to specify the target format in this case we want an avi output&lt;/p&gt;

&lt;p&gt;note The only thing you need to change are the input format and output format&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Add an image to the mp3 file&lt;/b&gt;&lt;br&gt;
so you have an mp3 but want to use your pic instead of staring at the bare screen&lt;br&gt;
&lt;b&gt;ffmpeg  -loop 1  -y -i input.jpg -i input.mp3  -acodec flac -vcodec libX264 -shortest -preset fast vf scale=1280:2 output.mkv&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;well well now we get a bit advanced here&lt;br&gt;
we have some more options lets look at some of them&lt;/p&gt;

&lt;p&gt;codecs – This simply refers to the media bitstream( How the media will be encoded and decoded)&lt;br&gt;
acodec is used to set the audio bit stream in our case we use flac&lt;br&gt;
vcodec sets the video codec&lt;br&gt;
-y   if a file with same name as the output name is present it will be deleted ie overwrite the output without asking ( -n is the opposite , says do not overwrite )&lt;br&gt;
-loop 1 -  will loop our image until the mp3 finishes&lt;br&gt;
-shortest – Finish encoding when the shortest input stream  ends&lt;br&gt;
-preset fast – how fast will the compression process take. Can be set to fast,slow ,very slow etc&lt;br&gt;
        when the value is set to fast , The quality of the output might be low but the process will end quickly. Its a trade off speed vs quality&lt;br&gt;
The next vf is used to set the video format in this case we set the output video size using the scale option , The output video will be 1280 wide&lt;/p&gt;

&lt;p&gt;NOTE: we have specified two input files , an image and an audio file&lt;br&gt;
To suppress the output add the option ( -hide_banner)&lt;/p&gt;

&lt;p&gt;if you wish to just preview how your output will be , use ffplay to play the file without saving it&lt;br&gt;
&lt;b&gt;ffplay -i input&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Ffmpeg can be used for far more advanced things which is impossible to cover.. Check the ffmpeg documentation&lt;br&gt;
To get a more clear bash script visit my github &lt;b&gt;&lt;a&gt;&lt;/a&gt;&lt;a href="https://github.com/peter-macharia/media-converter"&gt;https://github.com/peter-macharia/media-converter&lt;/a&gt; &lt;/b&gt;&lt;/p&gt;

</description>
      <category>ffmpeg</category>
      <category>bash</category>
      <category>linux</category>
    </item>
    <item>
      <title>Forgot my Root password</title>
      <dc:creator>c3phas</dc:creator>
      <pubDate>Thu, 27 Jun 2019 08:08:47 +0000</pubDate>
      <link>https://dev.to/c3phas/forgot-my-root-password-4bji</link>
      <guid>https://dev.to/c3phas/forgot-my-root-password-4bji</guid>
      <description>&lt;p&gt;&lt;b&gt;&lt;u&gt;MEEEEEEEEEN WHAT WAS THE ROOT PASSWORD&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Today we are going to play around with our Linux box&lt;/p&gt;

&lt;p&gt;&lt;b&gt;NOTE:This article can be used for malicious activity&lt;br&gt;
I hereby take no responsibility for how you will utilize &lt;br&gt;
the following&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Forgot your Linux root password? well lets get around it&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Run Levels in Linux&lt;/u&gt;&lt;br&gt;
A run level in Linux is what determines what programs will run &lt;br&gt;
or will be executed at system startup&lt;br&gt;
This is what determines whether your system loads a GUI or the &lt;br&gt;
CLI mode when booting&lt;/p&gt;

&lt;p&gt;There are 7 run levels staring from 0-6&lt;br&gt;
Each runlevel has some services started or stopped and this is normally what determines the default behavior of the machine&lt;br&gt;
I will not get into much details concerning this levels, if you want a more detailed explanation leave a comment.&lt;br&gt;
The runlevels are&lt;br&gt;
runlevel 0 - system halt&lt;br&gt;
runlevel 1 - single mode&lt;br&gt;
runlevel 2 - multiple user mode without network file system&lt;br&gt;
runlevel 3 - multiple user mode under CLI mode&lt;br&gt;
runlevel 4 - This is left blank thus it can defined by the user&lt;br&gt;
runlevel 5 - multiple user mode under graphical user interface(default on most desktops&lt;br&gt;
runlevel 6 - reboot&lt;/p&gt;

&lt;p&gt;The two used modes by default are the runlevel 3 and the runlevel 5&lt;br&gt;
if you want to find out which runlevel you are on ,on the terminal type&lt;br&gt;
 $runlevel&lt;br&gt;
 The scripts driving this levels are located in the /etc directory&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;THE MEAT OF THIS ARTICLE&lt;/u&gt;&lt;/b&gt;&lt;br&gt;
  our primary focus is the runlevel 1(single user mode)&lt;br&gt;
  This can be compared to what the folks at windows call safe mode&lt;br&gt;
  in this mode networking services will not be started but it allows one to make changes to the system&lt;/p&gt;

&lt;p&gt;&lt;b&gt;NOTE:This will only work if the systems' grub menu is not password protected&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;lets do this folks: &lt;br&gt;
step 1: Reboot your machine and on the grub menu hit 'e' to enter the edit mode.&lt;br&gt;
step 2: Find the line that starts with Linux and scroll to the end of that line&lt;br&gt;
step 3: Delete the characters all the way to 'ro'&lt;br&gt;
        -The ro stands for read only ,change this to 'rw' to allow writing&lt;br&gt;
        -After replacing ro with rw hit space and add init=/bin/bash&lt;br&gt;
        your line looks like this&lt;br&gt;
            rw init=/bin/bash&lt;br&gt;
step 4: Hit Ctrl-x or f10 to boot with current settings&lt;/p&gt;

&lt;p&gt;The boot now gives you a shell with root privileges and you can go ahead and change the root password the usual way.&lt;/p&gt;

&lt;p&gt;$passwd root&lt;/p&gt;

&lt;p&gt;After confirming the password, reboot and there we have it , a new root password.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
  </channel>
</rss>
