tag:blogger.com,1999:blog-39968428029795022022024-02-20T14:28:21.753-05:00Programming notes and stuff.Unknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3996842802979502202.post-56421733084655867722018-06-03T23:08:00.001-04:002018-06-03T23:08:44.556-04:00Enabling UART on the Beaglebone BlackTo enable the UARTs with the recent console Debian image for the Beaglebone Black, add these lines to sudo nano /boot/uEnv.txt
uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr2=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr3=/lib/firmware/BB-UART5-00A0.dtbo
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-87264460508838127042018-02-23T07:41:00.001-05:002018-02-23T07:41:53.199-05:00Restore MySQL database from dump fileWhen restoring a MySQL db from a .sql file (such as an SQL dump file created by mysqldump), the login credentials on the target (including root) may be overwritten by the source .sql file if the .sql file was created with the --all-databases option.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-90412017021367113172018-02-23T07:25:00.001-05:002018-02-23T07:42:08.423-05:00RabbitMQ TLSAfter copying the ca cert and key files, specify their locations in RabbitMQ's config file (/etc/rabbitmq/rabbitmq.config). Make sure the user "rabbitmq" can read them, especially the key file. Otherwise TLS connection attempts would just get stuck with no error message showing up in server nor client.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-81355863812454716882017-12-07T04:24:00.004-05:002017-12-07T04:46:01.772-05:00Cloning a Raspberry Pi SD cardThe goal is to clone the SD card of a Raspberry Pi after setup and installation, perhaps for backup or to make more copies of the same setup. Copying the SD card as an image file (.img) onto a regular machine is simple - just install Win32DiskImager (Windows) or Etcher (Windows/Mac) and click through the prompt. The tricky part is writing the .img file back into other SD cards.
All SD cards are Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-32365172880435055072017-11-02T17:37:00.002-04:002017-12-07T03:52:58.816-05:00Missing stack trace in Python Flask on CentOSTo redirect Flask app traceback (exception, logging.error() etc.) to Apache's error log, add
import app
app.logger.addHandler(logging.StreamHandler(sys.stderr))
Otherwise all I get was a "500 Internal Server Error" with no debug information anywhere in the server.
For some strange reason, with Apache 2.4 on CentOS 7 using mod_wsgi and Python Flask, traceback actually goes to /var/log/httpd/Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-82348205211428007002017-09-21T02:20:00.002-04:002017-09-21T02:20:31.774-04:00Python3 matplotlib on RPi3 RaspbianAfter sudo pip3 install matplotlib, my Pi complains about the missing cairo package and some other stuff. This fixed it:
sudo apt install -y python3-gi-cairo python3-cairocffi
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-21362291593001385412017-06-28T18:52:00.002-04:002017-06-28T18:59:42.010-04:00Using the Beaglebone Serial PortsThe Beaglebone Black has four (five if you count the incomplete port 3; six if you count the debug header) serial ports. It used to be possible to enable them by adding the line
cape_enable=bone_capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
in /boot/uEnv.txt.
In the newer console images (> 2017-02) however this no longer works (echo to /dev/ttySX would proceed but nothing comesUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-89150593368436008642017-05-16T05:14:00.001-04:002017-10-10T22:15:46.929-04:00A Checklist For New Base Stations
Hardware: Beaglebone Black (BBB) with v0.2 custom cape
SD card with console image (NO graphical interface. Edit /boot/uEnv.txt to enable flasher)
Important note: The watchdog will reboot the Beaglebone if it is not fed more frequently than once every five minutes. Keep the cape off the bone until software to feed the dog is configured.
Features that require verification:
Real-Time Clock (RTCUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-55971651908399446412017-04-19T18:18:00.000-04:002017-05-16T05:22:10.918-04:00Date and Time - ntpdate ReplacementThe ntpdate utility is deprecated (though still available via apt get install in Debian Jessie). To sync local clock without ntpdate:
sudo systemctl stop ntp
sudo ntpd -gq
sudo systemctl start ntp
The list of time servers to use is usually in /etc/ntp.conf (for the Beaglebone Jessie console image and Ubuntu server 16.04.2 LTS).
- - - - -
UHCM-specific:
NTP using public time servers doesn'tUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3996842802979502202.post-43961980857275193142017-03-15T18:17:00.002-04:002017-05-05T16:02:19.000-04:00MySQL Cheatsheet
Under Ubuntu Server 16.04:
To login to MySQL from terminal as root:
mysql -u root -p
Once inside the MySQL prompt:
To view the list of databases:
SHOW SCHEMAS;
To use a particular database:
USE databasename;
To view the list of tables inside the database:
SHOW TABLES;
To create a new user:
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
To enable remote access to the MySQL Unknownnoreply@blogger.com0