start new:
tmux
start new with session name:
tmux new -s myname
<?php | |
function parse_properties($txtProperties) { | |
$result = array(); | |
$lines = split("\n", $txtProperties); | |
$key = ""; | |
$isWaitingOtherLine = false; | |
foreach ($lines as $i => $line) { | |
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0)) | |
continue; | |
package selly.spring.data.convert; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import org.springframework.beans.factory.config.BeanDefinition; |
<?php | |
$ytdlPath = '/whereever/your/youtube-dl'; //change this | |
ob_start(); | |
$url = trim(rawurldecode($_SERVER['QUERY_STRING'])); | |
$qStr = parse_url($url, PHP_URL_QUERY ); | |
parse_str($qStr, $get); | |
if (!isset($get['v']) || !preg_match('~[a-zA-Z0-9_-]{11}~',$get['v']) ) { |
http { | |
log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" $request_time ' | |
'<"$request_body" >"$resp_body"'; | |
lua_need_request_body on; | |
set $resp_body ""; | |
body_filter_by_lua_block { |
FROM php:5.6-fpm-alpine | |
RUN apk update && apk add autoconf openssl-dev g++ make && \ | |
pecl install mongo && \ | |
docker-php-ext-enable mongo && \ | |
apk del --purge autoconf openssl-dev g++ make |
#!/bin/bash | |
# | |
# Generates client and server certificates used to enable HTTPS | |
# remote authentication to a Docker daemon. | |
# | |
# See http://docs.docker.com/articles/https/ | |
# | |
# To start the Docker Daemon: | |
# | |
# sudo docker -d \ |
package core; | |
public class Base58 { | |
private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" | |
.toCharArray(); | |
private static final int BASE_58 = ALPHABET.length; | |
private static final int BASE_256 = 256; | |
private static final int[] INDEXES = new int[128]; |
import kotlinx.coroutines.experimental.async | |
import kotlin.coroutines.experimental.CoroutineContext | |
suspend fun <T, R> Iterable<T>.pmap(context: CoroutineContext, transform: suspend (T) -> R): List<R> { | |
return this.map { | |
async(context) { | |
transform(it) | |
} | |
}.map { it.await() } | |
} |
The default format of keys was changed in OpenSSL 1.0. From OpenSSL 1.0 change log:
Make PKCS#8 the default write format for private keys, replacing the traditional format. This form is standardised, more secure and doesn't include an implicit MD5 dependency. [Steve Henson]
Good explanations of the difference between the two formats: https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem
Converting RSA private key: