Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@zyluo
zyluo / python_in_bash.sh
Last active December 7, 2018 21:15
Embedding python in bash script example
#/usr/bin/which sh
set -e
PRE_SOURCEFILE=$(mktemp)
$(which python) - "${0}" "${@}" "--source" "${PRE_SOURCEFILE}" "--prefix" "PRE" <<END
import argparse
import sys
import tempfile
@zyluo
zyluo / cdh6-postgresql.sh
Last active October 2, 2018 19:06
CDH6.0.0 Postgresql Database setup script
export PG_PASSWD="USE_UR_PASSWD"
for db_name in scm amon rman hue metastore sentry nav navms oozie; do sudo -u postgres psql -c "CREATE ROLE $db_name LOGIN PASSWORD '$PG_PASSWD';"; sudo -u postgres psql -c "CREATE DATABASE $db_name OWNER $db_name ENCODING 'UTF8';"; done
sudo -u postgres psql -c "SELECT rolname FROM pg_roles;" && sudo -u postgres psql -c "\l"
for db_name in metastore oozie; do sudo -u postgres psql -c "ALTER DATABASE $db_name SET standard_conforming_strings=off;"; done
sudo /opt/cloudera/cm/schema/scm_prepare_database.sh postgresql scm scm $DB_PASSWD
@zyluo
zyluo / tezos-baking-howto.md
Created July 8, 2018 23:02 — forked from dakk/tezos-baking-howto.md
tezos-baking-howto.md

Tezos baking howto

This howto is valid both for Betanet.

Setup

Prereq

You need gcc, m4, git, unzip, rsync and curl. In debian / ubuntu run:

$ uname -a
Linux devstack-centos64 2.6.32-358.123.2.openstack.el6.x86_64 #1 SMP Thu Sep 26 17:14:58 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 1.0
stepping : 3
export OS_PASSWORD=abracadabra
export OS_AUTH_URL=http://localhost:35357/v2.0/
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export SG_UUID=$(nova secgroup-list | grep " default " | awk '{print $2}')
export NET_UUID=$(neutron net-list | grep " private " | awk '{print $2}')
export IMG_UUID=$(glance image-list | grep " ami " | awk '{print $2}')
export TEN_UUID=$(keystone tenant-list | grep " admin " | awk '{print $2}')
nova-manage project quota $TEN_UUID --key=instances --value=64
nova-manage project quota $TEN_UUID --key=cores --value=64
DATABASE_PASSWORD=abracadabra
RABBIT_PASSWORD=abracadabra
SERVICE_TOKEN=abracadabra
SERVICE_PASSWORD=abracadabra
ADMIN_PASSWORD=abracadabra
disable_service n-obj
disable_service n-net
disable_service n-novnc
disable_service n-xvnc
@zyluo
zyluo / repo_update.sh
Last active January 2, 2016 13:39
OpenStack git repository update script
#!/usr/bin/env bash
# Copyright (c) 2014 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@zyluo
zyluo / nova-flags
Created January 19, 2012 10:43
OpenStack flag list
=== nova.image.s3.py ===
string('image_decryption_dir', '/tmp', 'parent dir for tempdir used for image decryption')
string('s3_access_key', 'notchecked', 'access key to use for s3 server for images')
string('s3_secret_key', 'notchecked', 'secret key to use for s3 server for images')
=== nova.compute.api.py ===
integer('find_host_timeout', 30, 'Timeout after NN seconds when looking for a host.')
=== nova.compute.manager.py ===
string('instances_path', '$state_path/instances', 'where instances are stored on disk')