Skip to content

Instantly share code, notes, and snippets.

@silviud
silviud / hadoop-config-cluster.xml
Last active December 16, 2015 00:19
Hadoop Cloudera Cluster with HA for NameNode and JobTracker
File - core-site.xml
---------------------
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://Cluster01</value>
</property>

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

  • virtualenv
  • Django
  • nginx
  • uwsgi
@silviud
silviud / solo.rb
Created July 17, 2013 23:57
chef-solo config
cookbook_path [ File.expand_path("../cookbooks", __FILE__),
File.expand_path("../site-cookbooks", __FILE__)]
role_path File.expand_path("../roles", __FILE__)
file_cache_path File.expand_path("../run/cache", __FILE__)
checksum_path File.expand_path("..run/cksum", __FILE__)

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

  • virtualenv
  • Django
  • nginx
  • uwsgi
@silviud
silviud / mysqladmin_status
Created August 13, 2013 17:08
mysql status
mysqladmin -ri 30 extended-status|egrep -i 'Innodb_data*|Innodb_buffer*|Innodb_ad*|Connections*|Created_tmp_disk_tables|*Threads*'
@silviud
silviud / performance_schema.sql
Created August 28, 2013 15:16
MySQL performance_schema
/* profiling */
set profiling = 1;
show profiles;
show profile for query X;
/* performance_schema configure */
SELECT * FROM performance_schema.setup_instruments;
/* performance_schema results */
@silviud
silviud / mysql.yml
Last active April 12, 2017 17:49
Debian/Ubuntu install Percona Server with Ansible
# file for pressed
# password is empty
percona-server-server-5.6 percona-server-server/root_password password
percona-server-server-5.6 percona-server-server/root_password_again password
# playbook
---
@silviud
silviud / app.py
Created October 14, 2013 20:49 — forked from maccman/app.py
import os
from flask import Flask, render_template, request
import stripe
stripe_keys = {
'secret_key': os.environ['SECRET_KEY'],
'publishable_key': os.environ['PUBLISHABLE_KEY']
}
stripe.api_key = stripe_keys['secret_key']
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
yum install -y wget
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://rbel.co/rbel5
rpm -Uvh rbel5
yum install -y rubygem-chef
'