Posts

Raspberry Pi2 Serial-to-USB Connection on Linux

Image
Raspi2 Serial In order to connect the raspberry pi 2 to a PC running Linux one must first obtain a "USB-to-TTL" Serial Debugging cable; certain precautions need to be made when selecting the appropriate cable:
it should use 3.3V logic levels to avoid frying your boardSince GPIO headers are not adjacent, it should have separated cables for each pin


















https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/README.md
http://elinux.org/RPi_Serial_Connection

Samsung Printer Scanner on Linux

Once again, I've been made to feel as just another outcast in the information age of script-kiddies and spreadsheet warriors; yet another instance of a corporation neglecting Linux users with lacking software support and drivers for their devices.  As in most other cases, the linux community provides their own workaround in this instance as well; namely, the SANE (Scanner Access Now Easy) backend and libraries for the Samsung CLX-3185 Multifunction Printer/Scanner device.  The Samsung support website claims to offer a "Universal Linux Driver", but that's just a smokescreen created by the ineffective binaries and poorly constructed installation scripts from Samsung.  Notwithstanding, the SANE backend implementation isn't perfect  either--as there are still issues with certain System setups, USB 3.0, or simply non-supported devices--but it's far better integrated into the Linux ecosystem. 

It can be very frustrating not being able to complete an important task …

CPU Fan Control on ThinkPad Laptop

I have a Lenovo ThinkPad laptop that occasionally displays error messages about "Hardware events/THERMAL EVENTS" during times of high CPU usage.  This is a scary set of messages in the journal logs that could prophecy a short life span of the CPU if neglected; at times I've suspected that it may have been the culprit of system crashes, though, I won't go into further details on that here.

It's worth noting that the performance improves and error messages subside after one disassembles the laptop and cleans out the heat sink; maybe even properly applies a fresh coat of thermal compound on it.  This improvement, however, never lasts too long as the dust accumulates within the heatsink area again.

I can recall reading anecdotal evidence of this problem from other ThinkPad owners on the Lenovo forums and other places when I first came across these scary messages on my system.  Those owners running Linux on their laptops offered explanations about the poor air fl…

LVM

Image
lvm table

Specify I/O Scheduler with udev rules

Since the advent of systemd the use of /etc/rc* startup-scripts has been discouraged and phased out. However, systemd still supports the use of certain local startup scripts for compatibility purposes. Nevertheless, to ensure full current- and future compatibility with systemd, administrators are encouraged to create own systemd service files or udev rules to run scripts during boot.  This post will briefly outline the use of a udev rule to assign a specific I/O scheduler to a specific HDD.

NOTE To see an example using the phased-out rc-startup scripts, take a look at my previous post.
Create a custom rules-file, e.g. 99-custom.rules, in the /etc/udev/rules.d/ directory with your editor of choice.  The following example will instruct udev to assign the deadline I/O scheduler to the /dev/sdb device:

# vim /etc/udev/rules.d/99-custom.rules ACTION=="add|change", SUBSYSTEM=="block" , KERNEL=="sdb*", RUN+="/bin/sh -c 'echo deadline > /sys/bloc…

Specify I/O Scheduler per Device

Since the advent of systemd the use of /etc/rc* startup-scripts has been discouraged and phased out. However, systemd still supports the use of certain local startup scripts for compatibility purposes. This post will briefly outline the use of the /etc/rc.local file to assign a specific I/O scheduler to a specific HDD.

At the moment, I have an SSD drive (primary /dev/sda) and an "old-fashioned" HDD (/dev/sdb) in use on my RHEL7 system.  I'd like to be able to use the deadline I/O scheduler as the default and assign the cfq scheduler to the HDD device.  In RHEL7 the default I/O scheduler can change based on the selected tuned profile, which adds an additional layer of uncertainty if you're unaware of "tuned".  The default tuned profile is throughput-performance, which enables the deadline scheduler by default among other performance-related system settings.  However, if the default profile is changed to , e.g. virtual-host, the scheduler of choice becomes

SystemD and FIFO Sockets in RHEL7

There's a bug with a relevant discussion on systemd's approach to FIFO socket deletion. As of systemd-214 the issue with "stale" sockets was resolved by supplying the `RemoveOnStop` option to its corresponding `.service`. However, at the moment RHEL7 has systemd-208 as the default version; and I am seeing the following errors in `dmesg` output: systemd[1]: systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ) systemd[1]: /usr/lib/systemd/system-generators/anaconda-generator exited with exit status 1. [ +0.056775] systemd[1]: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' [ +0.000675] systemd[1]: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' I'm not sure if LVM2 is referencing a feature that's not available in the default systemd version; AFAIK, my configurati…