Skip to content

Instantly share code, notes, and snippets.

View psachin's full-sized avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@psachin
psachin / cfme-rh-sso.yml
Created January 8, 2018 10:09 — forked from jairojunior/cfme-rh-sso.yml
Playbook to configure CFME login with RH-SSO
---
- hosts: all
become: yes
become_user: root
vars:
appliance_file_name: "https_{{ appliance_name }}"
tasks:
- name: SAML configuration dir
@psachin
psachin / 00-readme.md
Created February 22, 2017 05:37 — forked from briancline/00-readme.md
Test Swift installation (multi-node)

These are based on updated instructions for the Swift multi-node setup guide.

Steps to install on Ubuntu 14.04, assuming at least two machines:

  1. Copy the below 3 scripts to each of your VMs (make sure to chmod +x each of them as well).
  2. Run 01-install-proxy-node.sh only on your proxy.
  3. Run 02-install-storage-node.sh only on each of your storage nodes, prefixing the command with NODE=1, where 1 is the number for that storage node (must start at 1 and increment). For instance: NODE=1 ./02-install-storage-node.sh on your first storage node, NODE=2 ./02-install-storage-node.sh on your second storage node, etc.
  4. For each of the exports provided to you by the storage node install script (STORAGE_N_IP and STORAGE_N_DISKS), copy and paste them into your shell on the proxy. Then, running set | grep -a '^STORAGE_' from your proxy should show you all the storage nodes' exports.
  5. On the proxy, run 03-build-rings.sh. It will show you all the nodes and disks it discovered from your environment, build the
diff --git a/bin/swift-get-nodes b/bin/swift-get-nodes
index f2e3046..0e9eea9 100755
--- a/bin/swift-get-nodes
+++ b/bin/swift-get-nodes
@@ -19,7 +19,8 @@ import os
from optparse import OptionParser
from swift.common.ring import Ring
-from swift.cli.info import print_item_locations, InfoSystemExit
+from swift.cli.info import (parse_get_node_args, print_item_locations,
diff --git a/bin/swift-get-nodes b/bin/swift-get-nodes
index d52480e..00ae50a 100755
--- a/bin/swift-get-nodes
+++ b/bin/swift-get-nodes
@@ -52,8 +52,9 @@ if __name__ == '__main__':
try:
ring_path, args = parse_get_node_args(options, args)
- except InfoSystemExit:
- sys.exit(parser.print_help())
@psachin
psachin / Makefile
Last active August 29, 2015 14:17 — forked from jvns/Makefile
obj-m += hello-packet.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
# Shell script to download Oracle JDK from command prompt / terminal.
# You can download all the binaries one-shot by just giving the BASE_URL.
## Features:
# Resumes a broken [previous] download, if any.
# Renames the file to a proper name with platform adding platform info.
# Downloads all the following from Oracle Website with one shell invocation.
# a. Windows 64 and 32 bit;
# b. Linux 64 and 32 bit; and
# c. API Docs.
(defun yh/orgtbl-to-rst-paddings (table)
(let* ((pruned-table (remove 'hline table))
(size-table (mapcar (lambda (row)
(mapcar #'length row))
pruned-table)))
(apply #'mapcar* #'max size-table)))
(defun yh/orgtbl-padded-hline (paddings &optional chr)
(let ((chr (or chr ?-)))
(concat (format "+%c" chr)
;;;
;;; Recursively list files in a given directory
;;;
;;; Author: daniel m german dmg at uvic dot ca
;;; Copyright: daniel m german
;;; License: Same as Emacs
;;;
(defun directory-files-recursive (directory match maxdepth ignore)
"List files in DIRECTORY and in its sub-directories.
Return files that match the regular expression MATCH but ignore
@psachin
psachin / python-pep8.el
Last active December 29, 2015 18:19 — forked from ieure/python-pep8.el
;;; python-pep8.el --- minor mode for running `pep8'
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com>
;; Author: Ian Eure <ian.eure@gmail.com>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01
# Source: https://gist.github.com/4702275
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.