front | idx | new | login |
 

Debian alternatives

Commands in Debian, that is.

Example: add /usr/bin/led as an alternative to vi.

$ sudo update-alternatives --install /usr/bin/vi vi /usr/bin/led 1
$ sudo update-alternatives --set vi /usr/bin/led
$ vi --help | head -n 1
Usage: led [flags] [file] ...

#public #note

 

qemu with serial output

Problem: You want to run a virtual machine in a terminal, tmux or screen.

Solution:

  • Disable graphics
  • Have a serial console in virtual machine
  • Use the serial console from host terminal

Enabling serial console in Debian

  • vm$ vi /etc/default/grub
  • add console=ttyS0 to GRUB_CMDLINE_LINUX_DEFAULT
  • vm$ sudo update-grub

Starting qemu/kvm with serial console

  • $ kvm -nographic -serial mon:stdio -hda yourimage.img -smp 2 -m 1G
  • kernel messages and login appear to terminal after a few seconds
#public #note
 

arduino device setup

stty -F /dev/ttyACM0 9600 raw -clocal -echo -icrnl

#arduino #note #public

 

arduino sensor battery stats

no advanced sleep, led blinks, sensor report every 3s, bme280 sensor @ I2C, binary protocol over 433MHz, 1200mAh 3.7V lipo, transmit 5, measure all 3

3.7.2017

  • 13:00 started, sensor reports 4.20V
  • 18:10 4.12V
4.7.2017
  • 08:30 4.00V
sleepdog sleep, radio sleep, no led, sensor report every 10s, same sensor & proto, transmit 5
  • 4.7.2017: 09:30 4.20V
  • 5.7.2017: 11:00 4.18V
  • 6.7.2017: 21:30 4.14V
  • 8.7.2017: 19:30 4.11V
  • 11.7.2017: 07:00 4.07V
  • 14.7.2017: 14:30 4.02V
  • 15.7.2017: 20:30 4.00V
  • 25.7.2017: 9:30 3.91V
#public
 

dstat machine state

dstat -tcdnsm --socket --nocolor --noupdate 10 | tee dstat.log


#note #public

 

kal todo

  • every day [on week N]
#public #todo #kal
 

bash job control notes

make jobs control silent (no exit messages printed to parent)

  • set +m
#note #public
 

radamsa todo

adaptive generational uniqueness filter

#todo #public #radamsa

 

pip notes

Find available package versions:

  • pip install foobar==
Install a specific version
  • pip install foobar==1.2.3
#public #note
 

ssh screenshot

ssh [-p port] you@server.tla "DISPLAY=:0 xwd -root | gzip" | gzip -d | xwud

#public #note

@aohelin | aoh@github