How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

February 17, 2014

Compare two version of php.ini after move server

Filed under: Linux — Tags: , , , — admin @ 10:48 am

Well, after install and move one server to other one problem is to keep same information in php.ini . However I don’t think is ok just to copy and replace them, so a compare script should be run.

So I found one , and improve it a little.
cat comparephpini.php
$val ) {
if( $val == $c2[$key] ) continue;
echo $key.': '.$c1[$key].' // '.$c2[$key]."\n";
}

foreach( $c2 as $key => $val ) {
if( $val == $c1[$key] ) continue;
echo $key.': '.$c2[$key].' // '.$c1[$key]."\n";
}

January 29, 2014

How to display HTTP Headers with tcpdump

Filed under: Linux — Tags: , , , , — admin @ 9:19 pm

Well today I was needing to see some packages that arrived on apache. In order to see I have to use tcpdump, but you will only some short information if you are using basic.
In order to see HTTP header you have to use something like this:
tcpdump -n -vvvs 1024 -l -A host matrafox.info

If you want to see more information you have to increase the size, something like this
tcpdump -n -vvvs 1500-l -A host matrafox.info

January 20, 2014

centos 6 and php mcrypt

Filed under: Linux — Tags: , , , — admin @ 3:27 pm

Well all know that this packet is not included into centos distro . To install and use php-mcrypt you have to install and use epel repository.

So here we go

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum update
yum install php-mcrypt*

January 17, 2014

Mapping Linux kernel ATA errors to a device

Filed under: Linux — Tags: , , , , , , , — admin @ 10:05 am

So .. my problem is that I see some error into dmesg log about ata2 , however I don’t know what hard drive is mapped to that ata. So , how can we find this ?

[16380082.599294] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[16380082.599340] ata2.00: failed command: FLUSH CACHE EXT
[16380082.599369] ata2.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0
[16380082.599370] res 40/00:00:80:2b:0a/00:00:70:00:00/40 Emask 0x4 (timeout)
[16380082.599435] ata2.00: status: { DRDY }
[16380082.599461] ata2: hard resetting link
[16380082.919117] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[16380082.921248] ata2.00: configured for UDMA/133
[16380082.921279] ata2: EH complete

Well to find out we have to look into /sys file-system :

ls -l /sys/block/sd{a,b}


lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sdb -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb

To get that ID, Instead of looking into the target structure, we’re looking into the scsi_host structure. It has a directory for the host and in it a file unique_id. That’s the ID appended to ata.

for host in 0 1 ; do echo -n host${host}:; cat /sys/devices/pci0000:00/0000:00:1f.2/host${host}/scsi_host/host${host}/unique_id; done


host0:1
host1:2

So the answer is on ata2 I have sdb mounted.

Also I found this php code on internet

January 13, 2014

Centos 6 ffmpeg libopencore amrnb dev centos

Filed under: Linux — Tags: , , — admin @ 5:48 pm

Well today I was trying to install ffmpeg on centos 6.5.
The problem was that i was having this problem .
ERROR: libopencore_amrnb not found

I was trying yum search *amrnb* and yum search libopencore , but without results.

The solution is
yum install amrnb-devel amrwb-devel
You have to have dag repository installed.

« Newer PostsOlder Posts »

Powered by WordPress