View 0_beautifulsoup.py
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
View README.md


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

View terraform-2tier-vpc
# define some variables
variable "aws_ubuntu_ami" {
default = "ami-972444ad"
}
variable "aws_keypair" {
default = "xxxx"
}
# AWS account details
View slackpost
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
View README.md

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
View ftpFileserveUploader.py
# Copyright (c) 2011, Xabier (slok) Larrakoetxea
# Copyright (c) 2011, Iraide (Sharem) Diaz
#
# 3 clause/New BSD license:
# opensource: http://www.opensource.org/licenses/BSD-3-Clause
# wikipedia: http://en.wikipedia.org/wiki/BSD_licenses
#
#-----------------------------------------------------------------------
# This script allows to upload to Fileserve with FTP various files at the same time
#
View deploy.yml
---
- hosts: all
gather_facts: no
tasks:
- name: Backup database
shell: "{{ item }}"
with_items:
- mkdir -p ~jenkins/dbbackups
- drush @{{ shortname }}_{{ env }} sql-dump --skip-tables-key=common | gzip > ~jenkins/dbbackups/{{ shortname }}_{{ env }}_prior_to_{{ build }}.sql.gz
View mysql_pwd_reset.sh
# Please confirm that you want to reset the MySQL passwords
CONFIRM="n"
echo -n "Please confirm MySQL password reset. Continue? (y/N): "
read -n 1 CONFIRM_INPUT
if [ -n "$CONFIRM_INPUT" ]; then
CONFIRM=$CONFIRM_INPUT
fi
echo
View Python Script Send Email With Attachments
#!/usr/bin/python
import smtplib
import base64
filename = "python-sendmail.py"
# Read a file and encode it into base64 format
fo = open(filename, "rb")
filecontent = fo.read()
View Apache Solr 4.x + Drupal 7
1. wget https://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4-src.tgz
2. tar xvf solr-4.10.4-src.tgz && cd solr-4.10*
3. vi example/etc/jetty.xml
... change port to 8985
4. Copy config from module to apache solr
rsync -arvz /path/root/sites/all/modules/apachesolr/solr-conf/solr-4.x/ /opt/solr-4.10.3/example/solr/conf/
5. cd example/ && java -Djetty.port=8985 -jar start.jar
http://www.nickveenhof.be/blog/simple-guide-install-apache-solr-3x-drupal-7