Ulyssesonline

the tech surfer

  • Home
  • About
  • Archives
You are here: Home / 2009 / Archives for December 2009

Archives for December 2009

December 4, 2009

Install Subversion Repository on Ubuntu Desktop

This is a tutorial how to install a Subversion on your desktop. Subversion is an open-source revision control system. A repository is usually installed on servers so developers and programmers can have easy access to code. Subversion uses a check-in an check-out process for submitting changes to the repository. The repository can also be installed on desktop systems. Access is gained through many means by way of direct file access, ftp, http, svn and svn+ssh. See chart below.

Installing Subversion will install both Subversion administration tools and the client. In Ubuntu or Debian-based systems, you can install Subversion by performing the following commands. By the way, I added an Apache and Subversion WebDav module so both can be installed with just a single command.

Install Subversion

sudo apt-get install subversion libapache2-svn

sudo apt-get install subversion libapache2-svn

Reboot the Apache Web Server

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/apache2 restart

Create a Subversion Repository

svnadmin create /home/yourname/repository/

svnadmin create /home/yourname/repository/

I’m placing the repository in my home directory. You can place it anywhere in your system. You may need to use sudo if you install it outside of your home directory. Remember the repository location, we will use it a few times below to configure the Apache Subversion WebDav module, etc.

Import your Repository

svn import /path/to/import/directory file:///home/yourname/repository

svn import /path/to/import/directory file:///home/yourname/repository

If you have a repository ready, now is a good time to import it. If you are just starting out, you can initialize the Repository here.

Access to Subversion

file:// Direct access on local disk
http:// Browser using http WebDav protocol
https:// Browser using https secure and WebDav
svn:// Subversion protocol
svn+ssh:// Subversion protocol and SSH tunnel

Configure WebDav protocol

sudo vi /etc/apache2/apache2.conf

sudo vi /etc/apache2/apache2.conf

Add

<Location /svn>
DAV svn
SVNPath /home/yourname/repository
AuthType Basic
AuthName "Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>

<Location /svn> DAV svn SVNPath /home/yourname/repository AuthType Basic AuthName "Repository" AuthUserFile /etc/subversion/passwd <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>

Change Ownership to HTTP-User

sudo chown -R www-data:www-data /home/yourname/repository

sudo chown -R www-data:www-data /home/yourname/repository

Password Protect the Repository

sudo htpasswd -c /etc/subversion/passwd username

sudo htpasswd -c /etc/subversion/passwd username

You will be asked to provide a password. Enter the password twice.

Reboot Apache Server

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/apache2 restart

It’s probably a good idea to restart the Apache server one more time.

Browser Access
Next, open up your browser and access http://localhost/svn from the address bar. You will be asked for the username and password. You should see the repository and any content or directory underneath it. That’s it. Happy coding.

Filed Under: General, Linux Tagged With: apache, desktop, http, https, repository, ssh, subversion, ubuntu, webdav

December 3, 2009

WordPress and Password Protected Directories

I think I just solved an issue with WordPress Permalinks and password protected directories that use Apache’s .htaccess. Here’s the problem in detail. I have WordPress installed on the root of my domain. Under that domain, I have a directory that I want password protected using .htaccess. It’s just a directory containing a few PHP scripts. Every time I try to access the password protected directory, I get a 404 page missing error. WordPress is confused thinking the directory is a post or a page. Since it’s not, it generates a 404 error instead.

The workaround for this is to place a couple of error codes at the top of the .htaccess to pre-empt the WordPress .htaccess rules. There are a couple of scenarios. If there is 401 situation, an authentication in this case, it will send the user to the error document which is just a blank html file. The WordPress permalinks rule never gets processed or is ignored. If there is a 403 error code, a forbidden situation in this case, it will send the user to that error document as well.

Here is the working .htaccess file. You will see the two error code rules at the top of the file. Underneath, you will see the standard WordPress permalinks rules.

ErrorDocument 401 ./blank.html
ErrorDocument 403 ./blank.html
# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress

ErrorDocument 401 ./blank.html ErrorDocument 403 ./blank.html # BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] &lt;/IfModule&gt; # END WordPress

Simple fix. Thanks to aiso.net.

Filed Under: General, HTML, Linux, WordPress Tagged With: 401, 404, apache, htaccess, password protect, WordPress

December 3, 2009

Concatenate Video Files Using FFMPEG

This article will show you how to concatenate two mpg files into one big file using the CAT and FFMPEG commands. Here was the dilemma. I have two video files that were recorded separately. The recording was accidentally stopped for a brief second or two. The cam created two separate video files. I wanted to stitch and merge the two files into one big file.

To accomplish the feat, I will be using both CAT and FFMPEG commands that is common to most Linux systems. If you use the cat command alone like the in the example below, it will not work. You’ll have timestamp issues. The player also will not go past the end of the first video. It will never play the second and third videos if you have more.

Cat is not enough.

cat abc.mpg def.mpg > ghi.mpg

cat abc.mpg def.mpg > ghi.mpg

What you need to do is use CAT and pipe the output using FFMPEG.

The command:

cat abc.mpg def.mpg | ffmpeg -f mpeg -i - -vcodec copy -acodec copy ghi.mpg

cat abc.mpg def.mpg | ffmpeg -f mpeg -i - -vcodec copy -acodec copy ghi.mpg

You now have a file named ghi.mpg which is the combined output of abc.mpg and def.mpg. You can concatenate 3 or more files if you wish. FFMPEG is such a powerful video converter program capable of converting videos to any video format like avi, wmv, mov, etc. Earlier in the year, I wrote how to install FFMPEG and also another explaining the options.

Filed Under: General, Linux Tagged With: cat, ffmpeg, mpg, pipe, video

  • « Previous Page
  • 1
  • …
  • 7
  • 8
  • 9
  • 10
  • 11
  • Next Page »

Copyright © 2003 - 2018