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
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 |
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
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) |
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
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 |
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
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' |
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
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(); | |
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
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 |
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
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); |
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/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. |
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
# 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 |
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
# encode from binary file to base64txt | |
powershell -C "& {$outpath = (Join-Path (pwd) 'out_base64.txt'); $inpath = (Join-Path (pwd) 'data.jpg'); [IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath)))))}" | |
# decode from base64txt to binary file | |
powershell -C "& {$outpath = (Join-Path (pwd) 'outdata2.jpg'); $inpath = (Join-Path (pwd) 'out_base64.txt'); [IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath)))))}" |
OlderNewer