kill -9 `ps -ef | grep /libexec/abrt | grep -v grep | awk '{print $2}'`
kill all processes that have "/libexec/abrt" in their run path. Do not kill grep command since it will be alos included into the output.
Friday, December 28, 2012
Saturday, December 15, 2012
Linux: Remove all JPG files older than 5 days
find . -name *.jpg -mtime +5 -print -exec rm {} \;
# starting from the current directory
# also print the file path
# note spaces around rm and {}
# starting from the current directory
# also print the file path
# note spaces around rm and {}
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
#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
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'
Tuesday, November 06, 2012
Remove or Add MySQL user
Removing a user
-- allow user to connect to the server
mysql> grant usage on *.* to amarokuser@localhost identified by 'amarokpasswd';
-- allow user to connect to the server
mysql> grant all privileges on amarokdb.* to amarokuser@localhost ;
-- another option (run mysql client as root, enter on command line)
-- allows access from any IP for 'user'
GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password';
-- test if everything is OK now
mysql -u amarokuser -p'amarokpasswd' amarokdb
-- first, let's see if the user is listed
mysql> select * from mysql.user;
-- now let's kill the guy
mysql> show grants for 'idiot'@'localhost';
mysql> revoke all privileges, grant option from 'idiot'@'localhost'; mysql> drop user 'idiot'@'localhost';
Adding a user
-- allow user to connect to the server
mysql> grant usage on *.* to amarokuser@localhost identified by 'amarokpasswd';
-- allow user to connect to the server
mysql> grant all privileges on amarokdb.* to amarokuser@localhost ;
-- another option (run mysql client as root, enter on command line)
-- allows access from any IP for 'user'
GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password';
-- test if everything is OK now
mysql -u amarokuser -p'amarokpasswd' amarokdb
Tuesday, October 23, 2012
Finding the biggest MySQL tables
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
+-------------------------------------+--------+--------+--------+------------+---------+
| concat(table_schema,'.',table_name) | rows | data | idx | total_size | idxfrac |
+-------------------------------------+--------+--------+--------+------------+---------+
| art87.link_out87 | 37.25M | 14.83G | 14.17G | 29.00G | 0.96 |
| art87.article87 | 12.67M | 15.83G | 4.79G | 20.62G | 0.30 |
| art116.article116 | 10.49M | 12.52G | 3.65G | 16.18G | 0.29 |
| art84.article84 | 10.10M | 10.11G | 3.59G | 13.70G | 0.35 |
| art104.link_out104 | 23.66M | 6.63G | 6.55G | 13.18G | 0.99 |
| art118.article118 | 7.06M | 10.49G | 2.68G | 13.17G | 0.26 |
| art106.article106 | 9.86M | 10.19G | 2.76G | 12.95G | 0.27 |
| art85.article85 | 6.20M | 9.82G | 2.51G | 12.33G | 0.26 |
| art91.article91 | 8.66M | 9.17G | 2.66G | 11.83G | 0.29 |
| art94.article94 | 5.21M | 10.10G | 1.69G | 11.79G | 0.17 |
+-------------------------------------+--------+--------+--------+------------+---------+
10 rows in set (2 min 29.19 sec)
http://www.mysqlperformanceblog.com/2008/02/04/finding-out-largest-tables-on-mysql-server/
Sunday, October 07, 2012
AWS Glacier Java Command Line Tool for PHP, Python, Ruby etc
For those of us who want to access Amazon Web Services Glacier from various environments and with a variety of programming languages I have developed an open-source (Apache 2 license) java command line app which operates AWS Glacier Vaults and Archives. The app is mostly based on AWS Java SDK samples from AWS documentation, e.g. http://docs.amazonwebservices.com/amazonglacier/latest/dev/creating-vaults-sdk-java.html
This project is hosted with Google Code: http://code.google.com/p/aws-glacier-app/
How to use the app: http://code.google.com/p/aws-glacier-app/wiki/Usage
And the ZIP with all the JARs is here: http://code.google.com/p/aws-glacier-app/downloads/list
This project is hosted with Google Code: http://code.google.com/p/aws-glacier-app/
How to use the app: http://code.google.com/p/aws-glacier-app/wiki/Usage
And the ZIP with all the JARs is here: http://code.google.com/p/aws-glacier-app/downloads/list
Labels:
amazon web services,
AWS,
Glacier,
Java,
open source,
php,
Python,
ruby
Thursday, August 30, 2012
Installing RIAK on RedHat Linux CentOS 6
# The official guide is here: http://wiki.basho.com/Installing-on-RHEL-and-CentOS.html#From-source
# get superuser permissions: login as root
# for CentOS 6 (64-bit) and RIAK 1.2.0.1 -
wget http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/CURRENT/rhel/6/riak-1.2.0-1.el6.x86_64.rpm
sudo rpm -Uvh riak-1.2.0-1.el6.x86_64.rpm
# next, edit config file adding external server' IP next to internal 127.0.0.1 wherever appropriate
# For HTTP / HTTPS the lines should look like
#
# {http, [ {"127.0.0.1", 8098 }, {"222.222.8.155", 8098} ]},
# and
# {https, [{ "127.0.0.1", 8098 }, {"222.222.8.155", 8098}]},
vi /etc/riak/app.config
#next, start RIAK instance
riak start
# to test your install put some JPEG file into RIAK
curl -X PUT HTTP://127.0.0.1:8098/riak/images/1.jpg -H "Content-type: image/jpeg" --data-binary @./u.jpg
# check you can see from outside of RIAK machine by using a browser with link to
http://[external-IP-or-domain-for-RIAK-machine]:8098/riak/images.1.jpg
Labels:
centos,
distributed db,
key value database,
linux,
open source,
red hat,
RIAK
Subscribe to:
Posts (Atom)