Tin's Journey

December 9, 2014

[AWK] Printing a line following a matching pattern

Filed under: Day to day sys administration — Tags: — Tin' @ 3:45 pm

The following idioms describe how to select a range of records given a specific pattern to match:
Print all records from some pattern:

awk '/pattern/{found=1}f' file

Print all records after some pattern:

awk 'found;/pattern/{found=1}' file

Print the Nth record after some pattern:

awk 'count && !--count;/pattern/{count=N}' file

Print every record except the Nth record after some pattern:

awk 'count && !--count{next}/pattern/{count=N}1' file

Print the N records after some pattern:

awk 'count && count--;/pattern/{count=N}' file

Print every record except the N records after some pattern:

awk 'count && count--{next}/pattern/{count=N}1' file

Print the N records from some pattern:

awk '/pattern/{count=N}count &&count--' file

November 18, 2014

iDRAC 7 CheatSheet

Filed under: Day to day sys administration — Tags: , , — Tin' @ 3:11 pm

# Get all iDRAC settings in a file

racadm get -f config.txt

# Set password for root user

racadm set iDRAC.Users.2.Password "password"

# List all ssh key for root user

racadm sshpkauth -i 2 -v -k all

(more…)

April 29, 2014

Deb-multimedia mirror updated

Filed under: deb-multimedia — Tags: , , , , — Tin' @ 8:15 am

As for Debian and deb-multimedia.org, ia64 packages have been removed from testing and unstable.
As also sparc packages from testing.

January 14, 2014

Misc tips on Linux Native Multipath

Filed under: Day to day sys administration — Tin' @ 12:51 pm

After new LUNs addition

Restart multipathd daemon

/etc/init.d/multipathd restart

Then check that all your LUNs are displayed and there is no orphans

multipathd -k"show maps"

You can also see how are your paths

multipathd -k"show paths"

For more information about multipathd command

multipathd -k"help"

(more…)

January 7, 2014

MariaDB in an openSVC service on RHEL

Filed under: Day to day sys administration — Tags: , , — Tin' @ 11:40 am

Ever wonder how to install MariaDB rpm in a dedicated openSVC service, with the possibility to switch the service without installation everything in the system directory ?
Just follow the this simple how-to

SVCNAME=UNXTSTDB02

First of all create your openSVC service with the 3 following filesystem
* /$SVCNAME/mysql (500M should be enought for binaries, need more for mysql logs)
* /$SVCNAME/mysqldata (depends on the database size)
* /$SVCNAME/mysqldump (depends on the dump size)

Create misc directory

mkdir -p /$SVCNAME/mysql/{var/log,var/run,var/lib/rpm,startup}

Install MariaDB server and client binairies

(more…)

September 18, 2013

VIM : Removing empty line

Filed under: Day to day sys administration — Tin' @ 12:47 pm

As I’m always googling for this command I just post it here so I won’t need to search for it again.

:g/^$/d

:g will execute a command on lines which match a regex. The regex is ^$(blank line) and the command is :d

August 6, 2013

Add Raid licensekey to a HP Smart Array P421

Filed under: Day to day sys administration — Tin' @ 7:54 am

For a mass storage application we had to use HP smart array Raid 6 functionality. Usually we bought P812 card which come directly with the Raid 6 features. But those new server I didn’t check the quotation and our supplier shipped us a Smart Array P421 which required the Extend Pack to work with Raid 6.
So after ordering it and going through the various HP web site in order to get my license key, here’s how to add it using the CLI.

(more…)

May 17, 2013

deb-multimedia mirror is ready for Wheezy

Filed under: deb-multimedia — Tin' @ 10:05 am

Following release of the new Debian 7.0 “Squeeze”, deb-multimedia mirror on Gnali has been updated.

sid -> unstable
wheezy -> stable
stable
   |- binary-amd64
   |- binary-armel
   |- binary-i386
   |- binary-ia64
   |- binary-kfreebsd-i386
   |- binary-mipsel
   |- binary-powerpc
   |- binary-sparc
   |- source
testing
unstable
jessie -> testing

Thanks again to Christian Marillat for his awesome work !

January 16, 2013

Delete Clariion LUNZ pseudo devices

Filed under: Day to day sys administration — Tin' @ 1:48 pm

Here’s a quick loop to delete Clariion LUNZ pseudo devices to prevent process to submit I/Os, which will never satisfied.

Really useful, when a new Clariion Disk Array is connected to your server

for i in $(ls /sys/class/scsi_device/)
do
    grep -q LUNZ /sys/class/scsi_device/$i/device/model && {
        echo deleting bdev $i
        echo 1 > "/sys/class/scsi_device/$i/device/delete"
    }
done

May 12, 2012

debian-multimedia is now deb-multimedia

Filed under: deb-multimedia — Tin' @ 12:05 pm

Christian Marillat, who’s well known for packaging multimedia application for debian, has change his domain name from debian-multimedia.org to deb-multimedia.org.

Hi,

debian-multimedia.org is now deb-multimedia.org

All services are working (see below). If you intent to change the path
in the mirror URL, tell me I’ll update my mirors page.

,—-
| rsync://www.deb-multimedia.org/deb
| http://www.deb-multimedia.org
| ftp://www.deb-multimedia.org
`—-

Christian

So in order to be compliante with him, Gnali.org is changing its mirror site to deb-mutimedia.gnali.org. Please update your apt source.list file. Old domain name will be still available for few weeks.

Older Posts »

Powered by WordPress

QR Code Business Card