Skip to content

Instantly share code, notes, and snippets.

View DmZ's full-sized avatar

Dmitry Zamaruev DmZ

  • Ukraine, Kharkiv
View GitHub Profile
@DmZ
DmZ / makeOSXiso.sh
Created January 17, 2020 14:15 — forked from wrossmck/makeOSXiso.sh
Convert Downloaded El Capitan.app to bootable iso
#!/bin/bash
#taken from http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J
@DmZ
DmZ / app1.yml
Last active August 29, 2015 14:11
Version dependency example (platform v35)
application:
configuration:
input.app1-initial: "1"
interfaces:
input:
app1-initial: bind(app1-init#input.app1-initial)
vms:
ips: bind(internal-mux#vms.ips)
init:
get-version: bind(app1-init#actions.get-version)
@DmZ
DmZ / hier.yaml
Created November 21, 2014 14:32
Pool resources example
application:
bindings:
- [vms, component1]
- [vms, component2]
- [component1, component2]
components:
vms:
type: workflow.Instance
interfaces:
result:
@DmZ
DmZ / 10gen.repo
Created September 23, 2014 09:21
10gen repo
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
@DmZ
DmZ / pre-commit
Last active July 25, 2023 13:40
Git pre-commit hook to search for Amazon AWS API keys.
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@DmZ
DmZ / override_attrs.rb
Last active December 15, 2015 06:59
Allow override normal attributes passed by command line to chef-solo. Put to libraries/ folder of your cookbook.
#
# Load attributes from local file
# overriding/merging with command line attributes
#
require 'chef/run_context'
class Chef::RunContext
alias_method :original_load_attributes, :load_attributes
@DmZ
DmZ / python.py
Created December 12, 2012 10:11
Original: http://code.google.com/p/python-simple-fileserver/ (Updated for Python 2.4)
#!/usr/bin/env python
# Copyright Jon Berg , turtlemeat.com
# Modified by nikomu @ code.google.com
# Updated for Python 2.4 ([email protected])
# Usage example:
# start server in required directory: python serve.py
# upload file to server: curl -F "[email protected]" http://127.0.0.1:8080/
@DmZ
DmZ / s3sign.rb
Created November 13, 2012 19:57
Simple S3 signing for expiring URLs (Ruby)
#!/usr/bin/env ruby
require 'time'
require 'uri'
require 'cgi'
require 'base64'
require 'openssl'
expires = Time.now().to_i + Integer(ARGV[0])
url = URI.parse(ARGV[1])
access_key = ENV["AWS_ACCESS_KEY_ID"]
@DmZ
DmZ / s3sign.py
Created November 13, 2012 18:39
Simple S3 signing for expiring URLs
#!/usr/bin/env python
import os
import sys
import hmac
import time
import urllib
import base64
import hashlib
import urlparse