Skip to content

Instantly share code, notes, and snippets.

Baurzhan Konurbayev baurzhan-konurbayev

Block or report user

Report or block baurzhan-konurbayev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example.rb
# recipe1.rb, which I am writing test for
powershell_script "Check if service needs to be restarted" do
code XXXX
notifies :restart, windows_service[resource_from_other_collection], :delayed
action :run
end
# recipe2.rb, which I am writing test for
windows_service "resource_from_other_collection" do
action :nothing
View git-pre-receive-hook.sh
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.
View gist123.java
public List<Evaluation> findEvaluationsAssignedToUser(String login, Integer tenderId, Integer proposalId) {
Connection connection = null;
PreparedStatement preparedStatement = null;
List<Evaluation> evaluations = new ArrayList<>();
System.out.println("from EvaluationDaoImpl findEvaluationsAssignedToUser start" + evaluations);
try {
System.out.println("from findEvaluationsAssignedToUser page login" +login+" tenderId "+ tenderId+" proposalId "+proposalId);
connection = ConnectionPool.getInstance().getConnection();
preparedStatement = connection.prepareStatement(PREPARED_STATEMENT_EVALUATION_FIND_BY_USER);
preparedStatement.setString(1, login);
View chef reading
https://github.com/facebook/chef-cookbooks/blob/master/README.md
https://github.com/facebook/chef-utils/blob/master/Philosophy.md
Example cookbook: https://github.com/facebook/chef-cookbooks/tree/master/cookbooks/fb_cron
View java task 8
import java.util.Random;
public class ConnectDemo {
public static void main(String[] args) {
ConnectionManager connMngr =new ConnectionManager();
connMngr.createConnection();
connMngr.createConnection();
connMngr.createConnection();
connMngr.createConnection();
View stove 5 gem version error
Stove experienced an error!
E: ArgumentError
E: wrong number of arguments (2 for 1)
E: /home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook/metadata.rb:60:in `gem'
/opt/chefdk/chef-repo/cookbooks/sys_dns/metadata.rb:18:in `from_file'
/home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook/metadata.rb:160:in `instance_eval'
/home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook/metadata.rb:160:in `from_file'
/home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook/metadata.rb:28:in `from_file'
/home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook.rb:112:in `load_metadata!'
/home/baurzhan/.chefdk/gem/ruby/2.1.0/bundler/gems/stove-942341752e19/lib/stove/cookbook.rb:57:in `initialize'
View gist:19b19205e8d4f2fb9305e36f9055c218
def install_gem(gem_name, gem_source, gem_version, gem_options, gem_compile_time)
# Chef::Log.warn("gem_name #{gem_name} gem_version #{gem_version} gem_source #{gem_source}")
# Install gem from private gem server
res = Chef::Resource::ChefGem.new gem_name, run_context
res.clear_sources true
res.compile_time gem_compile_time
res.options if gem_options
res.version gem_version
res.source gem_source
res.run_action :install
View gist:8be138b93bfac481de9888d8d93fd9c5
ohai 'reload' do
action :nothing
end.run_action(:reload)
cookbook_file '/opt/ohai/plugins/openstack_v2.rb' do
mode '0755'
notifies :reload, 'ohai[reload]', :immediately
source 'ohai.openstack_v2.rb'
action :nothing
end.run_action(:create)
View gist:2a06fd14ec3a3e838a150ccba3f110e1
sys_dns hostname do
provider "sys_dns_#{node[:ebet][:cluster_dns]}"
ip_address endpoint_connection('sys_dns)
hostname external_hostname
zone node[:sys][:host_domain]
comment 'Host Servername'
action :append
end
You can’t perform that action at this time.