- Make sure the server is configured with an appropriate hostname that resolves to itself (add hosts entry if needed)
- Download and install Chef server package from: http://downloads.chef.io/chef-server/
chef-server-ctl reconfigure
chef-server-ctl user-create admin Chef Administrator jcotton@bitlancer.com <password> --filename /tmp/admin.pem
chef-server-ctl org-create <org-short-name> "<org-full-name>" --association_user admin --filename /tmp/validator.pem
- Use OpenSSL to generate a new cert and key and update:
/var/opt/opscode/nginx/ca/<fqdn>.key
,/var/opt/opscode/nginx/ca/<fqdn>.crt
. Restart services (nginx) with:chef-server-ctl restart
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
cat >index.http <<EOF | |
HTTP/1.1 200 OK | |
Content-Type: text/html; charset=UTF-8 | |
Server: netcat! | |
<!doctype html> | |
<html><body><h1>A webpage served by netcat</h1></body></html> | |
EOF | |
while true; do cat index.http | nc -l 8000; done |
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 | |
if [ -z "$1" ]; then | |
echo "An input file is required" | |
echo "usage: $0 <input-file>" | |
exit 1 | |
fi | |
files=$(cat $1) | |
for f in $files; do |
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
# Install dependencies | |
apt-get update; apt-get install -y build-essential ruby2.5-dev | |
gem install bundler --version 1.16.1 | |
# Install fluentd | |
mkdir /opt/fluentd | |
pushd .; cd /opt/fluentd | |
cat <<EOD > Gemfile | |
source "https://rubygems.org" |
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 | |
services="" | |
page_token="" | |
while true; do | |
results=$(aws resourcegroupstaggingapi get-resources --tags-per-page 500 --pagination-token="$page_token") | |
more_services=$(echo "$results" | egrep -o 'arn:aws:([a-z]+):' | cut -d: -f 3 | sort | uniq) | |
services=$(echo -e "$services\n$more_services" | sort | uniq) |
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
knife search node '*' -a chef_packages.chef.version | grep "chef_packages.chef.version" | cut -d" " -f4 | sort | uniq |
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
add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | |
wget --quiet -O - https://postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
apt-get update | |
apt-get install postgresql-server-dev-9.4 | |
apt-get install python-pip python-dev | |
pip install --upgrade pip | |
pip install psycopg2 | |
apt-get install build-essential autoconf |
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
# Database size | |
SELECT table_schema "Data Base Name", | |
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", | |
sum( data_free )/ 1024 / 1024 "Free Space in MB" | |
FROM information_schema.TABLES | |
GROUP BY table_schema ; | |
# Size of each non-primary index | |
SELECT database_name, table_name, index_name, | |
round(stat_value*@@innodb_page_size/1024/1024, 2) size_in_mb |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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/Bitlancer/puppet-cloudfuse | |
https://github.com/Bitlancer/puppet-motd | |
https://github.com/Bitlancer/puppet-openldap | |
https://github.com/Bitlancer/puppet-sssd | |
https://github.com/Bitlancer/puppet-tomcat | |
https://github.com/Bitlancer/puppetlabs-apache | |
https://github.com/Bitlancer/strings-dashboard | |
https://github.com/Bitlancer/strings-datasync | |
https://github.com/Bitlancer/strings-deploy-toolkit | |
https://github.com/Bitlancer/strings-documentation |
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 | |
cookies="JSESSIONID.8d49441c=1xzuqo2mhtku1pq2q7kvffeud; JSESSIONID.b502a53a=19uzmrp8ggsplp44mageiqqq7; JSESSIONID.6accbce3=zkbcn2gy1qye1h89aan7o6zog; JSESSIONID.b1204f00=11rs98x2idnf01woxy79tmx7ev; hudson_auto_refresh=false; screenResolution=1440x900" | |
base_url="https://jenkins.example.com" | |
while read -r slave_name; do | |
curl -v --cookie "$cookies" "$base_url/computer/$slave_name/doDelete" | |
[ $? ] || exit 1 | |
done < $1 |