lunes, 25 de septiembre de 2023

Configuración Teclado Keychron en Linux

Cuando conectas el teclado Keychron en Linux, este es tomado con la configuración de un teclado de MacOS.

Para configurarlo correctamente debes realizar los siguientes comandos en tu terminal:

echo 'options hid_apple fnmode=2' | sudo tee -a /etc/modprobe.d/hid_apple.conf

sudo update-initramfs -u -k all

sudo reboot

[Referencia]

Tabla de fnmode:

0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8'.

1 = fkeyslast : Function keys are used as last key. Pressing 'F8' key will act as a special key. Pressing 'fn'+'F8' will behave like a F8.

2 = fkeysfirst : Function keys are used as first key. Pressing 'F8' key will behave like a F8. Pressing 'fn'+'F8' will act as special key (play/pause).

martes, 20 de septiembre de 2022

Preparing a Linux machine for Golang Profiling Test

Debes setear el CPU para que sufra el mínimo recalientamiento durante las pruebas, esto con el objetivo de evitar falsos resultados en las pruebas causadas por aumentos o disminuciones de las frecuencias del CPU 

Paso 1: Instala una distro sin modo gráfico (ubuntu server por ejemplo)


Paso 2: Configurala para que el CPU se recaliente al mínimo

Vamos a crear un servicio, que cuando levante, deshabilite el turbo boost, el hyperthreading y setee la frecuencia del CPU al mínimo.

1- Primero debes crear el fichero

nano /usr/bin/enable-profiling-mode.sh

 Debes escribir lo siguiente:

# Apaga el turbo

/bin/sh -c "/usr/bin/echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"

# Apaga el turbo (por si el de arriba no funciona)
wrmsr --all 0x1a0 0x4000850089

# Apaga el hyperthreading

echo off > /sys/devices/system/cpu/smt/control

# Setea la frecuencia al mínimo (en mi caso 800MHz)
sudo cpupower frequency-set -g performance

sudo cpupower frequency-set -u 800MHz



y para desactivar este modo:

nano /usr/bin/disable-profiling-mode.sh

 Debes escribir lo siguiente:

/bin/sh -c "/usr/bin/echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo"

sudo wrmsr --all 0x1a0 0x850089

echo on > /sys/devices/system/cpu/smt/control

sudo cpupower frequency-set -g powersave



Luego debes crear el siguiente servicio:

nano /etc/systemd/system/cpu-profile-mode-on.service

Y escribir esto dentro:

[Unit]

Description=Prepare the machine for profiling 

[Service]

ExecStart=/bin/sh /usr/bin/enable-profiling-mode.sh

ExecStop=/bin/sh /usr/bin/disable-profiling-mode.sh

RemainAfterExit=yes

[Install]

WantedBy=sysinit.target



Luego debes habilitar el servicio

systemctl enable /etc/systemd/system/cpu-profile-mode-on.service

y luego levantarlo

systemctl start /etc/systemd/system/cpu-profile-mode-on.service

Si ves el status:


Luego si ejecutas i7z deberías ver esto



Luego vamos a estresar la máquina con el siguiente comando:

stress --cpu 8 --io 4 --vm 2 --vm-bytes 5GB --timeout 20s


Observaremos que la frecuencia del CPU se mantiene y su tempreratura aumenta solo un poco






jueves, 27 de enero de 2022

Generate gRPC client for dart (flutter) with protoc-gen-dart on macOS

 First: install flutter

Second: install the protoc-gen-dart plugin

dart pub global activate protoc_plugin


Third: Add symlink to dart cache dir in bin

dart pub global activate protoc_plugin


The protoc-gen-dart must be in the following path:

$HOME/.pub-cache/bin/protoc-gen-dart

You need to add the compiler to path

export PATH="${PATH}:${HOME}/.pub-cache/bin"

miércoles, 22 de septiembre de 2021

SonarQube mac installation

1- Run:

brew install sonar

brew install sonar-scanner


Add to bash_profile

nano  ~/.bash_profile

And paste:

export SONAR_VERSION=4.6.2.2472_1

export SONAR_HOME="/usr/local/Cellar/sonar-scanner/${SONAR_VERSION}/libexec"

export SONAR="${SONAR_HOME}/bin"

export PATH="${SONAR}:${PATH}"



launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.sonarqube.plist


http://localhost:9000

miércoles, 14 de julio de 2021

Download any apk from play store

He probado trés páginas y esta es la mejor

 https://androidappsapk.co/

https://m.apkpure.com/es/apkpure/com.apkpure.aegon

https://apps.evozi.com/apk-downloader