Skip to content

Instantly share code, notes, and snippets.

View typo_suggestion.php
function suggestion(array $words, $word)
{
$lev = [];
foreach ($words as $w) {
$lev[$w] = levenshtein($word, $w);
}
return array_search(min($lev), $lev, true);
}
View ec2_shibboleth_srpm_install.sh
#first download the packages from http://download.opensuse.org/repositories/security://shibboleth/
# ---
sudo rpmbuild --rebuild log4shib-1.0.9-3.1.el6.src.rpm
sudo rpm -ivh /usr/src/rpm/RPMS/x86_64/liblog4shib1-1
sudo rpmbuild --rebuild xerces-c-3.1.2-3.1.el6.src.rpm
sudo rpm -ivh /usr/src/rpm/RPMS/x86_64/xerces-c-bin-3.1.2-3.1.amzn1.x86_64.rpm
sudo rpmbuild --rebuild xml-security-c-1.7.3-3.1.el6.src.rpm
sudo rpm -ivh /usr/src/rpm/RPMS/x86_64/xml-security-c-bin-1.7.3-3.1.amzn1.x86_64.rpm
sudo rpmbuild --rebuild curl-openssl-7.42.1-1.1.el6.src.rpm