Skip to content

Instantly share code, notes, and snippets.

@jesugmz
jesugmz / gnu-linux-debbuging-tools.md
Last active January 5, 2023 18:37
GNU/Linux Debbuging tools

GNU/Linux debbuging tools

top-like interface for container metrics.

DNS lookup utility.

@jesugmz
jesugmz / sed-spreadsheet.md
Last active February 26, 2019 01:43
sed spreadsheet

sed spreadsheet

Delete the first line

Example:

$ df -h
Filesystem           Size  Used Avail Use% Mounted on
udev 3,9G 0 3,9G 0% /dev
@jesugmz
jesugmz / filesystem-hierarchy-standard-for-unix-like-operating-systems.md
Created September 1, 2018 22:51
Filesystem Hierarchy Standard for UNIX-like operating systems

Filesystem Hierarchy Standard

This standard consists of a set of requirements and guidelines for file and directory placement under UNIX-like operating systems.

@jesugmz
jesugmz / generate-docker-base64-auth-token.md
Created August 20, 2018 00:00
Generate Docker base64 auth token

docker login will produce a base64 digest if the binaries pass and secretservice are not present on Linux platforms (source).

To generate a base64 auth token:

echo -n 'username:password' | base64
@jesugmz
jesugmz / tuning-linux-kernel.md
Last active June 6, 2019 09:11
Tuning the Linux kernel

Tuning the Linux kernel

CPU governor

By default, Container Linux uses the "performance" CPU governor meaning that the CPU operates at the maximum frequency regardless of load. This is reasonable for a system that is under constant load or cannot tolerate increased latency. On the other hand, if the system is idle much of the time and latency is not a concern, power savings may be desired.

Governor Description
performance Default. Operate at the maximum frequency
ondemand Dynamically scale frequency at 75% cpu load
@jesugmz
jesugmz / set-up-the-sample-kibana-dashboards-using-docker-in-a-distributed-elastic-stack.md
Last active August 18, 2018 04:03
Set Up the sample Kibana dashboards using Docker in a distributed Elastic stack

To install sample Kibana dashboards run this command in the Kibana node:

docker run docker.elastic.co/beats/metricbeat:6.3.0 setup -e -E output.elasticsearch.hosts=['<ELASTICSEARCH_IP>:<ELASTICSEARCH_PORT>'] -E setup.kibana.host=<KIBANA_IP>:<KIBANA_PORT> -E output.logstash.enabled=false --dashboards

Note: the version of metricbeat can be whatever you want to have. Check the list of releases in the Elastic Docker Registry.

More info:

@jesugmz
jesugmz / truncate-text-length-to-window-width-using-css.md
Created August 1, 2018 21:36
Truncate text length to window width using CSS
p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

See for a live example.

@jesugmz
jesugmz / Google Compute Engine: Resize the file system and partitions on a persistent disk
Created June 25, 2018 23:08
Google Compute Engine: Resize the file system and partitions on a persistent disk
https://cloud.google.com/compute/docs/disks/add-persistent-disk#resize_partitions
@jesugmz
jesugmz / shared-volumes-docker-compose-3.yml
Created June 22, 2018 08:35
Shared volumes in Docker Compose 3
#
# Ugly but functional example about how shared volumes works in Docker Compose 3 without relying on `volumes_from`
#
# See https://docs.docker.com/compose/compose-file/#volume-configuration-reference
#
version: "3"
services:
web:
image: php:7-fpm
volumes:
@jesugmz
jesugmz / AnimalTypes.js
Last active June 16, 2018 20:13
Share constants (or globals) in JS
export const ANIMAL_TYPES = [
{
text: 'Perros',
value: 1,
},
{
text: 'Gatos',
value: 2,
},
];