This file contains hidden or 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 | |
| /** | |
| * Filter Elasticsearch posts by current language. | |
| */ | |
| add_filter( 'ep_formatted_args', function( $formatted_args, $args ) { | |
| if ( function_exists( 'pll_current_language' ) ) { | |
| $lang = pll_current_language(); | |
| if ( $lang !== false ) { |
This file contains hidden or 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
| --- | |
| - hosts: 127.0.0.1 | |
| connection: local | |
| become: true | |
| tasks: | |
| - name: install wget | |
| yum: | |
| name: wget | |
| state: present | |
| - name: install openjdk |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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 | |
This file contains hidden or 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
| ## 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 |
This file contains hidden or 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
| ## 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 |
This file contains hidden or 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
| ##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 |
This file contains hidden or 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
| use Drupal\node\NodeInterface; | |
| use Drupal\Core\Template\Attribute; | |
| use Drupal\Core\Url; | |
| /** | |
| * Implements hook_preprocess_page() for page.html.twig. | |
| */ | |
| function THEME_preprocess_page(&$vars) { | |
| // Add sitename and slogan to page. | |
| $vars['site_name'] = \Drupal::config('system.site')->get('name'); |
This file contains hidden or 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
| # 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"; ?> |
NewerOlder