Skip to content

Instantly share code, notes, and snippets.

@yassermog
yassermog / getAWSSecretValue.php
Last active August 8, 2021 08:28
getAWSSecretValue.php
<?php
function getAWSSecretValue($secretName)
{
$client = new SecretsManagerClient([
'profile' => 'default',
'region' => 'ap-southeast-1',
'version' => '2017-10-17',
]);
try {
$result = $client->getSecretValue([
@yassermog
yassermog / execdocker.sh
Last active August 30, 2019 03:33
usful bash script that allow you to run a command inside a container as a root 1- change container_id in execdocker.sh 2- run bash execdocker.sh "your_command"
container_id="c9d1369a7478" # change container_id
start="docker exec -u root -t -i "$container_id
pass=$1
command=$start" "$pass
RED='\033[0;31m'
Green='\033[0;32m'
NC='\033[0m' # No Color
#Color=$RED
Color=$Green
printf "${Color} $ ${command}${NC}\n"
@yassermog
yassermog / MY_Input.php
Last active August 1, 2018 10:00 — forked from nambok/MY_Input.php
Extends codeigniter input class to accept put and delete requests ........ Just Put this file in application/core/MY_Input.php ........ NOW you can $data=$this->input->put('key');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Input extends CI_Input {
/**
* Variables
*
*/
protected $delete;