This file contains 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
#!/bin/bash | |
FILENAME=file-to-split.csv | |
HDR=$(head -1 ${FILENAME}) | |
split -l 100 ${FILENAME} xyz | |
n=1 | |
for f in xyz* | |
do | |
if [[ ${n} -ne 1 ]]; then | |
echo ${HDR} > part-${n}-${FILENAME}.csv | |
fi |
This file contains 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 bash | |
set -o xtrace -o errexit -o pipefail -o nounset | |
######################################################################################## | |
# CircleCI's current recommendation for roughly serializing a subset | |
# of build commands for a given branch | |
# | |
# circle discussion thread - https://discuss.circleci.com/t/serializing-deployments/153 | |
# Code from - https://github.com/bellkev/circle-lock-test |
This file contains 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
Wed May 31 07:42:00 UTC 2017 |
This file contains 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
#!/bin/bash | |
# Requires aws-cli and jq to be installed | |
# | |
# Returns the name and ami for each release that matches | |
aws ec2 describe-images --owners amazon --filters Name=virtualization-type,Values=hvm | jq '[.Images[] | select(.Name | startswith("amzn-ami-hvm")) | select(.Name | endswith("ebs")) | { name: .Name, ami: .ImageId } ] | sort_by(.name)' |
This file contains 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
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
This file contains 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
class NodeUpdateFromFile < ::Chef::Knife | |
deps do | |
require "chef/node" | |
require "chef/json_compat" | |
require "chef/knife/core/object_loader" | |
end | |
banner "knife node update from file FILE (options)" | |
def loader |
This file contains 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
#!/bin/bash | |
# | |
# Checks yum for updates and passes the count to collectd. | |
# | |
# Requriments: | |
# - collectd_exec_plugin | |
# - yum-plugin-security package | |
# | |
# <Plugin exec> | |
# Exec "nobody" "/path/to/yum_update.sh" |
This file contains 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
#!./bin/knife exec | |
# A knife exec script to change chef node's name, preserving all the attributes. | |
# | |
# Usage: knife exec rename-node.rb old-name new-name | |
# | |
# Script retrieves the Node object, changes its 'name' attribute, | |
# creates new Node object with updated name and rest of attributes | |
# untouched. Then it deletes old Node and Client objects from | |
# database, and logs into the server to update it: |
This file contains 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
gsettings set org.gnome.shell.extensions.auto-move-windows application-list "['banshee.desktop:2','chromium-browser.desktop:2','thunderbird.desktop:2','shotwell.desktop:2','sublime.desktop:3','virtualbox.desktop:4', 'empathy.desktop:2']" |
This file contains 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
[DEFAULT] | |
name=My Name | |
email=email@address.com | |
[work] | |
path=/media/drive/work | |
name=My Name | |
email=email@address.com | |
[play] | |
path=/media/drive/play | |
name=My Other Name |
NewerOlder