Skip to content

Instantly share code, notes, and snippets.

View roberto910907's full-sized avatar

Roberto Rielo roberto910907

  • Quito, Ecuador
  • 04:01 (UTC -05:00)
View GitHub Profile
<?php
// Super Secret Spy Award
$people = '{"data":[{"first_name":"jake","last_name":"bennett","age":31,"email":"jake@bennett.com","secret":"VXNlIHRoaXMgc2VjcmV0IHBocmFzZSBzb21ld2hlcmUgaW4geW91ciBjb2RlJ3MgY29tbWVudHM="},{"first_name":"jordon","last_name":"brill","age":85,"email": "jordon@brill.com","secret":"YWxidXF1ZXJxdWUuIHNub3JrZWwu"},]}';
// Removing trailing comma and creating an associative array
$peopleList = json_decode(preg_replace('/,\s*([\]}])/m', '$1', $people), true);
$emailList = array_map(function($people) {
@roberto910907
roberto910907 / duplicate_redis.sh
Created December 9, 2017 22:53
Duplicate redis instance
mv /etc/init.d/redis-server /etc/init.d/redis_6379
cp /etc/redis/redis_6379.conf /etc/redis/redis_6380.conf
nano /etc/redis/redis_6380.conf
cambiar lineas
pidfile /var/run/redis_6379.pid
port 6379
logfile /var/log/redis/redis_6379.log
dir /var/lib/redis/6379
@roberto910907
roberto910907 / install_php7.sh
Last active April 15, 2019 06:01
Installing php7.x and extensions on Ubuntu.
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
sudo apt-get install gcc
apt-get install php7.2
apt-get install php7.2-fpm php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-mysql php7.2-phpdbg php7.2-mbstring php7.2-gd php7.2-imap php7.2-ldap php7.2-pgsql php7.2-pspell php7.2-recode php7.2-tidy php7.2-dev php7.2-intl php7.2-gd php7.2-curl php7.2-zip php7.2-xml php7.2-mcrypt
# Installing redis with php
apt-get install php-redis