LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Merging two log files

Posted 11-14-2011 at 05:52 AM by zhjim

Today I needed to merge two log files in cronological together. Heres my way about.

copy the two files to one host. (scp file name@server:~userhome
get the hostname infront of each line. (sed -i s/^/hostname/g first_file; ...)
cat ./first_file ./second_file | sort -k 3 > ./new_log

-k in sort stands for key. In my turn the datetime was the third field.

Improvements:
Get some color into the diffrence hostsnames.
Member
Posted in Uncategorized
Views 96 Comments 0 zhjim is offline
Old

Script to create a modified xen domU

Posted 02-04-2010 at 04:06 AM by zhjim

Just for me and all that can use it. Heres a script I wrote to create a domU filesystem from a directory. All values are taken from the xen config script for the domU and are later sed'ed.

Code:
#!/bin/bash
if [ $# -ne 1 ]; then
        echo "Usage: $0 /path/to/domU_config " #/dev/name | /path/to/dir"
        exit -1
fi

CONF=$1
TARGET=$2
IMG=./new_strap

#HOSTNAME=$(grep "name" $CONF)
...
Member
Posted in Uncategorized
Views 483 Comments 0 zhjim is offline
Old

Apache2.2 ab with ssl

Posted 08-24-2009 at 04:54 AM by zhjim

For all of you who wonder why ab (a.k.a apachebenchmark) gives an error like this
Code:
SSL not compiled in; no https support
I finally found out how to enable ssl support in ab.

Here are two minimal configuration options for the httpd-2.2.13 from apache.org.

With working ssl-ab
Quote:
./configure --with-ssl --enable-ssl --with-mpm=prefork --prefix=/home/ase/non/install --with-mods-shared=most
Without working ssl-ab
Quote:
./configure --with-ssl
...
Member
Posted in Uncategorized
Views 1743 Comments 0 zhjim is offline
Old

Perl Skript to change the heading of an sql dump

Posted 08-11-2009 at 05:19 AM by zhjim

Needed to have a programm that would allow me to change the headers of a sql dump.
This is the first draft and far from perfect but does the job.
PHP Code:
#!/usr/bin/perl
use strict;

use 
Fcntl;
my $line;
my $go 10;
my $start;
my $end;

if ( $
#ARGV + 1 != 1 ) {
        
print 'Usage:  trial.pl  new_db_name' "\n";
        exit -
1;
}

my $db $ARGV[0];

open
...
Member
Posted in Uncategorized
Views 563 Comments 0 zhjim is offline

  



All times are GMT -5. The time now is 07:48 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration