Skip to content

Instantly share code, notes, and snippets.

#@ load("@ytt:data", "data")
#@ load("consts.star", "version", "comment")
#@ def cpus(n):
#@ return str(n)+"m"
#@ end
#@ def memorys(n):
#@ return "{}Mi".format(n)
#@ end
@ggolin
ggolin / .gitlab-ci.yaml
Created July 15, 2020 04:20 — forked from woodcockjosh/.gitlab-ci.yaml
CI+CD pipeline for k8s nodejs deployment with helm
stages:
- test
- docker-build
- version-push
- deploy
variables:
BUMP_VERSION_MESSAGE: "[bump version]"
CD_TO_DEV1_FROM_MASTER: "true"
cdk8s synth
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pipenv/core.py", line 1636, in system_which
assert c.return_code == 0
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 8, in <module>
# This will use osd.5 as an example
# ceph commands are expected to be run in the rook-toolbox
1) disk fails
2) remove disk from node
3) mark out osd. `ceph osd out osd.5`
4) remove from crush map. `ceph osd crush remove osd.5`
5) delete caps. `ceph auth del osd.5`
6) remove osd. `ceph osd rm osd.5`
7) delete the deployment `kubectl delete deployment -n rook-ceph rook-ceph-osd-id-5`
8) delete osd data dir on node `rm -rf /var/lib/rook/osd5`
@ggolin
ggolin / GitHub-Forking.md
Created October 16, 2017 17:41 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@ggolin
ggolin / gist:6115568
Last active December 20, 2015 10:30
# resources/foo.rb
attribute :x, :kind_of => String, :default => nil
# providers/foo.rb
x = new_resource.x.nil? ? new_resource.name : new_resource.x
# providers/bar.rb
foo new_resource.name do
x "foobar"
end
#!/usr/bin/ruby
kmodule = 'ixgbe'
modules = '/proc/modules'
min_version = '3'
exit_code = 0
kmodule_version = %x{ modinfo -F version #{kmodule} } if %x{ grep #{kmodule} #{modules} }.to_str[/#{kmodule}/]
unless kmodule_version.nil?
puts "<<<#{kmodule}_version>>>"
/bin/su -c pg_dump --compress=9 \
-Fc -T 'rpuid_*.custom_codetree_*_*' \
-T 'rpuid_*.custom_file_*_*' \
-T 'rpuid_*.custom_rawdiscoveryprofile_*_*' \
-T 'rpuid_*.custom_compressedrawdiscoveryprofile_*_*' \
-f mydb.dump mydb
2012-03-16 12:58:03 PDT postgres mydb LOG: 00000: duration: 0.137 ms statement: SET escape_string_warning = off;
2012-03-16 12:58:03 PDT postgres mydb LOCATION: exec_simple_query, postgres.c:1068
2012-03-16 13:02:42 PDT LOG: 00000: checkpoint starting: time
2012-03-16 13:02:42 PDT LOCATION: LogCheckpointStart, xlog.c:6276
2012-03-16 13:02:42 PDT LOG: 00000: checkpoint complete: wrote 4 buffers (0.0%); 0 transaction log file(s) added, 0 removed, 0 recycled; write=0.614 s, sync=0.000 s, total=0.614 s
execute "create mongodb admin user" do
command %Q{mongo admin --eval "db.addUser('#{node.mongodb.admin}', '#{node.mongodb.admin_password}')" }
not_if %Q{echo 'show users' | mongo -u #{node.mongodb.admin} -p #{node.mongodb.admin_password} admin | grep #{node.mongodb.admin} }
end
execute "create mongodb user" do
command %Q{mongo #{node.graylog2.database} --eval "db.addUser('#{node.mongodb.user}', '#{node.mongodb.password}')" }
not_if %Q{echo 'show users' | mongo -u #{node.mongodb.user} -p #{node.mongodb.password} #{node.mongodb.database} | grep #{node.mongodb.user} }
end