Skip to content

Instantly share code, notes, and snippets.

View algotrader-dotcom's full-sized avatar

Mai_Xoa algotrader-dotcom

View GitHub Profile
@algotrader-dotcom
algotrader-dotcom / github error: unable to read askpass response from gnome-ssh-askpass
Created October 29, 2015 16:51
github error: unable to read askpass response from gnome-ssh-askpass
# Root Cause
$cat /etc/profile.d/gnome-ssh-askpass.sh
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
# Fixed
$unset SSH_ASKPASS
then
$git push origin master
@algotrader-dotcom
algotrader-dotcom / Compile apache 2.4 + php from source
Last active December 1, 2022 21:23
Compile apache 2.4 + php from source
1. Requirements
yum install pcre*
yum install libxml*
yum install gdbm-devel
2. Download packages
apr-1.5.2.tar.gz
apr-util-1.5.2.tar.gz
@algotrader-dotcom
algotrader-dotcom / Selenium webdriver wait for ajax with Python
Created December 10, 2015 06:05
Selenium webdriver wait for ajax with Python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import WebDriverException
def ajax_complete(driver):
try:
return 0 == driver.execute_script("return jQuery.active")
except WebDriverException:
pass
@algotrader-dotcom
algotrader-dotcom / Geos installation on centos 6
Last active December 20, 2021 08:36
Geos installation on centos 6
## GeoOS written in C++ (port from Java) great on peformance improve https://geophp.net/geos.html
sudo yum install php-devel
cd /usr/share
sudo wget http://download.osgeo.org/geos/geos-3.3.9.tar.bz2 # Note this changes
sudo tar -xvjf geos-3.3.9.tar.bz2
cd geos-3.3.9
sudo ./configure --enable-php && sudo make clean && sudo make
sudo make install
sudo ldconfig
@algotrader-dotcom
algotrader-dotcom / Apache reverse proxy basic authentication with whitelist IPs
Created October 7, 2015 06:46
Apache reverse proxy basic authentication with whitelist IPs
## This conf will basic auth for all exept IP from graph.facebook, twitter..
<VirtualHost IP:443>
ServerName webapp.com
UseCanonicalName Off
ErrorLog /etc/httpd/logs/ssl_reverse_error_log
CustomLog /etc/httpd/logs/ssl_reverse_access_log combined env=!dontlog
RewriteLog "/etc/httpd/logs/ssl_rewrite.log"
RewriteLogLevel 3
@algotrader-dotcom
algotrader-dotcom / Ansible Kickstart
Last active October 21, 2021 23:08
Ansible Kickstart
##What's 'Ansible' ?
Ansible is configuration management tool like SaltStack, Puppet but it works through SSH, no need to install agent on managed nodes.
##Why's Ansible ?
As my point, i love ansible for:
- No need to install agent on agent nodes
##How's Ansible?
### Install Ansible on master node
@algotrader-dotcom
algotrader-dotcom / Git and Github in 5 minutes
Last active July 28, 2021 06:41
Git and Github in 5 minutes
# Git and Github in 5 minutes
1. First of all, you need to create a git project like this:
git init learn-git
cd learn-git
Then, once you are in a git repository, you start writing the initial draft of the code.
file: helloword.php
<?php echo "Hello World!\n"; ?>
@algotrader-dotcom
algotrader-dotcom / Apache : Permission denied because search permissions are missing on a component of the path
Created October 12, 2015 03:55
Apache : Permission denied because search permissions are missing on a component of the path
## This will be fixed by
find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;
@algotrader-dotcom
algotrader-dotcom / Docker cheat sheet
Last active July 24, 2018 01:50
Docker cheat sheet
# https://serversforhackers.com/video/ansible-installation-and-basics
################# Docker ##################
1. Run docker mysql version 5.7 with mounted volume on /docker-data/mysql on host and mount to 3306 to host port
$docker run -p 172.16.20.213:3306:3306 --name mysql-server -v /docker-data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7
OR
$docker run -p 3306:3306 --name mysql-server -v /docker-data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7
2. List docker running
$docker ps
@algotrader-dotcom
algotrader-dotcom / Drupal 8 - Create term programatically
Created June 9, 2018 16:45
Drupal 8 - Create term programatically
<?php /* Main */
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);