Thursday, March 1, 2012

What is DomainKeys?

— SkyHi @ Thursday, March 01, 2012
DomainKeys is an email authentication technology developed by Yahoo, and is primarily used as an additional anti-spam and anti-phishing method.

How DomainKeys works
  • Sending emails
    • The domain owner generates a public / private key pair to use for signing all outgoing messages (multiple key pairs are allowed). The public key is published in DNS, and the private key is made available to their DomainKey-enabled outbound email servers.
    • When each email is sent by an account within the domain, the DomainKey-enabled email server automatically uses the stored private key to generate a digital signature of the message. This signature is embedded as a header in the sent email, and the email is sent on to the target recipient's mail server.
  • Receiving emails
    • The DomainKeys-enabled receiving email server extracts the signature and claimed From: domain from the email headers and fetches the public key from DNS for the claimed From: domain.
    • The public key from DNS is then used by the receiving mail server to verify that the signature was generated by the matching private key. This proves that the email was indeed sent by, and with the permission of, the claimed sending From: domain and that its headers and content weren't altered during the transfer.
    • The receiving email server applies the local policies based on the results of the signature test. If the domain is verified and no other antispam tests catch it, the email can be delivered to the user's inbox. If the signature fails to verify, or there isn't one, the email can be dropped, flagged or quarantined.
How to check your mail server uses this technology correctly
Send an email to the following randomly generated email address:GOJCCCFFNKTQNHCAJQPH@dk.mailradar.com Once you have sent your message, click the "View Results" button below to see your message results. Please note that it may take a few minutes to receive the message.
 
 


REFERENCES
http://www.mailradar.com/domainkeys/

What is a glue record?

— SkyHi @ Thursday, March 01, 2012
A glue record in simplest terms is an IP address that is "glued" to a specific domain or subdomain in the registry. Glue records are most commonly needed for users that are trying to use name server addresses that are subdomains of the domain itself. To explain a little further: 

John has a domain registered named domain.com. John wants to set up his own name servers (DNS) using the addresses ns1.domain.com and ns2.domain.com. The problem with this is that because of the way that DNS works, every time someone tries to access domain.com, they will have to check with one of the subdomains (ns1.domain.com or ns2.domain.com) for the address which are both "under" the domain. Since you can't get to a subdomain before getting to the domain, and the domain is what we are looking for in the first place, we seem to be stuck. Let's personify the process for finding the correct address for a domain in the DNS lookup process:


Q: "I am trying to find domain.com. What is the IP address for the website domain.com?"
A: "I do not have the address. Check the name server for domain.com. You will find the address there."
Q: "Okay. What is the name server for domain.com?"
A: "ns1.domain.com"
Q: "Okay. What is the address for ns1.domain.com so I can check there?"
A: "I do not have the address. ns1.domain.com is a subdomain of domain.com. So check the name server for domain.com."
Q: "Okay.... What is the name server for domain.com?"
A: "ns1.domain.com"
Q: "You just said that. So you know the name of the name server but don't have the address?"
A: "Yes, only the name server has the address of the name server!"
Q: "So if only the name server knows the address for the name server, how am I supposed to get the address?!"   


The solution to this is to set up a glue record. A glue record will glue the IP address to the domain/subdomain so that the process is a bit more like:



Q: "I am trying to find domain.com. What is the IP address for the website domain.com?"
A: "I do not have the address. Check the name server for domain.com. You will find the address there."
Q: "Okay. What is the name server for domain.com?"
A: "ns1.domain.com(127.0.0.1)"   



This time the name came with an address since they were "glued" together! Now that's helpful!




This process may seem very technical but setting up a glue record in the 1&1 Control Panel is actually quite easy and may have already happened without you even knowing it. Any time a subdomain is created with "ns" at the beginning, a glue record is automatically created for this subdomain. Follow the next steps to get a better understanding:

Step 1:

Log in to the 1&1 Control Panel using your Customer ID OR domain name and your password

If you have only one package, you will land on the Administration page. If you have more than one package, select the package in question to reach its Administration page.

selectLinux.png
Step 2:

Click the Domains link from the Domains & Webspace panel.

selectDomains.png
Step 3:

Click the down arrow button next to New and select Create Subdomain.

newSubdomain1.png
Step 4:

