Show options for a jaeger docker container

Problem

You would like to see all the available options for a jaeger docker container (ie query:1.54), with elasticsearch as the backend

Solution

The commands to run to be able to see all available options, using the image (replace the query:1.54), can be seen using:

docker run -e SPAN_STORAGE_TYPE=elasticsearch jaegertracing/jaeger-query:1.54 --help

All the available options can be converted to environment variables that can be passed as -e ENV_NAME by converting the option replacing all names with capitals and everything else with an underscore(example: –es.tls.enabled -> ES_TLS_ENABLED)

LDAP search using a file as input

Problem

You would like to do a search for a specific LDAP attribute (ie email) using a file (emails.txt) with the list of emails you want to search for.

Solution

After exporting the password (LDP) you can use the following to do the search and output the results into a file (search_results.txt)

ldapsearch -LLL _H "ldaps://ldap_url:port" -D "cn=User_name" -w $LDP -b "ou=ou_name,dc=dc_name,dc=domain_name" -s sub -f emails.txt "(mail_attribute=%s)" uid mail_attribute other_attribute > search_results.txt

Request Entity Too Large when trying to import Gitlab project

Problem

You would like to import an existing Gitlab project, through an export file, to a new self hosted instance of Gitlab, but using the Web UI, even after changing the max-body-size in the ingress deployment you end up having the error message

Request Entity Too Large

Solution

There is another way to import the exported file, but is not documented anywhere as it is classed as EXPERIMENTAL from Gitlab.

You can copy the exported file to the gitlab-toolbox pod

kubectl --kubeconfig ~/.kube/gitlab_config cp local_export.tar.gz gitlab-toolbox-xxx-xxx:/tmp/

You can then login to the gitlab-toolbox pod

kubectl --kubeconfig ~/.kube/gitlab_config -n gitlab-system exec -it gitlab-toolbox-xxx-xxx -- bash

get to directory with the application

cd srv/gitlab

and finally use the rake task gitlab:import_export:import to import your project

git@gitlab-toolbox-xxx-xxx:/srv/gitlab$ bundle exec rake gitlab:import_export:import[your_new_gitlab_username,namespace_path,project_path,/tmp/2022-06-14_14-53-007_export.tar.gz]

Setup your own gitlab runner

To add your own gitlab runner, follow the steps below

  • Create your runner, in EC2, Google, or any other cloud provider and have ssh access to it.
  • Login to your runner from the previous step and install the gitlab-runner (there are various methods described here: https://docs.gitlab.com/runner/install/. We install using Gitlab’s repositories)
  • Register the gitlab-runner by following the instructions here: https://docs.gitlab.com/runner/register/index.html . You would need to get the token for each project you want to register your runner with (Gitlab -> Settings -> CI/CD -> Runners -> Expand). You can use different executors for your running during the registration such as docker, shell etc.
  • Go to your Gitlab project and find the runner you register above and enable it for the project. You should also add the tags: name_of_your_runner in your .gitlab-ci.yml file.

Cannot login to MariaDB server with root account

Problem

You are trying to login to MariaDB with the root user, but even after resetting the password, it is still not possible to login.

Solution

It seems that certain MariaDB packages that come with Linux distributions use the unix_socket as the authentication method.

MariaDB [mysql]> SELECT user, host, plugin FROM user WHERE user='root';
+------+-----------+-------------+
| user | host      | plugin      |
+------+-----------+-------------+
| root | localhost | unix_socket |
+------+-----------+-------------+
1 row in set (0.00 sec)

Change the plugin as described here (https://stackoverflow.com/a/43424234) with the following:

MariaDB [mysql]> UPDATE mysql.user SET plugin = '' WHERE user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Error installing json 1.8.3 with ruby 2.4

Problem

You are trying to install the gems for your rails application in a new computer, or by using ruby 2.4 and you get the following error:

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

Solution

Remove your old Gemfile.lock file and run bundle again. A newer version of json (ie 1.8.6) should be installed.