- Assuming that you have already installed php and apache
- Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug
# Ubuntu 14.04, php 5.6
sudo apt-get install php5-xdebug
| // Does the content type already exits? | |
| $type = node_type_load('book'); | |
| if (!$type) { | |
| $type = array( | |
| 'type' => 'book', | |
| 'name' => t('Book'), | |
| 'base' => 'node_content', | |
| 'description' => t('Create a book.'), | |
| 'custom' => 1, |
| #!/bin/bash | |
| # WannaCry BTC address report script | |
| # 5/12/17 -- chris_commat_misentropic_commercial | |
| sep() { | |
| for a in {1..80}; do printf "=" ; done ; echo | |
| } | |
| filt() { | |
| sed 's#<.*">##;s#<.*##' | awk '{print $1}' | |
| } |
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug
# Ubuntu 14.04, php 5.6
sudo apt-get install php5-xdebug
A simple Ghostscript command to merge two PDFs in a single file is shown below:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdfInstall Ghostscript:
Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.
| <?php | |
| namespace Drupal\custom_module\Plugin\Block; | |
| use Drupal\Core\Block\BlockBase; | |
| /** | |
| * Provides a 'LazyBlock' block. | |
| * | |
| * @Block( |
| <?php | |
| // Encrypt data with PHP openssl_encrypt AES-128-CBC. | |
| $data = 'The quick brown fox jumps over the lazy dog.'; | |
| $key = '2b7e151628aed2a6abf7158809cf4f3c'; | |
| $iv = '000102030405060708090a0b0c0d0e0f'; | |
| $encrypted_data = bin2hex(openssl_encrypt($data, 'AES-128-CBC', hex2bin($key), OPENSSL_RAW_DATA, hex2bin($iv))); |