Enter a subdomain that starts with "ns" such as ns1, ns2, etc. and select the appropriate domain from the drop-down box.
Click the OK button when finished to create the subdomain.

newSubdomain2.png
Step 5:

The subdomain should be set up within the next 15 minutes or so. The glue record will be applied to the subdomain since it starts with "ns" however since the glue record is a DNS record, it may take 24-48 hours until fully updated and recognized by all servers/computers on the Internet.

You must have at least two name server addresses. Repeat this process to create another subdomain that starts with "ns" such as ns2.

If you need to change the IP address that the subdomain points to, please reference How do I edit/change a domain's IP Address (A record)?


REFERENCE
http://faq.1and1.co.uk/domains/domain_admin/dns_settings/3.html

Wednesday, February 22, 2012

Why does my input type=text value get truncated?

— SkyHi @ Wednesday, February 22, 2012
When you insert values into textboxes dynamically, you have to remember the same rules that hold true for basic HTML. When you use a string, you must store it within quotes to prevent premature concatenation. :-) 

    <... value=<%=value%>> 

Becomes: 

    <... value="<%=value%>"> 

One thing you want to be careful of is embedded quotes. You might try using ' or " as the delimiter, and eliminating the other for possible entry (using client-side validation of course; the value is destroyed before you'd be able to validate for it on the server side). If you have to allow both ' and ", you could consider using the rarely used "back-apostrophe" (`). You can also try to user Server.HTMLEncode() on the value, before slipping it into the HTML element. 

If you do this: 

<... value='<%="foo's bar"%>'>

This evaluates to: 

<... value='foo's bar'>

And everything after 'foo' is ignored, because the browser interprets that as the end of the string. 


Solution:



; Logging Options


; Defines what classes of security alerts are logged to the syslog daemon.
; Logging of errors of the class S_MEMORY are always logged to syslog, no
; matter what this configuration says, because a corrupted heap could mean that
; the other logging options will malfunction during the logging process.
;suhosin.log.syslog =
; log in /var/log/messages
suhosin.log.syslog = 511    





; Defines the maximum number of variables that may be registered through a POST
; request.
;suhosin.post.max_vars = 200
suhosin.post.max_vars = 1000


; Defines the maximum number of variables that may be registered through the
; COOKIE, the URL or through a POST request. This setting is also an upper
; limit for the variable origin specific configuration directives.
;suhosin.request.max_vars = 200
suhosin.request.max_vars = 1000





REFERENCES
http://classicasp.aspfaq.com/forms/why-does-my-input-type-text-value-get-truncated.html
http://www.frihost.com/forums/vt-104933.html

Monday, February 20, 2012

Cloned Red Hat/CentOS/Scientific Linux Virtual Machines and “Device eth0 does not seem to be present” Message

— SkyHi @ Monday, February 20, 2012
Recently I was preparing some new virtual machines in VMware running Scientific Linux 6.  I encountered some difficulty with the virtual network interface after preparing clones of the machines.  In particular I was unable to get the virtual NIC on the newly cloned machine to be recognized as a valid interface.  Upon further investigation the NIC on the newly cloned machines was being registered as “eth1″.  We can check the currently registered “eth” devices here:

[root@sl6 ~]# ls /sys/class/net
eth1  lo  sit0

As it turns out there is a device manager for the Linux kernel named “udev” which remembers the settings from the NIC of the virtual machine before it was cloned.  I was not familiar with udev because it was not installed in my previous Linux VM install, which were mainly CentOS 5.
Since the hardware address of the network interface changes as part of the clone, the system sees the NIC after the clone as “new” and assigns it to eth1.  The simple way to move the interface back to eth0 is to edit the strings beginning with “SUBSYSTEM” in udev’s network persistence file.
Start off by removing the first “SUBSYSTEM” entry that represents the “old” eth0 interface.  Then edit the second “SUBSYSTEM” entry, changing the “NAME” parameter from “eth1″ to “eth0″.  Of course your config may vary from mine.  Keep in mind that the “SUBSYSTEM” line may be wrapped in the text below.
Old file:

