Skip to content

Instantly share code, notes, and snippets.

View algotrader-dotcom's full-sized avatar

Mai_Xoa algotrader-dotcom

View GitHub Profile
@leonardofed
leonardofed / README.md
Last active November 14, 2024 13:37
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.


@algotrader-dotcom
algotrader-dotcom / Setup jenkins + ansible to autdeploy for JAVA, PHP projects
Last active July 13, 2016 07:13
Setup jenkins + ansible to autdeploy for JAVA, PHP projects
# Requirments
Jenkins, Ansible on the same machine
$docker run -p 8080:8080 -p 50000:50000 -v /opt/jenkins:/var/jenkins_home thuannvn/my-jenkins
Dockerfile can be found here https://github.com/thuannvn/docker-jenkins-extended
# Setup for java project (traditional)
GIT: https://github.com/thuannvn/hello-world-java
Open jenkins -> Create new job -> Choose Freestyle -> Choose Git (Source code management) -> Build (Execute shell) with content:
javac HelloWorld.java
java HelloWorld
@algotrader-dotcom
algotrader-dotcom / hhvm-exclude-directory.md
Created December 29, 2015 05:02 — forked from tegansnyder/hhvm-exclude-directory.md
Exclude a directory from being processed by HHVM (HHVM Bypass for PHP-FPM)

I was looking for a way to load certain files using regular PHP and mix and match HHVM with PHP-FPM. Here is an example of how to use PHP-FPM to process files in the /exclude/ directory and HHVM for all other files.

## Use regular ol' PHP for files in this directory
location ^~ /exclude/ {
  include fastcgi_params;
  fastcgi_pass  127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  break;
@algotrader-dotcom
algotrader-dotcom / Install CQ5 with basic authention
Created December 11, 2015 09:09
Install CQ5 with basic authention
1. Intall
http://www.praveenmodi.com/how-to-install-adobe-cq-5-6-aem-5-6-on-amazon-aws/
Install Java 1.7
AEM 5.6.x required Java 1.7. Verify if the machine has the right version of Java
$java -version
If Java 1.7 is not available, you can install it using the following command
sudo yum install java-1.7.0-openjdk
@algotrader-dotcom
algotrader-dotcom / rsync with ssh key
Last active September 13, 2016 06:54
rsync with ssh key
## This will sync directory from remote machine to local
sudo rsync -arvz -e "ssh -i your-key.pem" ec2-user@ip-address:/path/to/dir/ temp/
## scp with key
scp -i mykey.pem somefile.txt [email protected]:/
## This will sync from local to remote
sudo rsync -arvz -e "ssh -i your-key.pem" temp/ ec2-user@ip-address:/path/to/dir/
@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active August 2, 2024 19:25
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@bluemalkin
bluemalkin / terraform-2tier-vpc
Last active November 16, 2019 04:22
Terraform 2 tier VPC with nat
# define some variables
variable "aws_ubuntu_ami" {
default = "ami-972444ad"
}
variable "aws_keypair" {
default = "xxxx"
}
# AWS account details
@magnetikonline
magnetikonline / README.md
Last active December 14, 2023 06:45
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
<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''