How to Get all attributes of an element using jQuery
by Unknown in html5 , javascript 0
Mobile development is not an easy job for a developer who doesn’t know about the latest technologies, updates and trends that’s why mobile development is a stressful job. Major challenges a mobile developer faces are screen resolution, cross browser compatibility.
We know many of these issues have been solved as the mobile
development industry is growing up. Now, we can see mobile websites with
beautiful layouts are being developed. These mobile websites also have
touch screen functionality that is developed with the help of different
frameworks to work on tablets and smartphones.
This is How to Fix OpenSSL Heartbleed for Server admin
Over the past few days, we have received an overwhelming number of
questions about the OpenSSL Heartbleed bug and how cPanel system
administrators should be handling this.
First of all, if you haven’t read Codenomicon’s write-up on the bug, which thoroughly explains what it is, you should look visit heartbleed.com.
Because their website already covers just about everything you need to
know, I don’t feel the need to rehash all the nitty-gritty details here.
I’m only going to address how you, a cPanel administrator, should
address this on your server.
Only CentOS 6.5 is vulnerable to this bug. Obviously this affects
other OS’s as well, but as a cPanel administrator you’re only dealing
with CentOS (and perhaps FreeBSD). If you use a version of CentOS older
than 6.5, read no further – you’re not affected and can rest easy.
You can test whether you’re vulnerable by using this tool against a website on your server that has an SSL certificate installed.
To clear this up real quick: OpenSSL is a vendor-supplied package that, in your case, is provided by CentOS. It is not supplied by cPanel,
so there’s no point in asking them to “fix” this. There is nothing for
them to fix. However, if you have system package upgrades enabled for
cpupdate, and cPanel updates run automatically on your server, chances
are the OpenSSL updates have already been installed. To configure your
cPanel update settings, check out this link, or go to WHM -> Update Preferences.
Check to see if you’re running the latest version as so:
root@server [~]# rpm -qa |grep -i opensslAt this point you’re looking for version 1.0.1e or newer (at the time of this writing, 1.0.1e is the latest). This update does not necessarily fix the bug in question, but rather disables the TLS heartbeat extensions that are vulnerable. A later version will likely fix the problem altogether, but such is not available yet because RHEL has not released a fix.
openssl-1.0.1e-16.el6_5.7.x86_64
openssl-devel-1.0.1e-16.el6_5.7.x86_64
lsof -n | grep ssl | grep DEL | awk ‘{print $1}’ | sort | uniqOR REBOOT for quickest way
openssl
commands that they would like you to use, you can generate your new SSL CSR by typing something like this. Again, add sudo
if you are not root:openssl req -new -newkey rsa:2048 -nodes -keyout hostname.key -out hostname.csrYou will need to copy your generated CSR into your provider's web interface after generation in order to rekey your server. You will then need to download the new certificate from the web interface.
/etc/ssl/certs
while others may be kept in locations provided by your web server.SSLEngine on
SSLCertificateFile /path/to/your_domain.crt
SSLCertificateKeyFile /path/to/your_key.key
SSLCertificateChainFile /path/to/CA.crt
These may look different, but they should point you in the correct direction to find your SSL certificate location.server {
. . .
ssl_certificate /path/to/your_domain.crt;
ssl_certificate_key /path/to/your_key.key;
. . .
}
Another option is to check your distribution's documentation or check
your server's filesystem to find out where your certificates are
stored.sudo service apache2 restart # For Apache web server
sudo service nginx restart # For Nginx web server
On CentOS or Fedora, you can restart by typing:sudo service httpd restart # For Apache web server
sudo service nginx restart # For Nginx web server
For Arch Linux you should use something like:sudo systemctl restart httpd.service
sudo systemctl restart nginx.service
This should allow your web server to pick up your new certificate changes.
<?php include("cssparser.php"); $css = new cssparser(); $css->ParseStr("b {font-weight: bold; color: #777777;} b.test{text-decoration: underline;}"); echo $css->Get("b","color"); // returns #777777 echo $css->Get("b.test","color");// returns #777777 echo $css->Get(".test","color"); // returns an empty string ?>
It's working on PHP4, PHP5
function is_utf8($str) {
$c=0; $b=0;
$bits=0;
$len=strlen($str);
for($i=0; $i<$len; $i++){
$c=ord($str[$i]);
if($c > 128){
if(($c >= 254)) return false;
elseif($c >= 252) $bits=6;
elseif($c >= 248) $bits=5;
elseif($c >= 240) $bits=4;
elseif($c >= 224) $bits=3;
elseif($c >= 192) $bits=2;
else return false;
if(($i+$bits) > $len) return false;
while($bits > 1){
$i++;
$b=ord($str[$i]);
if($b < 128 || $b > 191) return false;
$bits--;
}
}
}
return true;
}