section_logo

Give me your IP

25-02-2009 at 20:08:50 | no comments

When you need to give support to a computer user the best way is to create a remote connection to his computer.

I usually use vnc, but even having it installed on the final user, it could be so hard to explain how to find out the IP to create the connection.

...Close to the clock in the bottom right it should be an VNC icon, please put the mouse over for a while and they'll appear some numbers...
...Ok go to the Start menu, click "Run" and after write "cmd" in the textbox. It will appear a black screen, type "ipconfig" and click enter, now copy the numbers...

It's easy to imagine how people with low level in computers could be lost when you ask them to do those tasks.

So I just wanted to create a page where you could simply watch your IP without advertisement or funny stuff that could disturb the user. It's just a simple $_SERVER['REMOTE_ADDR'].

But many times I need to help my parents throw messenger and I just wanted to make it even easier for them so I just created a simple page where you can just copy a generated URL and paste to them.

They'll click and it will appear on their screen just the text "OK!", after that you could click on "Get the IP!" button (AJAX Coming soon :)) and you'll get their IP address.

Simple but quite effective and effortless :)

You can see and use it here

25-02-2009 at 20:08:50 | no comments

Signs

23-02-2009 at 19:11:40 | 1 comment
Really nice short film about communication and love :)

23-02-2009 at 19:11:40 | 1 comment

Easy way to send mails with attachments on Linux

22-01-2009 at 19:33:13 | 1 comment

At job usually I need to create scripts to send mail with logs for example while creating a backup. After looking for some email clients I found Mutt that looked really easy to use and to install. First of all you should now that Mutt it's a Mail User Agent (MUA) it means you should have already one Mail transfer agent (MTA) installed correctly (To let Mutt use the sendmail command). So there we go..., first we install like usually:

$ sudo apt-get install mutt

The most configuration changes that we would make is to change the default mail to show while sending the mails, as by default it will show the name of our server. This can be edit in the file /etc/mutt/Muttrc:

$ sudo nano /etc/mutt/Muttrc

And we add the following lines:

set realname="Username to show"
set from="username@host"
set use_from=yes

If you want to use this service with different users in the same server, you should create a copy of the configuration file for each user as following:

$ cp /etc/mutt/Muttrc ~/.muttrc

We're ready to send our first test:

mutt -s "Test mail" -a /srv/test.tgz destination@testmail.com < /tmp/mailmessage.txt

If everything works good we can start to use it into our bash scripts for monitoring tasks such as backups. Here a small piece of script that I use in my backups:

destMail=destinationMail@destinationDomain.com

attachment=/srv/scripts/backup.log

dateFormat=$(date +"%a, %e/%m/%Y %T")
subject="Backup server ($dateFormat)"

mailcontent=$(cat < /srv/scripts/msg.tmp
echo >> /srv/scripts/msg.tmp

mutt -s "$subject" -a "$attachment" "$destMail" < /srv/scripts/msg.tmp
rm /srv/scripts/msg.tmp
22-01-2009 at 19:33:13 | 1 comment