Skip to content

Instantly share code, notes, and snippets.

View kuleszaj's full-sized avatar

Justin Kulesza kuleszaj

  • Grand Rapids, MI
View GitHub Profile
@kuleszaj
kuleszaj / cli-input-json.js
Created April 18, 2017 01:56
AWS ECS Register Task Definition JSON
{
"family": "my-ecs-task",
"placementConstraints": [],
"volumes": [
{
"host": {
"sourcePath": "/mnt/efs/dir1"
},
"name": "uploads"
},
@kuleszaj
kuleszaj / template.yml
Created April 18, 2017 01:38
AWS CloudFormation template including EFS mount script.
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard
Parameters:
EcsClusterName:
Type: String
Description: >
Specifies the ECS Cluster Name with which the resources would be
@kuleszaj
kuleszaj / ubuntu_autologin_with_sharing.sh
Created February 5, 2013 15:45
Setup auto-login with desktop-sharing Ubuntu
# Your ubuntu user
TARGET_USER="me"
# Your X Display
export DISPLAY=:0.0
grep "autologin" /etc/lightdm/lightdm.conf || sudo /bin/bash -c 'echo -e "autologin-user=$TARGET_USER\nautologin-timeout=0" >> /etc/lightdm/lightdm.conf'
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false
@kuleszaj
kuleszaj / break_out_of_frames.html
Last active December 11, 2015 17:38
Cause a website to break out of any frames it may be embedded in.
<script type="text/javascript">
if (top.frames.length!=0)
top.location=self.document.location;
</script>
namespace :bootstrap do
task :default do
system("knife bootstrap -d chef-solo -x #{user} --sudo #{server_ip}")
end
end
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
exists() {
if command -v $1 &>/dev/null
then
return 0
else
return 1
fi
namespace :chef do
task :default do
# Tar up Chef Cookbooks and Roles
system("tar czf 'chef.tar.gz' -C chef/ .")
# Upload
upload("chef.tar.gz","/home/#{user}",:via => :scp)
# Remove existing Chef dir to avoid conflicts...
run("rm -rf /home/#{user}/chef")
run("mkdir -p /home/#{user}/chef")
# Untar new Chef Cookbooks and Rols
set :chef_binary, "/usr/bin/chef-solo"
set :user, "atomic"
server "10.0.0.5", :chef, :no_release => :true
set :server_ip, "10.0.0.5"
{ "run_list": [ "role[mysql]" ] }
root = File.absolute_path(File.dirname(__FILE__))
file_cache_path root
cookbook_path root + '/cookbooks'
role_path root + '/roles'