sudo -s
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
import os | |
import base64 | |
import json | |
from Crypto.Cipher import AES | |
from phpserialize import loads | |
def decrypt(payload): | |
data = json.loads(base64.b64decode(payload)) |
import os | |
import json | |
import hashlib | |
import hmac | |
import base64 | |
from Crypto.Cipher import AES | |
from phpserialize import loads, dumps | |
def mcrypt_decrypt(value, iv): |
<?php | |
/** | |
* mb_str_pad | |
* | |
* @param string $input | |
* @param int $pad_length | |
* @param string $pad_string | |
* @param int $pad_type | |
* @return string |
FROM centos:7 | |
MAINTAINER Naoaki Obiki | |
RUN yum update -y | |
RUN yum group install -y 'Development Tools' | |
RUN yum install -y libxml2-devel wget | |
RUN wget "http://jp2.php.net/get/php-7.0.9.tar.gz/from/this/mirror" -P /usr/local/src/ | |
RUN mv /usr/local/src/mirror /usr/local/src/php-7.0.9.tar.gz | |
RUN wget "http://pecl.php.net/get/pthreads-3.1.6.tgz" -P /usr/local/src/ |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
<?php | |
// generate private/public key as follows: | |
// > openssl genrsa -out private.pem 2048 | |
// > openssl rsa -in private.pem -outform PEM -pubout -out public.pem | |
$data = "String to encrypt"; | |
$privKey = openssl_pkey_get_private('file:///path/to/private.pem'); | |
$encryptedData = ""; |
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path |
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
import {createReducer} from '@ngrx/store'; | |
import {on} from "@ngrx/store"; | |
import produce, {Draft} from "immer"; | |
export const initialUserState: IUserState = { | |
knownUsers: [user1, user2], | |
selectedUser: null, | |
scenes: null | |
}; |