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
{ | |
"Ares_odpovedi": { | |
"xmlns:are": "http:\/\/wwwinfo.mfcr.cz\/ares\/xml_doc\/schemas\/ares\/ares_answer_or\/v_1.0.3", | |
"xmlns:D": "http:\/\/wwwinfo.mfcr.cz\/ares\/xml_doc\/schemas\/ares\/ares_datatypes\/v_1.0.3", | |
"xmlns:U": "http:\/\/wwwinfo.mfcr.cz\/ares\/xml_doc\/schemas\/uvis_datatypes\/v_1.0.3", | |
"odpoved_datum_cas": "2012-12-06T06:04:46", | |
"odpoved_pocet": "1", | |
"odpoved_typ": "Vypis_OR", | |
"vystup_format": "XML", | |
"xslt": "klient", |
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
class ApplicationController < ActionController::Base | |
rescue_from Mongoid::Errors::DocumentNotFound, :with => :rescue_not_found | |
protected | |
def rescue_not_found | |
render :template => 'application/not_found', :status => :not_found | |
end | |
end |
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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"route53:ChangeResourceRecordSets", | |
"route53:GetHostedZone", | |
"route53:ListResourceRecordSets" | |
], | |
"Effect": "Allow", | |
"Resource": [ |
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 'syslog' | |
require 'net/http' | |
require 'aws-sdk' | |
Syslog.open | |
AWS.config({ | |
:access_key_id => '<iam user key>', | |
:secret_access_key => '<iam user secret>' |
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
#mysql | |
#export | |
mysqldump -u root -p <db> > <filename>.sql | |
#import | |
mysql -u root -p <db> < <filename>.sql | |
#mongo | |
#export |
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
#zabbix user needs to be in /etc/sudoers to be able to execute ipmitool | |
zabbix ALL=NOPASSWD: /usr/bin/ipmitool | |
#zabbix config has to collect desired UserParameters | |
UserParameter=ipmi.ambient_temp,sudo ipmitool sdr | grep "Ambient" | awk '{print $3}' | head -1 | |
UserParameter=ipmi.cpu_temp,sudo ipmitool sdr | grep "CPU" | awk '{print $3}' | head -1 | |
UserParameter=ipmi.cpu_fan,sudo ipmitool sdr | grep -i "FAN1 SYS" | awk '{print $4}' | head -1 | |
UserParameter=ipmi.cpu_fan_status,sudo ipmitool sdr | grep -i "FAN1 SYS" | awk '{print $7}' | head -1 | |
#after restart of zabbix_agentd, collected values can be tested via |
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
#assuming rvm installed with Ruby 2+ | |
#install latest passenger gem | |
gem install passenger --pre | |
#install nginx from sources with passenger module | |
passenger-install-nginx-module |
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
//I found out that I’d need to close Facebook dialog that I invoke by calling: | |
FB.ui(<parameters>, <callback>); | |
//Facebook, doesn’t provide any documentation do these dialogs, with one exception - how to open them, so I had to manually trace how they close the dialog window. I found out that it’s a good practice to open all their dialogs like this | |
//open the dialog and save off the reference | |
var dialog = FB.ui(<parameters>, <callback>); | |
... | |
//force close the dialog via it's id accessible through the saved reference |
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
#run a command every day at midnight under user ubuntu | |
0 0 * * * ubuntu /<path to your rails project>/crontab.sh bundle exec rake <parameters> > /dev/null 2> /dev/null |
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
CREATE USER <user> WITH PASSWORD '<password>'; | |
CREATE DATABASE <db>; | |
CREATE SCHEMA <schema>; | |
GRANT ALL PRIVILEGES ON DATABASE <db> TO <user>; | |
GRANT ALL PRIVILEGES ON SCHEMA <schema> TO <user>; | |
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA <schema> TO <user>; | |
#clone db command | |
createdb -O <owner> -T <db> <new db> |
OlderNewer