create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
#!/usr/bin/env bash | |
RUBY_VERSION_MAJOR="2.1" | |
RUBY_VERSION="2.1.2" | |
apt-get -y update && apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/${RUBY_VERSION_MAJOR}/ruby-${RUBY_VERSION}.tar.gz | |
tar -xvzf ruby-${RUBY_VERSION}.tar.gz | |
cd ruby-${RUBY_VERSION} && ./configure --prefix=/usr/local && make && make install |
<?php | |
/** | |
* Creates and starts new timer. | |
* @param array $tags an array of tags and their values in the form of "tag" => "value". Cannot contain numeric indexes for obvious reasons. | |
* @param array $data optional array with user data, not sent to the server. | |
* @return resource Always returns new timer resource. | |
*/ | |
function pinba_timer_start($tags, $data = array()){} |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
rrdtool lastupdate /path/to.rrd | sed ':a;N;$!ba;s/.*: \([0-9]*\)/\1/g' |
/** | |
* 1. Selct a city in the "From" field list | |
* 2. Open the "To" field list | |
* | |
* Some times there is a simple cities list without countries, which is very uncomfortable | |
* This gist is for those cases | |
* | |
* 3. Copy this code into your Firebug (or other) console and execute | |
* | |
* Don't forget to perform step 2 every time you select a new "From" city |
<?php | |
// CLIENTSIDE: | |
if (!Yii::app()->user->timezone): ?> | |
<script type="text/javascript"> | |
$(function () { | |
var visitortime = new Date(); | |
$.ajax({ | |
type: "GET", |
#!/bin/bash | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Mathias Leppich <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
# Based on https://blog.mediacru.sh/2013/12/23/The-right-way-to-encode-HTML5-video.html | |
# ogv | |
ffmpeg -i input.mp4 -q 5 -pix_fmt yuv420p -vcodec libtheora -vf "crop=1200:680:360:200" -an output.ogv | |
# Cropped WebM without audio | |
ffmpeg -i input.mp4 -c:v libvpx -pix_fmt yuv420p -quality good -b:v 2M -crf 5 -vf "crop=1200:680:360:200,scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -an -f webm output.webm | |
# Same mp4 | |
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -b:v 2M -crf 18 -maxrate 4000k -bufsize 1835k -vf "crop=1200:680:360:200,scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -an -movflags faststart -f mp4 output.mp4 |
CHttpSession.timout - session data will be cleaned up (default - 1440) | |
CHttpSession.cookieParams.lifetime - session cookie lifetime (default - 0 means "until the browser is closed.") | |
CWebUser.authTimeout - user is logged out if inactive (not set - after the current session expires) | |
CWebUser.absoluteAuthTimeout - user is logged out regardless of activity (not set - ommited) | |
== | |
CWebUser.allowAutoLogin = true | |
CWebUser.autoRenewCookie = false |