Every now and then you will be required to read or analyse video files on a server that is running on CentOS or you may be using it docker container. Here are the steps to install ffmpeg on your linux machine:
sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo yum update -y
sudo yum install ffmpeg ffmpeg-devel -y
If you haven’t used Hashicorp Vault till today, this post is for you.
So here are our tasks for this post:
- Setup Vault Server
- Add SSH keys to it
- Get key from the vault via a Go program
Note: All secrets/keys generated during this setup are for demo only.
Vault Server Setup:
[[email protected] ~]# mkdir -p /opt/hashicorp/vault
[[email protected] ~]# cd /opt/hashicorp/vault/
[[email protected] vault]# wget https://releases.hashicorp.com/vault/0.6.5/vault_0.6.5_linux_amd64.zip
[[email protected] vault]# unzip vault_0.6.5_linux_amd64.zip
Download the sample config from and store it as config in current directory: https://www.vaultproject.io/docs/config/
In the config you can use several backend modes and they are all listed on the above page in detail for this setup we will use the file backend with no HA. This means that all the data will be stored on the file system in a directory structure.
So my config looks like this:
Now lets start the server and send it to background:
Initialize the vault, please note that if you are not using tls you will need to export the environment variable with http before using the vault binary as the client:
Unseal the vault and authenticate, by using the keys that were generated for you:
Add SSH Key to Vault:
Once the server is unsealed, we can add our secrets to it, Lets generate an SSH key and save it in the vault for later:
Retrieve the Key in a Program/Script
You can use Go Hashicorp api package to connect to vault:
Output of the program:
This was demonstration of basic vault server setup and client authentication. There are many more different aspects to it. For further information please refer to vault documentation https://www.vaultproject.io/docs/concepts/index.html
You can install and setup Go with the following simple commands:
Recently I upgraded to Ubuntu 16.04 on my machine and just for curiosity I wanted to improve the boot time.
So to identify the slow services I used:
jahans:~# sudo systemd-analyze blame
18.944s docker.service (I create containers on servers, don't need to start on boot)
12.833s dev-sda8.device (Root Parition)
11.523s teamviewerd.service (Just used it one off, dont create a service for it!)
7.828s postfix.service (Good to have, but I don't send emails with spoofed addresses)
5.946s bluetooth.service (Never used it)
I went through the list and identified the services that I didn’t use on daily basis and improved the boot time significantly. So to disable the services I didn’t use I ran:
systemctl disable docker
systemctl disable teamviewerd
systemctl disable postfix
systemctl disable bluetooth
To understand the dependencies of the services you can also use the following for a graphical view:
sudo systemd-analyze plot > srv.test ; eog srv.test
– Do you use putty?
– Do you use vim?
– Do you “have to” use windows at times?
Well this post is for you. You must have found yourself in an annoying issue when you cant use num pad in vim. Fortunately you can fix that:
Open Putty window and in the configuration, go to Terminal->Features and check "Disable application keypad mode". Save the settings.
Now restart that session you were working with and enjoy vim!