25.12.2008

each func

  while ( my ($key, $value) = each(%hash) ) {
  print "$key => $value\n";
  }

23.12.2008

sub hup

sub hup {
my $self = shift;
 
 return $self->status() if kill('HUP', $self->__pid());

12.12.2008

proxy var

#proxy.sh
export http_proxy=http://host.com:port/
export ftp_proxy=http://host.com:port/
export no_proxy=.domain.com
export HTTP_PROXY=http://host.com:port/
export FTP_PROXY=http://host.com:port/

#proxy.csh
setenv http_proxy http://host.com:port/
setenv ftp_proxy http://host.com:port/
setenv no_proxy .domain.com
setenv HTTP_PROXY http://host.com:port/
setenv FTP_PROXY http://host.com:port/

02.12.2008

$PS1

[\u@\h \W]\$

01.12.2008

screenrc

vbell off
defscrollback 5000
hardstatus alwayslastline
hardstatus string '%{= kG}%-Lw%{= kW}%50> %n*%f %t%{= kG}%+Lw%< %{= kG}%-=%D %m/%d/%y | %C:%s %A | %1`%{-}'
screen -t main
screen -t maillog tail -f /var/log/maillog
screen -t messages tail -f /var/log/messages
screen -t vim vim
screen -t top top
select 0

&for bash

for i in $( ls ); do echo $i; done;

for (( c=1; c=$c ; c++ )) ; do echo "eat $c cats" ; done

for i in $(seq 0 5 20) ; do echo "eat $i cats" ; done

for i in {0..20} ; do echo "eat $i cats" ; done

for i in ./* ; do echo ${i}; done

&while perl

perl -e '$_=1;while ($_ <= 10) { print; $_++;}'

&while bash

i=1; while [ "$i" -le 3 ] ; do i=$(($i+1)); echo $i ; done