Saturday, September 19, 2020

watchdog: BUG: soft lockup - CPU#0 stuck

 systemd freezing execution


To mitigate this in Cloudatcost.com, you can put this in crontab:

0 0 * * * reboot >/dev/null 2>&1
0 12 * * * pacman -Syu --noconfirm >/dev/null 2>&1

Monday, April 30, 2018

Archlinux and Jenkins

To use jenkins in Archlinux is required change default java environment to Java 8.
sudo archlinux-java set java-8-openjdk/jre

Sunday, April 29, 2018

MBED how to fix: tools.utils.NotSupportedException: No linker script found.

You try to export the MBED project to Eclipse, but the following error raise:

    raise NotSupportedException("No linker script found.")
tools.utils.NotSupportedException: No linker script found.

To fix this problem append " --source $PWD" to command line.

mbed export -m NUCLEO_F429ZI -i eclipse_gcc_arm --source $PWD

MBED NUCLEO F429ZI com SDCard

Começando pelo exemplo oficial:
https://github.com/ARMmbed/mbed-os-example-sd-driver
O código de exemplo oficial, funciona mas precisa de alguns ajustes.
Tanto na baudrate da porta serial,
como na ligação do SDcard para os pinos do SDMMC.
Depois de fazer as correções, o resto do workflow é o normal de qualquer projeto usando mbed.

O código corrigido pode ser encontrado em:
https://github.com/murilopontes/mbed-sdcard-nucleo-f429zi


No conector CN8 vamos usar a interface SPI3 para cuidar do SDCARD.
PC_9 é o SPI CS  /  SDCARD D3
PC_10 é o  SPI CLK /  SDCARD CLK
PC_11 é o SPI MISO (DO) / SDCARD D0
PC_12 é o SPI MOSI (DI ) / SDCARD CMD
os pinos SDCARD: D2, D1, CD ficam desconectados.


sudo pip install mbed-cli --upgrade

mbed --version
1.5.1

mbed import mbed-os-example-sd-driver

cd mbed-os-example-sd-driver

mbed compile -m NUCLEO_F429ZI -t GCC_ARM


st-flash write ./BUILD/NUCLEO_F429ZI/GCC_ARM/mbed-os-example-sd-driver.bin 0x8000000

Minicom result

Exportar para Eclipse
mbed export -m NUCLEO_F429ZI -i eclipse_gcc_arm --source $PWD

Friday, June 16, 2017

how to use tplink wr1043 v1 qss button with openwrt 15.05

Create missing folder
mkdir -p /etc/hotplug.d/button
Create missing event debug handler /etc/hotplug.d/button/buttons
logger the button was $BUTTON and the action was $ACTION
Create missing button event handler /etc/hotplug.d/button/00-button
#!/bin/sh
. /lib/functions.sh
do_button () {
        local button
        local action
        local handler
        local min
        local max

        config_get button $1 button
        config_get action $1 action
        config_get handler $1 handler
        config_get min $1 min
        config_get max $1 max

        [ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
                [ -z "$min" -o -z "$max" ] && eval $handler
                [ -n "$min" -a -n "$max" ] && {
                        [ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler
                }
        }
}

config_load system
config_foreach do_button button
Configure buttons, so append at the end of /etc/system/config
config button
        option button 'wps'
        option action 'pressed'
        option handler 'echo 1 > /sys/class/leds/tp-link\:green\:qss/brightness'

config button
        option button 'wps'
        option action 'released'
        option handler 'echo 0 > /sys/class/leds/tp-link\:green\:qss/brightness'

Friday, October 28, 2016

Debian Jessie howto install Emdebian CrossToolchains

echo deb http://emdebian.org/tools/debian/ jessie main > /etc/apt/sources.list.d/crosstools.list
apt-get install -y curl
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armel
sudo dpkg --add-architecture armhf
sudo dpkg --add-architecture mips
sudo dpkg --add-architecture mipsel
sudo dpkg --add-architecture powerpc
sudo dpkg --add-architecture ppc64el
sudo apt-get update
sudo apt-get install crossbuild-essential-arm64
sudo apt-get install crossbuild-essential-armel
sudo apt-get install crossbuild-essential-armhf
sudo apt-get install crossbuild-essential-mipsel
sudo apt-get install crossbuild-essential-ppc64el
# I found problems with powerpc toolchain
sudo apt-get install crossbuild-essential-powerpc

# libc6:powerpc is broken 
Unpacking libc6:powerpc (2.19-18+deb8u6) ...
dpkg: error processing archive /var/cache/apt/archives/libc6_2.19-18+deb8u6_powerpc.deb (--unpack):
 trying to overwrite shared '/lib/ld.so.1', which is different from other instances of package libc6:powerpc

# remove broken powerpc toolchain
sudo apt-get remove libatomic1:powerpc libc6-dev:powerpc libgcc1:powerpc libgomp1:powerpc libstdc++6:powerpc crossbuild-essential-powerpc libgcc-4.9-dev:powerpc libstdc++-4.9-dev:powerpc g++-4.9-powerpc-linux-gnu gcc-4.9-powerpc-linux-gnu g++-powerpc-linux-gnu gcc-powerpc-linux-gnu

Sunday, October 16, 2016

How to fix - (EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 0, disabling CRTC:21

Screen sleep resulting in black screen of death (ubuntu 16.04 / intel i7 4790k / ga-z97x-ud3h-bk )
Possible fixes are:
1) restart X and loose current session
2) replace SNA with UXA and be happy foverer (best solution)

How to detect bug:
cat /var/log/Xorg.0.log | grep sna_mode_shutdown_crtc
(EE) intel(0): sna_mode_shutdown_crtc: invalid state found on pipe 0, disabling CRTC:21

How to fix:
Copy and save script above, and do:
sudo sh replace-sna-with-uxa.sh

Tuesday, September 6, 2016

telegram bot api

1) get an apikey from @botfather

2) check bot
curl -i -X GET https://api.telegram.org/bot{apikey}/getMe

3) get chatid 
curl -i -X GET https://api.telegram.org/bot{apikey}/getUpdates

4) be happy
curl -i -X GET https://api.telegram.org/bot{apikey}/sendMessage?chat_id={chatId}&text={someText}

Tuesday, August 23, 2016

Scaling up number of tcp/ip connections in linux

#as client
sysctl net.ipv4.ip_local_port_range="20000 65535"
sysctl net.ipv4.tcp_fin_timeout=30

#as server
ifconfig eth0 txqueuelen 10000
sysctl net.core.somaxconn=10240
sysctl net.core.netdev_max_backlog=10000
sysctl net.ipv4.tcp_max_syn_backlog=2560
echo 3000000 > /proc/sys/fs/nr_open
ulimit -n 2000000