Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Saturday, December 08, 2012

How To Install ffmpeg on CentOs 6.x (6.3)

I installed ffmpeg on a dedicated CenOs 6.3 server. The installation mostly follows the instrcutions given by the eFFMPEG group here, but there are few important twists if you want to get it done.

1. Login as root

2.Pre-set:
# remove older installations
yum erase ffmpeg x264 x264-devel
 
#verify you get all teh tools:
yum install gcc git make nasm pkgconfig wget
 
#create a working folder
mkdir ~/ffmpeg-source
 
3. Installations
 
#install yam 
cd ~/ffmpeg-source
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
make install
 
#install x264
cd ~/ffmpeg-source
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static
make
make install
 
#install mp3 encoder
cd ~/ffmpeg-source
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --disable-shared --enable-nasm
make
make install 

#install libogg
cd ~/ffmpeg-source
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
tar xzvf libogg-1.3.0.tar.gz
cd libogg-1.3.0
./configure --disable-shared
make
make install
 
#install libvorbis
cd ~/ffmpeg-source
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar xzvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure --disable-shared
make
make install 

#install libvpx
cd ~/ffmpeg-source
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure
make
make install
 
#install zlib
cd ~/ffmpeg-source
wget http://zlib.net/zlib-1.2.7.tar.gz
tar xzvf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure
make
make install 

#FFMPEG did not want to work well in /tmp
mkdir ~/tmp
export TMPDIR=~/tmp

#you might also need to add to PATH /usr/lib
export PATH=$PATH:/usr/lib

#and probably add (I did it, but not sure it is a must)
export LD_LIBRARY_PATH=/usr/local/lib

#now install ffmeg from GIT repository
cd ~/ffmpeg-source
git clone git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264
make
make install
 
#this should work now! type 'ffmpeg' to try
ffmpeg
ffmpeg version N-47639-g0110108 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  8 2012 22:03:48 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 79.100 / 54. 79.100
  libavformat    54. 48.100 / 54. 48.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 26.100 /  3. 26.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg' 

Thursday, July 12, 2012

Clustering RabbitMQ on CentOS 6

#Assuming you got to instances of RabbitMQ installed on two separate computers in the same LAN segment, run the following command on both nodes (A and B):

rabbitmqctl status

# verify that both RabbitMQ nodes run EXACTLY the same Erlang version
# if they do not - upgrade Erlang on one of them to match the second Erlang version
# at the beginning of its layout the command displays RabbitMQ node name, e.g. rabbit@my-server-A - note this node name for the later use

# Check that both machines A and B can talk to each other (no firewall issues etc)

telnet localhost 4369


# Let's work on server A configuring RabbitMQ there to be clustered with server B.
# all the work is done on server A only, nothing should be done on server B

# stop rabbitmq service on server A

service rabbitmq-server stop



# add alias for B an A:
vi /etc/hosts

# add to /etc/hosts the alias of server B like it is displayed in the "rabbitmqctl status" output after "@" symbol, e.g. "10.10.10.10   my-server-B"
# use internal IP for server B alias if you got such, so the connection between serves A and B will go over internal switch

# copy Erlang cookie from the server B to the server  A:
scp root@my-server-B:/var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie

# give the cookie file the correct ownership (comes with 'root' after copying)
chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie

# start rabbitmq service
service rabbitmq-server start

#stop and reset the app
rabbitmqctl stop_app

rabbitmqctl reset

# cluster the current node (on server A) to the node on server B as a disk node
#(if you prefer to cluster node A to B as RAM node run       rabbitmqctl cluster rabbit@my-server-B)

rabbitmqctl cluster rabbit@my-server-B rabbit@my-server-A

# you should see the success message here

# start the app and enjoy
rabbitmqctl start_app

#verify that two nodes are indeed clustered: use management plugin
# go to server A, HTTP on port 55672
# you should see "node" column in the Queues view, filled in with 'my-server-B' node name










Saturday, June 23, 2012

Determine filesystem on Linux

df -T [device]
NOTE: for partitioned FS we should look for [device1], [device2] etc - e.g. /dev/sdf1, /dev/sdf2 (/dev/sdf FS type could be unknown in this case)
http://www.cyberciti.biz/faq/linux-how-to-determine-find-out-file-system-type/

Wednesday, May 16, 2012

Adding swap space on CentOS

# login as root with
su -

# not '-' sign - important!

#allocate file: 20 GB = 20 * 1024 * 1024
dd if=/dev/zero of=/swapfile bs=1024 count=20971520

mkswap /swapfile

#set permissions:
chown root:root /swapfile
chmod 0600 /swapfile

#add immediately to OS
swapon /swapfile

# edit fstab for persistence:
vi /etc/fstab

# edit fstab by adding the following line at the end of the file:
/swapfile /swap swap defaults 0 0

# check if the swap is allocated
free -m

Wednesday, April 11, 2012

