This file contains 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
char * get_current_user() { | |
char user_name[64] = {0}; | |
if( getlogin_r(user_name, sizeof(user_name)-1) != 0 ) { | |
printf("Error fetching current user"); | |
exit(1); | |
} | |
// Allocate memory on heap for user_name and return pointer | |
char * username_heap_alloc = malloc( strlen(user_name) + 1 ); // Nullterminator + 1 | |
if( username_heap_alloc ) { |
This file contains 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 | |
class TestExceptionHandler extends Exception { | |
public static function external_logging($callable) { | |
set_exception_handler(array( | |
__CLASS__, $callable | |
)); | |
} | |
// TODO: PHP7 (Throwable $e) |
This file contains 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
version: "2" | |
services: | |
node1: | |
container_name: node1 | |
image: percona/percona-xtradb-cluster:5.7 | |
environment: | |
- CLUSTER_NAME=cluster1 | |
- MYSQL_ROOT_PASSWORD=root | |
networks: | |
- pxc-network |