Tuesday, January 27, 2009

White Ball In Cricket

Block access to Gmail Gtalk but not registering with Squid

few days ago I came across the following problem setting up a Squid proxy (not transparent) in which would only allow access to emails from Gmail, not the other applications such as chat, I did it the following way and it worked if someone has a way better than what I posted;)

First of all add the following lines in squid.conf acl
cl_congmail src "/ etc/squid3/acl/cl_congmail.txt" acl gmail
url_regex "/ etc/squid3 / acl / gmail.txt "acl urlmalos
url_regex" / etc/squid3/acl/urlmalos.txt "

http_access allow http_access deny urlmalos
gmail cl_congmail

- file cl_congmail.txt ips are all we want have gmail for example:
192.168.1.1 192.168.1.2


- In the file put the following
gmail.txt
.
gmail.com. mail.google.com
. google.com: 443

- In the file if you want to block Gtalk urlmalos put the following url
^ http://chatenabled.mail.google.com

Monday, January 19, 2009

6days Delayed,,,am I Pregnant

events function mail () in PHP

Reviewing by blog I read daily, I found an article from the improvements in PHP 5.3.0 that is about to exit. These two facilities are added to the function mail () very useful for system administrators.

One of the most common problems in a hosting server with many domains is to find who is abusing the function mail () and is sending emails, a task from the 5.3.0 version of PHP will be more than simple, and adds two new configuration parameters.

The first is the mail.add_x_header that you enable it from the php.ini or from a php_value, adds a header to the mail X-PHP-Originating-Script the name of the script that is generating the UID mail and it is running. Very useful if we have a return of mail to be sent.

The other parameter, over there a bit more useful, is mail.log that allows us to enable logging to send the emails, saving a local file the script that call the function mail () and some additional fields as recipients of the mail.

With these two new facilities will greatly reduce the time spent on tracking all of that junk mail messages are triggered by exploiting vulnerabilities in some sites.

The good thing is that looking for a little more information about these improvements is that the fall to Blog Alshanetsky Ilia (the developer of this functionality) can find a patch that you can apply to current versions of PHP to get these features, so no need to wait long to start using these features.
Today

Wednesday, January 7, 2009

Enter Name Of Driver For This Usb Device Wince

An old Zen story

chatting with a friend reminded me of an old Zen story that once read, and that beyond its philosophical about the cycles, life, death and other:

After tea, while a student was washing his cup zen and his teacher, the teacher's cup slipped from his hands, fell down and broke. The student became very upset and he communicated to his companions, far to downplay the matter, scared you most telling:

"The cup has broken, was revered by the teacher. It was very old and very valuable"

The student did not know how to tell his teacher without being punished, so did you go to your teacher and say the following:

"Master, why do we die?"

To which the teacher replied,

"It's natural, life after death comes"

The disciple said:

"But Master, do not can anything last forever?"

to what the teacher said again

"Everything has its cycle, things start and then end. All that lives dies"

At that hour the disciple took the pieces of the broken cup and showed the teacher saying

"Master, the cup, his time had come"

I always amused by how the student knew the answer, asked the question so that the teacher was ready to respond to what was coming, so ... who was the student whom the teacher?

Monday, January 5, 2009

Decidual Bleeding And Pregnancy Test

Executing commands on multiple servers

One of the problems I have encountered in recent weeks is to work in a systematic way the mime command running on multiple servers (just under 200 servers).

Because this is more than annoying (especially the routine), then remembering the old command expect "I started looking for a script to automate some of this type of task.

This is how I met with the script repository of nixCraft, where rescue a nice script to enter an ssh server from the key parameter, the server and the command to execute.

After some modifications to the script remained the same thing more or less:

 # / usr / bin / expect-f 

# # This program is free software; You Can redistribute it and / or modify
# it under the Terms of the GNU General Public License as published by
# the Free Software Foundation; Either version 2, or (at your option) # Any Later
version.

# # For use:
#. / Server command arg1 sshlogin.exp password

# # ---------------------------- ------------------------------------------
# Basado en http://bash.cyberciti.biz/security/expect-ssh-login-script/
# ----------------------------------------------------------------------

# set Variables
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
set timeout -1

# now connect to remote UNIX box (ipaddr) with given script to execute
spawn -noecho ssh -o "ConnectTimeout 10" root@$ipaddr $scriptname $arg1
match_max 100000

expect {
# first time
"*continue connecting*" { send -- "yes\r"; exp_continue }

# for
key passphase "* passphrase *" {send - "$ password \\ r";}
exp_continue
# for password
"* assword *" {send - "$ password \\ r";}
exp_continue
# for timeout
timeout {exit}}



With this script you can eg know how long it takes on one of our servers:

. / sshlogin.exp  la_clave   el_server  
uptime
With this, we have only solved half the problem, which is to run the command without having to wait until we ask the key. But the second part is the easiest.
We
generating a file from the servers and their keys, something like:

 servidor_1: clave_1 
Server_2: clave_2
servidor_3: clave_3

And with a simple script like this, we traverse the list server and run the command key and all of them:

 # / bin / bash mkdir-p log 

for line in `cat` server.lst

do server = `echo $ line > Log / $ server done




With this you can download a script from a server and run on the remote server and save the result on the local machine.