Skip to content

Instantly share code, notes, and snippets.

View lenards's full-sized avatar

Andrew Lenards lenards

  • Tucson, AZ
View GitHub Profile
@lenards
lenards / overview.md
Created July 16, 2016 15:10
clank and life developing on the mac ....
  Running setup.py install for cffi
    Complete output from command /Users/lenards/devel/clank/clank_env/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/wq/sbrbzrzs5mz0rk7gjtgtg6kc0000gn/T/pip-build-PZ100z/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/wq/sbrbzrzs5mz0rk7gjtgtg6kc0000gn/T/pip-uyj0Ln-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lenards/devel/clank/clank_env/include/site/python2.7/cffi:
    running install
    running build
    running build_py
    running build_ext
    building '_cffi_backend' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DUSE__THRE
4777 git fetch ishmael master:ishmael-master
4778 git checkout ishmael
4779 git checkout ishmael-master
4780 git status
4781 git stash
4782 git push ishmael ishmael-master
4783 git pull ishmael ishmael-master
4784 git pull ishmael
4785 git branch
4786 git pull ishmael ishmael-master
@lenards
lenards / libcloud_cloudlab_test.py
Created July 6, 2016 23:19
A utility script to test launching instances in OpenStack via apache libcloud
# python libcloud_cloudlab_test.py <image-id> <flavor-id> <instance-name>
#
# python libcloud_cloudlab_test.py 91a3072b-c755-43e8-b8bc-b9cb62338ebf 2 lenardsagain
import os
import sys
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
@lenards
lenards / check_yaml.py
Last active February 17, 2016 17:52
A variation of the pre-commit-hook of the same name: [check_yaml.py](https://github.com/pre-commit/pre-commit-hooks/blob/master/pre_commit_hooks/check_yaml.py)
#!/usr/bin/env python
"""
Code governed by [LICENSE](https://github.com/pre-commit/pre-commit-hooks/blob/master/LICENSE)
Thank you pre-commit dev team: Anthony Sottile, Ken Struys
Original source:
- https://github.com/pre-commit/pre-commit-hooks/blob/master/pre_commit_hooks/check_yaml.py
@lenards
lenards / ES6_Modules.md
Last active January 13, 2016 19:34
A small outline for a tech talk to help explain the *future* usage of ES6 modules in the troposphere UI...

ES6 Modules

Providing a saner, flexible module format

Ultimately, ECMAScript 6 gives us an export and import that allow use to define modules. There is no module keyword.

TL;DR

... this will replace the AMD-style format used within troposphere.

@lenards
lenards / just_enough_scala.md
Last active October 1, 2022 23:32
A short introduction to Scala syntax and operations reworked and heavily borrowed from Holden Karau's "Scala Crash Course"

Just Enough Scala

(a moderately, well, shameless rework of Holden Karau's "Scala - Crash Course")

Scala is a multi-paradigm high-level language for the JVM.

It offers the ability to use both Object-oriented & Functional approaches.

Scala is statically typed. Type inference eliminates the need for more explicit type declarations.

@lenards
lenards / gist:b260a52f6bbe3758b0d6
Last active August 29, 2015 14:13
What happens when Consistency Level is not met?

Shutdown a node...

$ ccm node3 stop
$ ccm status 
Cluster: 'cascor'
-----------------
node1: UP
@lenards
lenards / console_out.md
Created January 7, 2015 22:28
Adventures of a DSE PySpark newbie on Mac OS X 10.9...

Trying to replicate the examples in Getting started with PySpark on Mac OS X (10.9) using the DMG Installed version of DataStax Enterprise (v4.6.0).

I have dse in the $PATH for the session...

$ echo $PATH 
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/bin:/Applications/activator-1.2.10/:/Users/andrewlenards/dse/bin

I have created the keyspace "test" and the table "kv":

@lenards
lenards / gist:e9f7da75f8631626e529
Created October 28, 2014 11:02
much error, wrong PYTHONPATH maybe?
student@cascor:~/.ccm/cascor_3nplus/node1$ ./bin/cqlsh
Python CQL driver not installed, or not on PYTHONPATH.
You might try "easy_install cql".
Python: /usr/bin/python
Module load path: ['/home/student/.ccm/cascor_3nplus/node1/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
Error: No module named cql