sudo: Sorry, you must have a tty to run sudo (SOLVED)

I found that running a cron job on CentOS I am getting an error:
sudo: Sorry, you must have a tty to run sudo
the script, running not as a root user was using a sudo command.

Some googling showed that this is what I need (run sudo visudo to edit the config file):
Defaults requiretty
Defaults:root !requiretty
Defaults:myusername !requiretty


Thus the default remains "requiretty" for everyone but for the named users.

Sunday, March 25, 2012

Installing RabbitMQ on CentOS, Fedora and RHEL

# Login as root. Note "-" in su command, it is important to get proper shell definitions including the PATH
su -
....enter password


#verify OS version
cat /etc/*release*

# Download and enable EPEL
# for CentOS 5:

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

# for CentOS 6:
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm 


#Get & install Erlang
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter
/erlang/epel-erlang.repo

yum install erlang

# Get RabbitMQ signing key
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc

# check for the latest version at RabbitMQ web site: http://www.rabbitmq.com/install-rpm.html
rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.4/rabbitmq-server-2.8.4-1.noarch.rpm

yum install rabbitmq-server-2.8.4-1.noarch.rpm

# if this command did not work take a look what you got in online repositories:
# http://repos.fedorapeople.org/repos/peter/erlang/
# probably your RPM does not exists there
# in this case you can try using older RPM
# if you decided to do that, do teh following:
vi /etc/yum.repos.d/epel-erlang.repo

#comment line
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-$releasever/$basearch/

# and replace it with
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-5/$basearch/


# next, comment line
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-$releasever/SRPMS

# and replace it with
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-5/SRPMS

# exit vi and try again running
# yum install rabbitmq-server-2.8.4-1.noarch.rpm

# Add RabbitMQ to list of services to be started on reboot
chkconfig rabbitmq-server on

# Add RabbitMQ management plugin:
/usr/sbin/rabbitmq-plugins enable rabbitmq_management sudo

# start RabbitMQ server

service rabbitmq-server start


# point your browser to  http://[your-rabbitmq-server]:55672
# enter user name / pwd: the defaults are guest / guest

Thursday, June 30, 2011

Installing MYSQL on RedHat Enterprise Linux RHEL 6.1

Get MySQL here: http://www.mysql.com/downloads/mysql/#downloads


Select TAR installation if available, get the link of TAR and run
wget [link]

Uncompress
 tar -xvf MySQL-5.5.13-1.rhel5.x86_64.tar


Install server:
rpm -Uvh MySQL-server-5.5.13-1.rhel5.x86_64.rpm

Install client:
rpm -Uvh MySQL-client-5.5.13-1.rhel5.x86_64.rpm


Note this warning:
----------------------
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h ip-10-34-70-147 password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

-----------------------------------

Start MySQL:
service mysql start

Thursday, May 21, 2009

mySQL FULLTEXT search returns no results: ft_min_word_len

MySQL FULLTEXT search query worked well until I tried to find "boy" in my DB.
No results, and I can see some records with this word directly on my phpMyAdmin screen.
The same repeated with the word "red". It can find, "blue"< "green" and "yellow", but not "red".

Well, after some searching I found that FULLTEXT in mySQL has two server variables (well, it have more of course, but these two are relevant for this issue):
ft_min_word_len = 4
ft_max_word_len = 84

Words less than 4 chars will not be indexed until you change ft_min_word_len to something less than 4 chars.

So, on Redhat/Fedora and many other Linuxes you have to edit /etc/my.cnf
The addition might look:

[mysqld]
ft_min_word_len=1
ft_max_word_len=32

Note [mysqld] header - if it is already in that file, just put two lines woth ft_ under it. It's important! If you put it under another header mySQL will not recognize it. Cost me about 2 hours two figure this stupid thing out since typically "[...]" headers are ignored by the parsing software (used as comments).
But obviously, not in my.cnf and mySQL.

On Windows with XAMPP there is a file called "my" (just "my", now extension whatsoever) in /mysql/bin folder.
It's the same my.cnf, so just add the lines into [mysqld] section there.

Verify that the change worked in phpMyAdmin ->localhost -> Varaibles

The last thing to do to get the things working is rebuilding all FULLTEXT indexes, if you got some data in the DB yet.
With phpMyAdmin you can just click "edit" link next to the FULLTEXT index name, and when the edit screen opens, click "Save" button. You will see that mySQL runs actually 'drop the old index and create the new index" query.

Thursday, January 04, 2007

mySQL 2026 error (SSL connection) on Fedora Core4

In some cases we have got the following error trying to access mySQL DB:

[root@localhost]#mysql
ERROR 2026 (HY000): SSL connection error

This was caused by SeLinux which run on that machine. The simpliest receipt is to switch SeLinux off.

To do that, go to /etc/selinux/config and change the line as follow:
SELINUX=disabled
Than save the file and reboot the system.