Cut exact time range from mp3 on Debian/Ubuntu

Install ffmpeg program if you dont have

sudo apt-get --purge remove ffmpeg
sudo apt-get --purge autoremove

sudo apt-get install ppa-purge
sudo ppa-purge ppa:jon-severinsson/ffmpeg

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update

sudo apt-get install ffmpeg

Cut exact time range from mp3

ffmpeg -i Full.mp3 -vn -acodec copy -ss 00:08:30 -t 00:01:25 -f mp3 -threads 0 output.mp3


That’s all!

Form validation example using CodeIgniter

Example is about simply user creation.

Controller file(user.php)


 * User controller class
class User extends CI_Controller

	public function create()
		$data=['title'=>'Create New User'];

		// validation rules
				// user-defined validation rule via method
				'label'=>'Password Confirm',

		// failed
		if ($this->form_validation->run() === FALSE)
		// successfull

	// user-defined validation rule via method
	public function checkPasswordStrength($password)
		if (strlen($password)<5) {
			$this->form_validation->set_message('checkPasswordStrength','Password length cant be less than 5 characters');
			return false;
		else if (!preg_match('/[[:punct:]]/',$password)) {
			$this->form_validation->set_message('checkPasswordStrength','Password must contain at least 1 special character');
			return false;
		return true;

View file(create.php)

	<?php echo validation_errors('<li class="error">','</li>'); ?>

<form action="/index.php/user/create" method="post">
	<input type="text" name="username" value="<?php echo set_value('username'); ?>" />
	<?php echo form_error('username','<div class="error">','</div>'); ?>
	<br />

	<label for="">Password:</label>
	<input type="password" name="password" value="<?php echo set_value('password'); ?>" />
	<?php echo form_error('password','<div class="error">','</div>'); ?>
	<br />

	<label for="">Password Confirm:</label>
	<input type="password" name="passwordConfirm" value="<?php echo set_value('passwordConfirm'); ?>" />
	<?php echo form_error('passwordConfirm','<div class="error">','</div>'); ?>
	<br />

	<input type="submit" name="submit" value="Create" />