This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install software-properties-common python-software-properties | |
add-apt-repository 'deb http://packages.dotdeb.org wheezy-php56 all' | |
add-apt-repository 'deb-src http://packages.dotdeb.org wheezy-php56 all' | |
~~~~~~~~~~~~ jessy | |
add-apt-repository 'deb http://packages.dotdeb.org jessie all' | |
add-apt-repository 'deb-src http://packages.dotdeb.org jessie all' | |
~~~~~~~~~~~~ | |
wget http://www.dotdeb.org/dotdeb.gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo locale-gen "en_US.UTF-8" | |
$ dpkg-reconfigure locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.video-responsive { | |
position: relative; | |
padding-bottom: 56.25%; | |
height: 0; | |
overflow:hidden; | |
} | |
.video-responsive iframe, | |
.video-responsive object, | |
.video-responsive embed { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$url = "http://habrahabr.ru/post/242657/"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'uri' | |
require 'open-uri' | |
require 'nokogiri' | |
uri = URI.parse('http://export.yandex.ru/inflect.xml') | |
params = { :name => "#{ARGV[0]}" } | |
uri.query = URI.encode_www_form( params ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def hrun(start, width, padding=0): | |
return [None] * padding + range(start, start+width) + [None] * padding | |
def vrun(start, width, height, padding=0): | |
return [hrun(s, width, padding) | |
for s in range(start, start+width*height, width)] | |
layout = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port = 10051 | |
s = Zabbix::Sender.new 'zabbix-server', port | |
pp s.send('host', 'key', 'value') | |
# => {"response"=>"success", | |
# "info"=>"Processed 1 Failed 0 Total 1 Seconds spent 0.000042"} | |
pp s.to('host') { | |
send 'key', 'value' |
NewerOlder