So I started working with GitLab (self-hosted and gitlab.com), which led me to the CI/CD features of GitLab. When using GitLab, one can define a custom CI pipeline just by placing a .gitlab-ci.yml
file in your project (just like the .travis.yml
for GitHub). After each commit to the defined git branch, the pipeline is then executed.
Since I also work with Ansible playbooks a lot, I wanted to use ansible-lint
to check my playbooks after each commit. In addition to that, I also added a syntax check using ansible-playbook [..] --syntax-check
, as ansible-lint
will not pick up all syntax errors.
So here is my .gitlab-ci.yml
:
Read the rest of this entry
So when working with a lot of different namespaces in Kubernetes and you only know the “oc project” command from OpenShift, you start to miss an easy way to change namespaces in Kubernetes.
The official documentation to switch namespaces proposes something like this:
$ kubectl config set-context $(kubectl config current-context) --namespace=<insert-namespace-name-here>
Not something that I want to type regularly. First I tried to create a BASH alias or something, which did not work. So I looked around for BASH functions. I found that Jon Whitcraft proposed a nice BASH function in a GitHub issue. I lightly modified this and placed this in my own .bashrc
file:
function kubectlns() {
ctx=`kubectl config current-context`
ns=$1
# verify that the namespace exists
ns=`kubectl get namespace $1 --no-headers --output=go-template={{.metadata.name}} 2>/dev/null`
if [ -z "${ns}" ]; then
echo "Namespace (${1}) not found, using default"
ns="default"
fi
kubectl config set-context ${ctx} --namespace="${ns}"
}
So to change your namespace, use something like this:
$ kubectlns simon
Context "kubernetes-admin@kubernetes" modified.
Nice and short.
I am currently toying around with GlusterFS and I am using Ansible to deploy and configure my server.
Using the yum module, I wanted to install the Gluster server package like so:
- name: Install glusterfs-server package
yum:
name: glusterfs-server
state: latest
But when executing the playbook, I received the following error on executing this module:
Read the rest of this entry
In the past few months, I worked closely with Packt Publishing to create a new video course for MySQL 8. Today, the video course was released into the world. I am pround to present to you the new video course “MySQL 8 Recipes“:
In this video course, I tried to include the most common tasks for database administrators while focussing on the new features of MySQL 8. I included the following main chapters:
- Install and configure a new MySQL 8 database
- Upgrade existing databases to MySQL 8
- Perform typical administration tasks
- Master the new querying features in MySQL 8
- Perform performance-tuning tasks
- Optimize your database
- Access databases with PHP, Python, or Java
The video course was released under ISBN-13 9781788393638 and is available per now. Of course, since MySQL 8 is still under development, there will hopefully be many other new features in the new release. But I hope you enjoy this video course. Purchase it here.
As I am working more and more with Linux, I am also using a virtual machine with Fedora 25 installed to play around with some things (notably Docker and Kubernetes). On Fedora 25, the default GNOME desktop environment is GNOME 3. But I personally prefer the GNOME Classic user interface.
To change the desktop environment, on login, select “GNOME Classic” as the desktop environment:
Read the rest of this entry
Some years ago, I wrote some examples for the WMI client on Linux. I still get a lot of queries from people trying to use the WMI client to access Windows hosts and I am often happy to help if there are any problems.
One of the latest problems occurred when trying to access a Windows host over IPv6:
$ wmic -U 'user%password' //FD00:180::0:0:0:0:0 "Select Caption From Win32_OperatingSystem" [..] UNKNOWN - The WMI query had problems. The error text from wmic is: [librpc/rpc/dcerpc_util.c:343:dcerpc_parse_binding()] Unknown dcerpc transport 'FD00' [librpc/rpc/dcerpc_connect.c:337:dcerpc_pipe_connect_ncacn_ip_tcp_recv()] failed NT status (c0000017) in dcerpc_pipe_connect_ncacn_ip_tcp_recv [librpc/rpc/dcerpc_connect.c:828:dcerpc_pipe_connect_b_recv()] failed NT status (c0000017) in dcerpc_pipe_connect_b_recv [wmi/wmic.c:196:main()] ERROR: Login to remote object. NTSTATUS: NT_STATUS_NO_MEMORY - Memory allocation error
This was quite a funny problem, because the same query seemed to work when accessing the host over IPv4. So we quickly suspected that the WMI client does not support IPv6. By looking at the underlying Samba code (e.g. dcerpc_util.c and binding.c), I guessed that this seems to be a parsing issue of some kind.
Read the rest of this entry
So lately I have been working a lot more with Linux networking. Consider an iptables configuration like this:
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7752:8249066]
[..]
-A RH-Firewall-1-FORWARD -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-FORWARD -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
[..]
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Fri Nov 21 15:44:47 2014
Ever noticed the brackets right next to the chain? What are those? What do the numbers mean?
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7752:8249066]
The answer is pretty easy and pretty obvious in hindsight. These numbers report
- packet counter for the chain
- byte counter for the chain
So in our example above, the OUTPUT
chain matched 7752 packets and 8249066 bytes.
Recently I had to install SQL*Plus on a Linux host. In order to do so, I downloaded the appropriate Oracle Instant Client packages from the Oracle site. For my installation, I chose the ZIP files. After I unzipped the client and tried to run sqlplus
, I go the following error:
simon@pandora instantclient_11_2$ ./sqlplus
./sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
Hmm. When I checked the directory with the sqlplus
binary, the file libsqlplus.so
was clearly there.
Read the rest of this entry
So here is yet another troubleshooting post. Today I was applying another PSU for an older Oracle 11.1.0.7 database and received the following error after issuing $ORACLE_HOME/OPatch/opatch apply
:
The following warnings have occurred during OPatch execution:
1) OUI-67215:
OPatch found the word "failed" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
genclntsh: Failed to link libclntsh.so.11.1
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
2) OUI-67215:
OPatch found the word "failed" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
genclntsh: Failed to link libclntsh.so.11.1
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
My quick Google search returned only results that indicated I had to set my LD_LIBRARY_PATH
. I already had set this environment variable correctly, so I looked on for more answers. In My Oracle Support document 471745.1 I found that I had to install the package glibc-devel:
Read the rest of this entry