This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automaticlly install pptpd on Amazon EC2 Amazon Linux | |
# | |
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/ | |
# pptpd source rpm packing by it's authors | |
# | |
# WARNING: | |
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my | |
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones. | |
# | |
# You need to adjust your "Security Groups" which you are using too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.magentocommerce.com/downloads/assets/1.6.2.0/magento-1.6.2.0.tar.gz && tar -zxvf magento-1.6.2.0.tar.gz && mv magento/* magento/.htaccess . && chmod -R o+w media var && chmod o+w app/etc | |
--2012-03-28 17:28:48-- http://www.magentocommerce.com/downloads/assets/1.6.2.0/magento-1.6.2.0.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> Installing sshfs dependency: automake | |
==> Downloading http://ftpmirror.gnu.org/automake/automake-1.12.4.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/automake-1.12.4.tar.gz | |
/usr/bin/tar xf /Library/Caches/Homebrew/automake-1.12.4.tar.gz | |
==> ./configure --prefix=/usr/local/Cellar/automake/1.12.4 | |
./configure --prefix=/usr/local/Cellar/automake/1.12.4 | |
checking whether make supports nested variables... yes | |
checking build system type... x86_64-apple-darwin12.2.0 | |
checking host system type... x86_64-apple-darwin12.2.0 | |
checking for a BSD-compatible install... /usr/bin/install -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lxml.html | |
from urllib import urlopen | |
h = lxml.html.parse(urlopen('http://webmeetguildford.co.uk/')) | |
for vcard in h.find_class("vcard"): | |
d = { | |
"link": h.find('a').get('href'), | |
"name": h.find('h3').text, | |
"twitter": h.find('a/p').text, | |
"avatar": h.find('img').get('src') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo bless --device /dev/disk0s4 --setBoot --legacy --nextonly | |
osascript -e 'ignoring application responses' -e 'tell application "Finder" to restart' -e 'end ignoring' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install Homebrew if you don't have it already | |
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
then install rbenv and ruby-build | |
$ brew install rbenv ruby-build | |
finally, install Ruby and Rails | |
$ rbenv install 2.0.0-p353 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript" | |
src="https://maps.googleapis.com/maps/api/js?sensor=false"> | |
</script> | |
<meta charset="UTF-8"> | |
<title>Example Google Map</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is used for create virtual hosts on CentOs. | |
# Created by alexnogard from http://alexnogard.com | |
# Feel free to modify it | |
# PARAMETERS | |
# | |
# $usr - User | |
# $dir - directory of web files | |
# $servn - webserver address without www. | |
# $cname - cname of webserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
brew update | |
brew install bash | |
sudo sh -c 'echo "/usr/local/bin/bash" >> /etc/shells' | |
chsh -s /usr/local/bin/bash | |
sudo mv /bin/bash /bin/bash-backup | |
sudo ln -s /usr/local/bin/bash /bin/bash | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = array(); | |
$result_html = ''; | |
if (isset($_POST['domain']) && !empty($_POST['domain'])) { | |
$domain_regex = '/[a-z\d][a-z\-\d\.]+[a-z\d]/i'; | |
if (preg_match($domain_regex, $_POST['domain'])) { | |
if ($url = parse_url($_POST['domain'])) { //compatible when user post an url instead of a domain | |
if (isset($url['host'])) { | |
$result = dns_get_record($url['host'], DNS_A + DNS_AAAA + DNS_CNAME); | |
} else if (isset($url['path'])) { |
OlderNewer