Skip to main content

Posts

Showing posts from September, 2017

Google sheets shortcut

Common actions Select column Ctrl + Space Select row Shift + Space Select all Ctrl + a Ctrl + Shift + Space Undo Ctrl + z Redo Ctrl + y Ctrl + Shift + z F4 Find Ctrl + f Find and replace Ctrl + h Fill range Ctrl + Enter Fill down Ctrl + d Fill right Ctrl + r Save (every change is saved automatically in Drive) Ctrl + s Open Ctrl + o Print Ctrl + p Copy Ctrl + c Cut Ctrl + x Paste Ctrl + v Paste values only Ctrl + Shift + v Show common keyboard shortcuts Ctrl + / Insert new sheet Shift + F11 Compact controls Ctrl + Shift + f Input tools on/off (available in spreadsheets in non-Latin languages) Ctrl + Shift + k Select input tools Ctrl + Alt + Shift + k Format cells Bold Ctrl + b Underline Ctrl + u Italic Ctrl + i Strikethrough Alt + Shift + 5 Center align Ctrl + Shift + e Left align Ctrl + Shift + l Right align Ctrl + Shift + r Apply top border Alt + Shift + 1 Apply right border Alt + Shift + 2 Apply bottom border Alt + Shift + 3 Apply left border Alt + Shift + 4 Remove borders Alt + Shif

Saltstack and Vault integration

First install and configure vault using this tutorial: https://apassionatechie.wordpress.com/2017/03/05/hashicorp-vault/ Use the latest version of vault. Then install salt using the steps given here: https://docs.saltstack.com/en/latest/topics/installation/ If you face any issues then refer these links: https://apassionatechie.wordpress.com/2017/07/31/salt-issues/ https://apassionatechie.wordpress.com/2017/08/03/salt-stack-formulas/ Now let's integrate vault and salt so that we can access vault secrets from inside salt state. First let's add some key values into our vault. vault write secret/ssh/user1 password="abc123" Then you can check it by reading: vault read secret/ssh/user1 To allow salt to access your secrets you must firstly create a policy as follows: salt-policy.hcl [code] path "secret/*" { capabilities = ["read", "list"] } path "auth/*" { capabilities = ["read", "list","sudo",&q

Hashicorp Consul Installation on Centos 7

Consul must first be installed on your machine. Consul is distributed as a  binary package  for all supported platforms and architectures. This page will not cover how to compile Consul from source, but compiling from source is covered in the  documentation  for those who want to be sure they're compiling source they trust into the final binary. Installing Consul To install Consul, find the  appropriate package  for your system and download it. Consul is packaged as a zip archive. After downloading Consul, unzip the package. Consul runs as a single binary named  consul . Any other files in the package can be safely removed and Consul will still function. The final step is to make sure that the  consul  binary is available on the  PATH . See  this page  for instructions on setting the PATH on Linux and Mac.  This page  contains instructions for setting the PATH on Windows. Verifying the Installation After installing Consul, verify the installation worked by opening a new terminal se

Chef: Overview

Chef is a powerful automation platform that transforms infrastructure into code. Whether you’re operating in the cloud, on-premises, or in a hybrid environment, Chef automates how infrastructure is configured, deployed, and managed across your network, no matter its size. This diagram shows how you develop, test, and deploy your Chef code. The workstation is the location from which users interact with Chef. On the workstation users author and test  cookbooks  using tools such as  Test Kitchen  and interact with the Chef server using the  knife  and  chef command line tools. Nodes are the machines—physical, virtual, cloud, and so on—that are under management by Chef. The chef-client is installed on each node and is what  performs the automation on that machine . Use the Chef server as your foundation to create and manage flexible, dynamic infrastructure whether you manage 50 or 500,000 nodes, across multiple datacenters, public and private clouds, and in heterogeneous environments

Chef: Services

The  service-list  subcommand is used to display a list of all available services. A service that is enabled is labeled with an asterisk (*). This subcommand has the following syntax: $ chef-server-ctl service-list The output will be as follows: bookshelf* nginx* oc_bifrost* oc_id* opscode-chef-mover* opscode-erchef* opscode-expander* opscode-pushy-server* opscode-reporting* opscode-solr4* postgresql* rabbitmq* redis_lb* bifrost ¶ The  oc_bifrost  service ensures that every request to view or manage objects stored on the Chef server is authorized. status ¶ To view the status for the service: $ chef-server-ctl status bifrost to return something like: $ run: bifrost: ( pid 1234 ) 123456s ; run: log: ( pid 5678 ) 789012s start ¶ To start the service: $ chef-server-ctl start bifrost stop ¶ To stop the service: $ chef-server-ctl stop bifrost restart ¶ To restart the service: $ chef-server-ctl restart bifrost to return something like: $ ok: run: bifrost: ( pid 1234 ) 1234s kill ¶ To kill

Chef: ChefDK

Create a linux machine, login into it and execute the following command: curl -s https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chefdk Now we need to change the default ruby to point it to the chef ruby and not the system ruby. Execute the following command for it. echo 'eval "$(chef shell-init bash)"' >> ~/.bash_profile Note: eval  is part of POSIX. Its an interface which can be a shell built-in.Its described in the "POSIX Programmer's Manual":  http://www.unix.com/man-page/posix/1posix/eval/ eval - construct command by concatenating arguments It will take an argument and construct a command of it, which will be executed by the shell. This is the example of the manpage: 1 ) foo = 10 x = foo 2 ) y = '$' $x 3 ) echo $y 4 ) $foo 5 ) eval y = '$' $x 6 ) echo $y 7 ) 10 In the first line you define  $foo  with the value  '10'  and  $x  with the value  'foo' . Now define  $y , which consists

Chef: Test Kitchen

Install docker with the following command: yum install docker systemctl start docker Then we need to install the kitchen-docker ruby gem. chef gem install kitchen-docker Create a cookbook: chef generate cookbook my_cookbook Edit the .kitchen.yml file in the generated cookbook. Change the driver name from vagrant to docker and delete the line - name: centos-7 Save and close. Then execute kitchen converge . This command will create a docker container for us and put all the settings in place. The output will be something as follows: Synchronizing Cookbooks: - my_cookbook (0.1.0) Installing Cookbook Gems: Compiling Cookbooks... Converging 0 resourcesRunning handlers: Running handlers complete Chef Client finished, 0/0 resources updated in 18 seconds Finished converging <default-ubuntu-1604> (7m3.52s). Then run kitchen list The output will be something as follows: Instance Driver Provisioner Verifier Transport Last Action Last Error default-ubuntu-1604 Docker ChefZero Ins

Chef: Roles and Environments

Bootstrap another node with your chef-server. If you get the following error: Failed to read the private key /etc/chef/validation.pem: # In the same error logs you will see a line: Delete your validation key in order to use your user credentials instead Please check that you don't have any validation.pem key in /etc/chef, if any, then delete it. You can verify by executing one of the following: knife client list knife node show chef-node2 Create a new cookbook postgresql: chef generate cookbook cookbooks/postgresql Edit cookbooks/postgresql/recipes/default.rb [code] package 'postgresql-server' do notifies :run, 'execute[postgresql-init]' end execute 'postgresql-init' do command 'postgresql-setup initdb' action :nothing end service 'postgresql' do action [:enable, :start] end &amp;amp;lt;span data-mce-type="bookmark" id="mce_SELREST_start" data-mce-style="overflow:h