HTTPS Connections counting

Here is how one can setup a nginx to count the https connections made.

Preparation

Create a new folder

Put a dummy entry in your /etc/hosts file

Steps

First generate certificate

create a new file something.conf with the following content

Then run the docker with

Get the cacert

And finally do some connections

 

Code without abbrivations

My son is learning his computer language and yesterday he asked me what do the method Intn(n Int) – I can’t answer.

Here are some very popular examples

  • dev > development
  • prod > production
  • ctx, ctx > context vs
  • obj > object

We are still in the dark ages of the computer programming. The evidence is that huge companies afford to give examples in their documentation with hackish examples.

 

Hackish AWS example

Running chef test-kitchen with newer vagrant

If you get

This means that the virtual machine needs a shorter name for the VM.

Bonus tip:

If you get

Then remove all gems and reinstall chefdk.

Export database tables, fields comments as markup with Ruby on Rails

When you have to export the comments from the database you can use this short snippet to get the schema as markup.

The output should be something like

Table name

table description

column name, type, description

….. the next table

Running chef kitchen with cookbook dependencies

Berksfile

metadata.rb

 

Restrict /manage or /admin in Rails

You can do it from the Ruby on Rails application or even better way is to do it where you define your infrastructure and configure your proxy/loadbalancer etc. to allow it.

 

mdadm: Duplicate MD device names in conf file where found.

remove the doublicate file from /etc/mdadm/mdadm.conf

Make sure the raid is up

Load the lvm volumes

  • -a – activate
  • -y – complete

exit to try the changes

Now you system will boot

Making the changes permanent

Fix the /etc/mdadm/mdadm.conf file by removing the duplicate definition.

If you are still in initramfs busybox

Cheat

mdadm –detail /dev/md0 mdadm –detail /dev/md1

mdadm –detail –scan > /etc/mdadm/mdadm.conf

Stop an array & assemble array mdadm –stop /dev/md1

mdadm –assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 mdadm –assemble /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2

 

38693387_2127079967530580_4018998239729549312_n (1)

Run kitchen with vaults

Way of testing kitchen with vaults

608bhtga3m_5v2so6hi74_vc102292

copy your data_bags/ and decrypted vaults/ content in a new folder containing the merged content from both folders.

Do not forget to add data_bags_test folder in .git_ignore.

 

image from www.wannapik.com

Online conference software aka meetings

If you want your developers and stuff to be happy please AVOID webex !

Webex is bad service

It has bad International connection. It doesn’t run on linux or unix and can’t be run in a browser. The IOS application is bad and doesn’t integrate with the links. The integration with the website and the calendars is bad. The website is slow and buggy and you can’t see the meeting on which you are invited. It is the worst of the software out there.

Zoom – It is like the webex. They look and feel the same one idea better, because it has client which can run in linux

Good one

https://www.bluejeans.com/ – works perfectly!

http://appear.in – free and great!

 

Sending a bunch of data to Zabbix with one request

One can send a bunch of key => values to zabbix with the zabbix-trapper items.

Using this nice article  as a base I have packed everthing in a class so that you can use it:

Example usage: