This file contains hidden or 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
| # This is an auto-generated Django model module. | |
| # You'll have to do the following manually to clean this up: | |
| # * Rearrange models' order | |
| # * Make sure each model has one field with primary_key=True | |
| # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table | |
| # Feel free to rename the models, but don't rename db_table values or field names. | |
| # | |
| # Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]' | |
| # into your database. | |
| from __future__ import unicode_literals |
This file contains hidden or 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
| import com.datastax.driver.core.*; | |
| import com.datastax.driver.core.querybuilder.QueryBuilder; | |
| import org.apache.cassandra.exceptions.ConfigurationException; | |
| import org.apache.thrift.transport.TTransportException; | |
| import org.cassandraunit.utils.EmbeddedCassandraServerHelper; | |
| import org.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| import java.io.IOException; |
This file contains hidden or 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 python | |
| try: | |
| import rados | |
| import sys | |
| import hashlib | |
| import os | |
| except ImportError: | |
| raise ImportError('unable to import modules') | |
| sys.stderr.write("unable to import modules") |
This file contains hidden or 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 python | |
| try: | |
| import rados | |
| import sys | |
| import hashlib | |
| import argparse | |
| import os | |
| import logging | |
| except ImportError: |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| PUPPET_DIR="my-puppet-dir" | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| # config.vm.network "forwarded_port", guest: 80, host: 8080 | |
| # config.vm.network "private_network", ip: "192.168.33.10" |
This file contains hidden or 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
| --- | |
| :hierarchy: | |
| - roles/%{::irn_role} | |
| - common | |
| :backends: | |
| - yaml | |
| :merge_behavior: deeper | |
| :yaml: | |
| :datadir: '/puppet/hieradata/' |
This file contains hidden or 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
| public void putObject(final InputStream inputStream, final String objectName, final int bufferSize) throws Exception { | |
| int length = inputStream.available(); | |
| byte[] buffer = new byte[bufferSize]; | |
| int bytesRead; | |
| int offset = 0; | |
| logger.info("Copying file with objectName: {}", objectName); | |
| MessageDigest md = MessageDigest.getInstance("MD5"); | |
| while ((bytesRead = inputStream.read(buffer)) > 0) { | |
| md.update(buffer, 0, bytesRead); |
This file contains hidden or 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 python | |
| # -*- coding: UTF8 -*- | |
| import json | |
| import urllib2 | |
| def make_get_request(url, headers): | |
| req = urllib2.Request(url=url, headers=headers) | |
| return json.loads(urllib2.urlopen(req).read()) |
This file contains hidden or 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
| public class ReadVeryBigFile { | |
| public static void main(String[] args) throws Exception { | |
| Runtime runtime = Runtime.getRuntime(); | |
| NumberFormat format = NumberFormat.getInstance(); | |
| long startedMemory = runtime.freeMemory(); |
This file contains hidden or 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 python | |
| # Make sure the python-ldap module is installed | |
| # pip install python-ldap | |
| import ldap | |
| import ldap.sasl | |
| #Initialize your connection and force it to use TLS | |
| con = ldap.initialize('ldap://ldap.example.com') |