[root@sl6 ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:21", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

New file:

[root@sl6 ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:87:00:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Now verify that you have a properly configured network config file, the example below is for Red Hat/CentOS/Scientific Linux:

[root@sl6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:50:56:87:00:25"
IPV6INIT="no"
IPV6_AUTOCONF="no"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR="192.168.10.125"
NETMASK="255.255.255.0"
NETWORK="192.168.10.0"
BROADCAST="192.168.10.255"
Now reboot the system and the NIC should now be registered as eth0!






REFERENCES
http://aaronwalrath.wordpress.com/2011/02/26/cloned-red-hatcentosscientific-linux-virtual-machines-and-device-eth0-does-not-seem-to-be-present-message/

Movgrab : Cool Command Line Tool for Downloading Video Clips and Movie

— SkyHi @ Monday, February 20, 2012
Movgrab is a command line tool that allow to downloading video clips from websites video streaming such as YouTube, Vimeo, Blip.tv,Daily Motion, Break.com, Liveleak and More ..



Movegrab has no dependencies with another program or library, everything that’s needed should be there in the tar.gz package. Movgrab can connect through an HTTP proxy, can output the download to stdout for piping into another program, and can fork into the background to free up the console. When Movgrab forked into the background, its progress can still be seen in a ps list.

Here’s highlight features of Movgrab:

  • HTTP proxy support
  • Fork into background (use option “-b” )
  • Write the download to std-out so you can easily play the video in an external application
  • Lets you pick the preferred video/audio formats for sites that offer more than one
  • Generic downloader which means Movgrab might be able to download videos from other websites not listed as supported
  • Can resume downloads (use option “-r” – only works when writing a single file)
  • Written in straight C so it has no dependencies

Full list of supported websites:

  • YouTube
  • Metacafe
  • Dailymotion
  • Vimeo
  • Break.com
  • eHow
  • 5min.com
  • vbox7
  • blip.tv
  • Ted
  • MyVideo
  • ClipShack
  • MyTopClip
  • RedBalcony
  • Mobando
  • Yale University
  • Princeton University
  • Reuters
  • LiveLeak
  • Academic Earth
  • Photobucket
  • VideoEmo
  • VideosFacebook
  • Aljazeera
  • Mefeedia
  • IViewTube
  • Washington Post
  • CBS News
  • Euro News
  • MetaTube
  • MotionFeeds
  • Escapist
  • Guardian
  • RedOrbit
  • Sciive
  • Izlese
  • uctv.tv
  • royalsociety.tv
  • British Academy
  • Kitp
  • Dotsub
  • Astronomy.com
  • Teachertube.com
  • Discovery
  • Bloomberg.com

How to Install Movgrab in Ubuntu 11.10/Linux Mint 12

To install Movgrab in Ubuntu 11.10/Linux Mint 12,Open terminal and run the following commands:
Download source movgrab latest version from official site developer of movgrab
Extract and install source movgrab:
sudo tar -xzvf movgrab-1.1.8.tgz
cd movgrab-1.1.8
./configure
make 
sudo make install
you can also install movgrab via PPA but it still version 1.1.7, for Ubuntu/Linux Mint Users install Movgrab by using the main WebUpd8 PPA:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install movgrab

Usage Movgrab

To download a video using the default options:
movgrab [Video URL]
Example:
movgrab http://www.youtube.com/watch?v=YNKDIlu7w98
To Download video with specify the filename, use Option “- o”, Example:
movgrab -o cartoon.mp4 http://www.youtube.com/watch?v=YNKDIlu7w98
To be able to resume a video download, use option “-r”, Example:
movgrab -r http://www.youtube.com/watch?v=YNKDIlu7w98
If you want to download video with specify the video format and quality, firstly you’ll need to get a list of supported video formats. Example:
movgrab -T http://www.youtube.com/watch?v=YNKDIlu7w98
Output:
Formats available for this Movie: webm:640x360 flv-h264:640x360 mp4:480x360 flv:400x240
Selected format item:webm:640x360
Now you can download video with specify format and resolution:
movgrab -f mp4:480x360 http://www.youtube.com/watch?v=YNKDIlu7w98
you want to watch a video using mplayer, without having to download video firstly – Movgrab can write the download to std-out:
movgrab -o - [URL] | mplayer -
Example :
movgrab -o - http://www.youtube.com/watch?v=YNKDIlu7w98 | mplayer -
For more help and option, run movgrab in terminal
Movgrab developed by Colum’s Code, for more info about release movgrab you can visit Colum’s Code Webpage

REFERENCES