Recent Posts
Away with grep! Use ripgrep!
Ripgrep is a tool that recursively searches your current directory for a regex pattern. This article provides a brief overview of ripgrep and why it is a good alternative to grep.
I used ack for some time for grepping source code, yet I moved on to ripgrep since it offers quite a bit more than grep and source-code-greps like The Silver Searcher. Plus it can mostly replace grep and is about 6 times faster (it’s written in Rust). I am still astonished when I get results instantly.
Update Confluence Page by API
You can create you own API token here: https://id.atlassian.com/manage/api-tokens and live-update any information you want. The script basicaly creates a HTML file, pumps it by JQ into a JSON-file and uploads it.
#!/bin/bash
# Update Confluence page by API
# Strict mode
set -euo pipefail
# Some informations
PAGEID=602767382
SPACE="EL3"
AUTH="user@example.com:GETYOUROWNTOKENORNEVERKNOW"
API_URL="https://mycompany.atlassian.net/wiki/rest/api"
# Create temp dir
TMP=$( mktemp -d )
# Shutdown handler
shutdown() {
# Cleanup temp directory
if [ -e "$TMP" ]; then
rm -fr "$TMP"
fi
}
trap shutdown TERM EXIT
# We first need current page version for update with next-page version
curl --silent --user ${AUTH} ${API_URL}/content/${PAGEID} > ${TMP}/current.json
VERSION=$( cat ${TMP}/current.json | jq '.version.number' )
NEXTVERSION=$( expr 1 + ${VERSION} )
echo Got Version: ${VERSION}
# Get information
create page.txt
# Create HTML file …IP in VPN vs. LAN: Alias IP Address by iptables
Scenario: Using a Consistent IP Address
When you’re at work, you are on the LAN and use an IP address like 192.168.x.x. When you work from home, you connect via VPN to the same database (DB), and your IP address changes to 10.x.x.x. You want to avoid changing configuration files for your application every time you switch environments.
This problem can be easily worked around using iptables to create an IP address alias.
Laptop Performance: irqbalancer vs. intel_pstate
Today I uninstalled irqbalancer and noticed a performance gain on my GNOME desktop.
The CPUfreq control panel showed me IRQBALANCE DETECTED, and they state the following:
Why I should not use a single core for power saving
- Modern OS/kernels work better on multi-core architectures.
- You need at least 1 core for a foreground application and 1 for background system services.
- Linux Kernel switches between CPU cores to avoid overheating, CPU thermal throttling, and to balance system load.
- Many CPUs have Hyper-Threading (HT) technology enabled by default. So there is no reason to run half of a physical CPU core.
These points are stated very simply. I feel there are some contradictions here.
Infojunk July 2018
Interesting Links from July 2018
- UK Government Ubuntu security
- Kubernetes Mount Propagation
- Volumetric Studio: Neues Studio ermöglicht Aufnahmen für begehbaren Film (German)
- Machine Learning Made Easy
- What We Learned About Kotlin’s Growth This Year
- codecentric: Shared Code in Microservices
- Google Next Brings Kubernetes, Serverless, and VM-Like Isolation to the Cloud
- Docker Images sicher bauen mit Google Jib & Kaniko (German)
- Facebook Tests Scalable Peer-to-Peer Server Configuration
- Cocktails and Dreams: A Programming Layer for the Cloud
- Autofs and sshfs – The Perfect Couple
Better than VNC and TeamViewer - NoMachine and the NX protocol
NoMachine and the NX Protocol for Remote Desktop
The NX protocol is essentially a successor to the X protocol and is excellent for remote display and streaming. NoMachine implements this technology, offering a robust, cross-platform alternative to VNC with superior performance and video streaming capabilities. It is also a good alternative to TeamViewer.
A key advantage of NoMachine is its seamless cross-platform support for keyboard and mouse, which is often an issue with many other alternatives to TeamViewer. Despite this, TeamViewer remains my preferred choice for now.
Anti-Patterns and Mental Downers
Cognitive Biases and Communication Gaps
Most people are familiar with anti-patterns, but this discussion focuses more on the psychological side of working in complex environments.
I’ve personally experienced how poor communication can lead to issues. For example, I once believed there was a mandatory release chat and tried to gather information, only to have my questions in the company chat go unanswered. I was eventually added, but two months late. Similarly, I was forgotten when access was granted to a Shared Google Drive folder, yet everyone assumed I had the shared information because the distribution was taken as obvious.
Using confd and consul for config management
This tutorial demonstrates how to use confd and consul to manage application configurations. consul acts as a key/value store for your configuration data, while confd uses templates to generate configuration files based on the values in consul. This approach helps to decouple configuration from your application code.
Consul is used in clouds as a key/value store to hold configs, just like etcd, Zookeeper, AWS SSM, etc. Additionally, consul can provide a DNS server for service discovery.
AutoFS: Automatically mount S3 using goofyfs or s3fs
About
In Linux basically everything can be turned into a mount helper.
(TBD) UPDATE: This article hardly needs a rewrite. I still keep it online until then.
Scripts
Save this as mount.autofs:
#!/bin/bash
##
# AutoFS user-folder indirect Automounter for S3 using either FUSE goofyfs or s3fs
#
# Requirements
# - AWS CLI installed
# - JQ installed
# - Either FUSE goofyfs or s3fs installed
#
# Usage
# - place config to $S3FS_CONFIG directory using s3fs config format (ACCESS_KEY:ACCESS_SECRET)
# - place this file to /etc/auto.s3 and make it executable
# - add to /etc/auto.master: /home/<user>/Remote/S3 /etc/auto.s3 --timeout=3000
# - choose backend by config section in this file (NOTE: goofyfs needs )
# - cd <mountpoint>/<aws-profile>/<bucket>
#
# Debugging
# - Stop system service by:
# systemctl stop autofs
# - Execute as process (use --debug to see mount commands)
# automount -f -v
#
# Clean up mountpoints (when autofs hangs or mountpoints are still used) …Untitled
+++ title = ‘Better than VNC and TeamViewer - NoMachine and the NX protocol’ date = ‘2016-07-30T22:01:57+02:00’ draft = false tags = [] +++
About
The NX protocol is basicaly a successor to the X protocol and very nyce for Streaming. No Machine implements that and is a better VNC with video streaming and a nice alternative to TeamViewer with good cross-platform capabilities.
In-Depth
In 2001, the compression and transport protocol NX was created to improve on the performance of the native X display protocol to the point that it could be usable over a slow link such as a dial-up modem. It wrapped remote connections Secure Shell for encryption.