As you know CentOS 5 EOL is (End-Of-Life) from March 31 2017. Which leads to the following very interesting problem:

# yum update
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/extras/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: extras

 

The problem is that short lists of CentOS mirrors 5 already kicking in and attempt to directly get content obtained after refusal:

# curl 'http://mirrorlist.centos.org/?release=5&arch=i386&repo=os'
Invalid release

 

In general overall the most prudent idea to reinstall the tin with a normal distribution that supports working distributive upgrade. Unfortunately mine is not the case and it does not stand as an option on the table. So we had to play a little gypsy scheme – begin to use Vault mirror. At the moment completely clear creature and sanity know, I will not receive any updates that is not the aim of the exercise, and just want to have working with yum to install package that I need. For this purpose commented out all mirrorlist variables and add baseurl in /etc/yum.repos.d/CentOS-Base.repo. Finally we get yum repo on the type of

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://vault.centos.org/5.11/os/i386/
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/5.11/updates/i386/
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.11/extras/i386/
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Finally play a yum clean all && yum update. If everything ended without an error then we successfully completed the scheme and we can safely install outdated packages.

 

I'll have to make a bootable USB on OS X. To my great surprise, I found that the speed of copying with DD - otvratitelno low ~600KB/s 😕 . After a short search I found, what should I use rdiskX instead diskX. The idea is that rdisk is a synonym for raw device. Well from here I added one r blokovoe device to that of coper ISO then found that the speed is below ~150-200KB/s 😡 . Already mystics is complete and the previous information was confirmed from different sources!!!! Everything fell into place after I bs Directive.

bs=n Set both input and output block size to n bytes, superseding the ibs and obs operands. If no conversion values other than swab rearrange, notrunc or sync are specified, then
each input block is copied to the output as a single block without any aggregation of short blocks.

Once I put 1M size bs achieved speeds are expecting it to USB-me. Then tested the difference between disk and rdisk definitely the difference was about 10-12 once in speed in favor of rdisk. Very cultural way to control the speed and progress of dd can be achieved in the following Convair

sudo dd if=Downloads/path.to.iso bs=1M | pv | sudo dd of=/dev/rdisk2 bs=1M

2 rapid RAID 5 Council

  1. If you have a RAID 5 keep disks in the system MBR instead of the GPT – at least give me +10 – +15% difference
  2. Must set the/sys/block/md0/md/stripe_cache_size as the default is too small. Here are the values according to depend on me 32768 give the decent result

From around 2 weeks php 5.3 Enter the story slowly but surely. 11 announced the end of its maintenance and it will be played just security patches for 1 year. In General, PHP 5.4 passes in stages and old stable PHP 5.5 becomes stable, which is kind of fun because you still part of the additions and plugins of php do not work completely correctly but version 5.5 is quite new so I will refrain from migration to her.

So let's say for my migration to 5.4 by 5.3. Previously I had posted the information for obsolete features, those that have changed my entire personality and those who no longer has to maintain to have no dramas on both sides whether it is going to start or not 😉 So I chose this morning hour for start of migration around 7 as it became, that there is minimal pain during migration if you don't go smoothly. To my immense surprise everything went more smoothly – you have compiled PHP 5.4.17 I started apache and Oh heavens, it's all there. A quick glance through logs doesn't roar of depricated or unknown functions – Apparently, the boys have done their job well. Then I only have to prekompiliram and additions that are compiled with the old API as APC, RAR etc.. A second restart and all asleep. Separately, expect performance improvements because everywhere people pointing big toe the trays that shows how PHP 5.4 consumes less RAM and executes scripts faster.

/dev/random

I had a pretty interesting teaser teaser – I had to create a huge number of randomly generated passwords as I had a requirement to have a fixed length to contain large lower-case letters and numbers, normal stuff. Sounds easy right and basically is. I used /dev/urandom for osnonvata generation and then with a short conveyor belt been filtering to the desired number of characters and character types that must be used. As long as I'm the soft soap in the main script is the conveyor belt :

cat /dev/urandom | tr -dc '[:alnum:]' | fold -w 20| head -n 1

So let's look a little more in detail what is happening here. Take the exit of the cat/dev/urandom. Then filter it to show only small, large letters and numbers. Then fold limit the length of the strings to the US number. Finally throttle to show only 1 the entire line of output. Basically as easy as 1-2-3. If you want to increase the complexity of the password and the specialenite characters in regulâârni expression of the tr can be used :graph: or :print: instead of :alnum:, which include all the characters with or without space.

cat /dev/urandom | tr -dc '[:graph:]' | fold -w 20 | head -n 1
Enhanced by Zemanta