Skip to content

Instantly share code, notes, and snippets.

View algotrader-dotcom's full-sized avatar

Mai_Xoa algotrader-dotcom

View GitHub Profile
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
@algotrader-dotcom
algotrader-dotcom / README.md
Created January 13, 2017 17:32 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


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:

@algotrader-dotcom
algotrader-dotcom / terraform-2tier-vpc
Created November 1, 2016 11:21 — forked from bluemalkin/terraform-2tier-vpc
Terraform 2 tier VPC with nat
# define some variables
variable "aws_ubuntu_ami" {
default = "ami-972444ad"
}
variable "aws_keypair" {
default = "xxxx"
}
# AWS account details
@algotrader-dotcom
algotrader-dotcom / slackpost
Created October 7, 2016 04:45 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/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
@algotrader-dotcom
algotrader-dotcom / README.md
Created August 15, 2016 04:23 — forked from magnetikonline/README.md
Nginx FastCGI cache configuration example.

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
@algotrader-dotcom
algotrader-dotcom / ftpFileserveUploader.py
Created August 11, 2016 06:38 — forked from slok/ftpFileserveUploader.py
Python script to upload various files to fileserve with FTP.
# 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
#
@algotrader-dotcom
algotrader-dotcom / deploy.yml
Created August 9, 2016 07:21 — forked from mig5/deploy.yml
Ansible playbook to deploy Drupal
---
- 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
@algotrader-dotcom
algotrader-dotcom / mysql_pwd_reset.sh
Created August 6, 2016 18:24 — forked from thomasmb/mysql_pwd_reset.sh
A shell script for resetting the root MySQL password
# 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
@algotrader-dotcom
algotrader-dotcom / Python Script Send Email With Attachments
Created June 28, 2016 06:34
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()
@algotrader-dotcom
algotrader-dotcom / Apache Solr 4.x + Drupal 7
Last active June 26, 2016 16:23
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