openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
#centos 6~ | |
sudo su | |
#- Repos | |
yum install epel-release | |
mkdir /root/repos | |
cd /root/repos | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
<?php | |
namespace Acme\DemoBundle\Services; | |
use Aws\S3\S3Client; | |
/** | |
* Class AmazonS3Service | |
* | |
* @package Acme\DemoBundle\Service | |
*/ |
global | |
#debug | |
#daemon | |
log 127.0.0.1 local0 | |
defaults | |
log global | |
option httplog | |
frontend unsecured *:80 |
var timer = function(name) { | |
var start = new Date(); | |
return { | |
stop: function() { | |
var end = new Date(); | |
var time = end.getTime() - start.getTime(); | |
console.log('Timer:', name, 'finished in', time, 'ms'); | |
} | |
} | |
}; |
#Luhn algorithm | |
function a(inputNum) { | |
var digit, digits, flag, sum, _i, _len; | |
flag = true; | |
sum = 0; | |
digits = (inputNum + '').split('').reverse(); | |
for (_i = 0, _len = digits.length; _i < _len; _i++) { | |
digit = digits[_i]; | |
digit = parseInt(digit, 10); |
#!/usr/bin/env bash | |
echo $1 | grep -E -q "^[0-9]+$" || (echo "Please specify a port number to listen to." ; exit 1) | |
PORT=$1 | |
TCPDUMPARG="tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | |
sudo tcpdump -s 0 -A -i eth0 $TCPDUMPARG | |
#TCPDUMPARG="tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" |
watch "(echo stats ; echo quit ) | nc 127.0.0.1 11211" |
/** | |
* Generate and return a random characters string | |
* | |
* Useful for generating passwords or hashes. | |
* | |
* The default string returned is 8 alphanumeric characters string. | |
* | |
* The type of string returned can be changed with the "type" parameter. | |
* Seven types are - by default - available: basic, alpha, alphanum, num, nozero, unique and md5. | |
* |
{% if template contains 'product' %} | |
<meta property="og:type" content="product"> | |
<meta property="og:title" content="{{ product.title | strip_html | escape }}"> | |
<meta property="og:category" content="{{ product.type }}" /> | |
{% for image in product.images limit:3 %} | |
<meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}"> | |
<meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}"> | |
{% endfor %} | |
<meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}"> | |
<meta property="og:price:currency" content="{{ shop.currency }}"> |
openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar