exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line
shell_exec - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen - Opens read or write pipe to process of a command
proc_open - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
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
function netshoot() { if [ -z $1 ]; then docker ps ; else docker run -it --rm --name netshoot --net container:${1} nicolaka/netshoot ;fi } |
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
docker-machine create manager | |
docker-machine create agent-1 | |
docker-machine create agent-2 | |
MANAGER_IP=`docker-machine ip manager` | |
JOIN_CMD=`docker-machine ssh manager docker swarm init --advertise-addr ${MANAGER_IP} | grep "\-\-token"` | |
docker-machine ssh agent-1 ${JOIN_CMD} | |
docker-machine ssh agent-2 ${JOIN_CMD} |
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
# SYNOPSIS | |
# manopt command opt | |
# | |
# DESCRIPTION | |
# Returns the portion of COMMAND's man page describing option OPT. | |
# Note: Result is plain text - formatting is lost. | |
# | |
# OPT may be a short option (e.g., -F) or long option (e.g., --fixed-strings); | |
# specifying the preceding '-' or '--' is OPTIONAL - UNLESS with long option | |
# names preceded only by *1* '-', such as the actions for the `find` command. |
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
#!/bin/bash | |
#=================================================================================== | |
# | |
# FILE: dump.sh | |
# USAGE: dump.sh [-i interface] [tcpdump-parameters] | |
# DESCRIPTION: tcpdump on any interface and add the prefix [Interace:xy] in front of the dump data. | |
# OPTIONS: same as tcpdump | |
# REQUIREMENTS: tcpdump, sed, ifconfig, kill, awk, grep, posix regex matching | |
# BUGS: --- | |
# FIXED: - In 1.0 The parameter -w would not work without -i parameter as multiple tcpdumps are started. |
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
#include <android/security/keystore/IKeystoreService.h> | |
#include <android/security/keystore/BpKeystoreService.h> | |
namespace android { | |
namespace security { | |
namespace keystore { | |
IMPLEMENT_META_INTERFACE(KeystoreService, "android.security.keystore.IKeystoreService") |
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
MYDOMAIN=secsi.com | |
docker run -it --rm -d --name openssl alpine/openssl | |
docker exec -it openssl openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=Company, Inc./CN=$MYDOMAIN" -addext "subjectAltName=DNS:$MYDOMAIN" -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt; | |
docker cp openssl:/etc/ssl ssl-output | |
docker rm -f openssl |
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
docker-compose -f production-cluster.yml exec elasticsearch "chmod 700 /usr/share/elasticsearch/config && chmod 600 /usr/share/elasticsearch/config/elasticsearch.yml && chmod 600 /usr/share/elasticsearch/config/node1.key && chmod 600 /usr/share/elasticsearch/config/root-ca.pem && chmod 600 /usr/share/elasticsearch/config/node1.pem" | |
docker-compose -f production-cluster.yml exec elasticsearch-2 "chmod 700 /usr/share/elasticsearch/config && chmod 600 /usr/share/elasticsearch/config/elasticsearch.yml && chmod 600 /usr/share/elasticsearch/config/node2.key && chmod 600 /usr/share/elasticsearch/config/root-ca.pem && chmod 600 /usr/share/elasticsearch/config/node2.pem" | |
docker-compose -f production-cluster.yml exec elasticsearch-3 "chmod 700 /usr/share/elasticsearch/config && chmod 600 /usr/share/elasticsearch/config/elasticsearch.yml && chmod 600 /usr/share/elasticsearch/config/node2.key && chmod 600 /usr/share/elasticsearch/config/root-ca.pem && chmod 600 /usr/share/elasticsearch/config/node2.pem" | |
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
--- | |
- name: "Install Docker Compose" | |
gather_facts: true | |
become: true | |
hosts: all | |
tasks: | |
- name: "Download dockker-compose" | |
get_url: | |
url: https://github.com/docker/compose/releases/download/1.27.4/docker-compose-{{ ansible_system }}-{{ ansible_machine }} | |
dest: /usr/local/bin/docker-compose |
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. install openjdk | |
`sudo apt-get install openjdk-7-jdk` | |
2. install `android sdk` | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools |