While working with terraform you would have noticed that every time you execute a terraform plan it will download the latest version of terraform available for that provider.
While this is good if you are testing as you get the latest features but, it can create trouble in production if a buggy version gets deployed. So, it is always recommended that you lock down the version of provider. In this post we will show you how to do that.
It’s really very simple to lock down the provider version. You just have to add a snippet like below in your main.tf file .
In the above example we have specified that version 2.6.0 or older can be used.
The version argument value may either be a single explicit version or a version constraint string. Constraint strings use the following syntax to specify a range of versions that are acceptable:
>= 2.4.0: version 2.4.0 or newer
<= 2.4.0: version 2.4.0 or older
~> 2.4.0: any non-beta version >= 2.4.0 and < 2.5.0, e.g. 2.4.X
~> 2.4: any non-beta version >= 2.4.0 and < 3.0.0, e.g. 2.X.Y
>= 2.0.0, <= 3.0.0: any version between 2.0.0 and 3.0.0 inclusive
Give it a try and let us know if you have any query or suggestion.
Terraform is a very useful tool for IaaS. As you would have already known that it create a .tfstate file to save the status of infra. If you are doing testing you can save the .tfstate locally on your laptop. But, if you are working in prod environment with team then it’s best that you save the .tfstate remotely so that it’s secure and can be used by other team members.
Here we will show you two ways of configuring AWS S3 as backend to save the .tfstate file.
First way of configuring .tfstate is that you define it in the main.tf file. You will just have to add a snippet like below in your main.tf file.
The latest version of python is shipped with pip. But, if you are using older version of python 2(<2.7.9) or python 3(<3.4) and still need pip on windows please follow the instruction below.
If pip is not installed or the path is not set correctly you will get an error like below while invoking it in windows command prompt.
pip install sklearn
'pip' is not recognized as an internal or external command,
operable program or batch file.
Here are the steps to get pip in your windows box.
Download get-pip.py . Copy and paste the contents of the link in a notepad and save it as get-pip.py, remember not in .txt format but .py format.
Next install it.
Find the recently installed pip.exe in your machine. It’s generally in C:\Python27\Scripts or similar folder depending on the python version you installed. You can set the path variable in windows using these instructions.
– Search for “Advanced System Settings” in your windows machine.
– Click on the tab “Advanced”. In it click on Environment Variables.
– In the new window click on System Variables. Select “Path” and click on “Edit”.
– Click on new and enter C:\Python27\Scripts\ in the space.
– Finally click ok to all windows and re-open command prompt.
If you have followed the instructions correctly you will now be able to install packages using pip.
pip install sklearn
That’s all you need to install pip in windows.
Tip:- Some people make mistake of executing pip from Python interpreter and get the below error.
nc is a swiss knife kind of tool. It comes with very useful options. You can explore the below options also.
Forces nc to use IPv4 addresses only.
Forces nc to use IPv6 addresses only.
Enable debugging on the socket.
Do not attempt to read from stdin.
Prints out nc help.
Specifies a delay time interval between lines of text sent and received. Also causes a delay time between connections to multiple ports.
Forces nc to stay listening for another connection after its current connection is completed. It is an error to use this option without the –l option.
Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host. It is an error to use this option in conjunction with the –p , –s , or –z options. Additionally, any timeouts specified with the –w option are ignored.
Do not do any DNS or service lookups on any specified addresses, hostnames or ports.
Specifies the source port nc should use, subject to privilege restrictions and availability. It is an error to use this option in conjunction with the –l option.
Specifies that source and/or destination ports should be chosen randomly instead of sequentially within a range or in the order that the system assigns them.
Enables the RFC 2385 TCP MD5 signature option.
Specifies the IP of the interface which is used to send the packets. It is an error to use this option in conjunction with the –l option.
Specifies IP Type of Service (ToS) for the connection. Valid values are the tokens “lowdelay”, “throughput”, “reliability”, or an 8-bit hexadecimal value preceded by “0x”.
Causes nc to send RFC 854 DON’T and WON’T responses to RFC 854 DO and WILL requests. This makes it possible to use nc to script telnet sessions.
Specifies to use Unix Domain Sockets.
Use UDP instead of the default option of TCP.
Have nc give more verbose output.
If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed. The –w flag has no effect on the –l option, i.e. nc will listen forever for a connection, with or without the –w flag. The default is no timeout.
Requests that nc should use the specified protocol when talking to the proxy server. Supported protocols are “4” (SOCKS v.4), “5” (SOCKS v.5) and “connect” (HTTPS proxy). If the protocol is not specified, SOCKS version 5 is used.
Requests that nc should connect to hostname using a proxy at proxy_address and port. If port is not specified, the well-known port for the proxy protocol is used (1080 for SOCKS, 3128 for HTTPS).
Specifies that nc should just scan for listening daemons, without sending any data to them. It is an error to use this option in conjunction with the –l option.
Many people have asked us how to become a DevOps engineer so in this post we will show you the skills and technologies which can get you there.
Before we start we should know what is “DevOps”. As you can see the word is combination of “Developer” and “Operations”. So a DevOps engineer is suppose to be a bridge between the development and operations processes.
Let’s see which skills do you need to become a DevOps engineer. In this post we will also discuss how you can acquire these skills for free. We have also mentioned some advanced paid courses which can help you acquire these skills quickly.
Skill 1 :- Make Linux your friend.
Nowadays whole world is moving towards opensource, and Linux is the poster boy of opensource world. Most of the new enterprise level tools and services are now compatible with Linux and people are adopting them fast. So, as a devops engineer you will definitely have to work on/with linux in your job. Even Microsoft has come up with their own Linux version. So, you can understand the importance of Linux. You can learn Linux for free from Linux Foundation courses. But, if you are short of time you can quickly learn Linux through this course Learn Linux in 5 days .
Skill 2 :- Learn scripting
Automation is a big part of a DevOps engineer job and you will be expected to automate mundane tasks. This will not only help you work efficiently but also improve the overall maintainability of your company’s setup. Easiest way to automate things is through scripting. You should learn either shell scripting on Linux/Unix or powershell on windows. Free source to learn scripting is Learn Shell. Else, you can check out this around 6 hours course on Shell Scripting to solve real-world problems like a pro.
Skill 3 :- Understand the Cloud
Companies are shifting to cloud like never before. Applications are being re-built to leverage the advantage of cloud computing. So it’s always good that you know cloud really well. AWS, Azure and GCP are three market leaders and it will be good to know about at least one of them. All these vendors have tons of free material on their sites which can help you learn their technology. Else you can checkout these awesome Udemy courses for AWS, Azure or GCP .
Skill 4:- Source code Management
Tools like git are used to manage the version of code base and avoid any conflicts in code. As a devops engineer you should have good understanding of tools like git or bitbucket since they will be useful in build phase. Later you will use them to build a codepipeline. One of the good source to learn git for free is Try Git. To become zero to hero of Git in hours, one of the best course is Git complete.
Skill 5 :- Configuration management
Configuration management is used to manage the state of your infrastructure. You can use them to patch your linux servers or manage the services. Some of the tools in config management are Ansible, Chef and Puppet. To get basic understanding of Ansible the best free course is from Redhat called Ansible essentials. If you want to get deeper understanding you can try Mastering Ansible.
CI/CD is an important aspect in DevOps engineers job profile. As we are moving towards cloud automated deployments are now essential. They avoid human errors and are fast. You can learn tools like Jenkins for CI/CD. Jenkins will specially be very useful in building a codepipeline, you can learn it for free here. Since CI/CD consists of multiple tools we think that it’s better you learn it from a single source. We found course from Edward Learn Devops: Continuously Deliver Better Software to have covered most of the topics.
Skill 7 :- Infra as a Code
The latest “in thing” in cloud is Infra as a Code. Yes you read it right, gone are the days where you have to buy the server, install OS and other softwares on it. With tools like Terraform or Cloudformation you can automate the build of your entire infrastructure in cloud right from VPC, Security groups, servers etc. to application installation and configuration. To get basic free understanding of terraform you can learn it from Katacoda . If you want to deploy AWS Infrastructure using Terraform we found Edward’s another course on Terraform to be really useful. For cloudformation we found the free AWS cloudformation tutorials to be useful. If you are looking for advance practical guidance AWS CloudFormation Master Class is a good course.
Skill 8:- Containers
Servers are now shrinking every day. With the advent of VMs, hardware anyways became less important. Dockers, a containerization technology is taking it to one level up. Now with Dockers you can have a miniature copy of your OS image with the application code. Docker will only run for a few mili seconds when a query is executed and once it’s job is done it will just stop. If you want to learn Docker for free the best source is Play with Docker Classroom. To gain more advanced skills you can learn from Docker Mastery.
Skill 9 :- Container orchestration
Tools like Kubernetes or Elastic container service (ECS) are used to manage cluster of Docker containers. These tools provides you mechanisms for deploying, maintaining, and scaling application. You can learn about Kubernetes with practical labs for free from Katacoda. For advanced knowledge of Kubernetes try the complete Kubernetes course.
Skill 10 : – Serverless
Technologies like AWS lambda are removing the need to manage the servers at all. You just have to upload you code in the AWS Lambda and set your run time environment. Rest all the issues of memory, CPU, OS patching will be taken care by AWS Lambda. It’s important as a DevOps engineer that you understand how the lambda works and how you can set it up. You can learn about AWS Lambda for free from this AWS Lambda Tutorial. For more advanced real world example you can refer how to build a serverless App with AWS Lambda .
We hope this post is helpful to you in understanding the skills which are important for a DevOps engineer and how you can master these skills. You can expect questions related to these skills in the interview of a DevOps Engineer.
In this post we will see how to start or stop Jenkins on different Linux distributions. Also we will see how to check the status of Jenkins service and identify the port on which it is running or listening.
If you have installed Jenkins on a Fedora or Debian based distribution like Ubuntu, you can use the below commands:
$ sudo service jenkins start
$ sudo service jenkins stop
$ sudo service jenkins restart
Check Jenkins status
$ sudo service jenkins status
For other Linux distribution like RHEL or CentOS use:
$ sudo systemctl start jenkins.service
$ sudo systemctl stop jenkins.service
$ sudo systemctl restart jenkins.service
Check Jenkins status
$ sudo systemctl status jenkins.service
Check Jenkins Port
To check the port on which Jenkins is listening we can use “lsof”(check installation instructions at the end) command.
In this post we will see how to change the disk label from EFI to SMI in a Solaris server.
Before you decide to change the disk label ensure that the disk doesn’t have any important data. If needed take backup of the disk. As during label change all the data will be removed from the disk.
We will use “format -e” command to change the label on disk.
root@cldvds# format -e c0t6006023764A62A00C5H174886B5BC267d0
 SMI Label
 EFI Label
Specify Label type: 0
Auto configuration via format.dat[no]?
Auto configuration via generic SCSI-2[no]?
Geometry: 256 heads, 10 sectors 40960 cylinders result in 104857600 out of 104857600 blocks.
Do you want to modify the device geometry[no]? yes
The disk partition should now change from 0 to 9 slices(EFI) to 0 to 7 slices (SMI).
If you want to change from SMI to EFI you can follow the same steps and instead of choosing option 0 choose option 1.
That’s all folks! Do comment if you have any concern or query!