Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.
Install lm-sensors
and thinkfan
.
sudo apt-get install lm-sensors thinkfan
inline int rol (int in, int x) { | |
int res; | |
__asm__ __volatile__("rol %%eax, %%cl" :"=a"(res) :"a"(in), "c"(x)); | |
return res; | |
} | |
inline int ror (int in, int x) { | |
int res; | |
__asm__ __volatile__("ror %%eax, %%cl" :"=a"(res) :"a"(in), "c"(x)); |
/** | |
* Trying to get all 16 pwm outputs on a stm32f103rb | |
*/ | |
#include <libopencm3/stm32/rcc.h> | |
#include <libopencm3/stm32/f1/gpio.h> | |
#include <libopencm3/stm32/f1/timer.h> | |
#define MOTOR1_PHASE_A1 GPIO8 // PA8 fixed | |
#define MOTOR1_PHASE_A2 GPIO9 // PA9 fixed |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
#!/usr/bin/env python | |
# Extract playlists from a non-XML iTunes Library file (.itl) | |
# Copyright (c) 2018 Benno Rice, released under the BSD (2 Clause) Licence. | |
# Important information on the encryption used in the .itl file found here: | |
# https://mrexodia.cf/reversing/2014/12/16/iTunes-Library-Format-1 | |
# Highly useful information on the .itl format itself found here: | |
# https://github.com/josephw/titl/blob/master/titl-core/src/main/java/org/kafsemo/titl/ParseLibrary.java |
#!/usr/bin/env python3 | |
""" | |
gtkwave-sigrok-filter.py | |
Use as a 'Transaction Filter Process' in gtkwave to apply signal | |
Usage: | |
- Group input signals in gtkwave with F4 | |
- Apply this script as a 'Transaction Filter Process' (Right click / Data Format) |
#!/usr/bin/env bash | |
set -ex | |
ECP5=/usr/local/diamond/3.10_x64/cae_library/simulation/verilog/ecp5u | |
TOP=dqsbuf_tb | |
iverilog -s $TOP -o $TOP -Dmixed_hdl $ECP5/DQSBUFM.v $ECP5/IDDRX2DQA.v tb.v | |
vvp $TOP |
#!/bin/bash | |
echo "Building Debina 10 QEMU instance..." | |
wget https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/debian-10.0-powerpc-NETINST-1.iso | |
sudo apt install qemu | |
# Create new disk for install | |
qemu-img create -f qcow2 debian10.qcow2 2000M | |
# Boot the install image | |
qemu-system-ppc -L pc-bios -boot d -M mac99 -m 1024 -net nic,model=sungem -net user -hda debian10.qcow2 -cdrom ./debian-10.0-powerpc-NETINST-1.iso -g 1024x768x8 | |
# Run the image | |
qemu-system-ppc -L pc-bios -boot c -prom-env "boot-device=hd:,\yaboot" -prom-env "boot-args=conf=hd:,\yaboot.conf" \ |
According to Apple, the only way to remove an unknown firmware password from a MacBook (2011 and later) is to take it to the Apple Store with the original proof-of-purchase. However, I've found that there is another way, which I've been successful with for the unibody MacBook Pro--it's essentially just modifying a couple bytes in the EFI ROM, which should be simple. What's not simple, however, is figuring out how to read and write to the EFI chip. In this post, I'll talk about the process that I figured out and what worked for me.
Apple's method of resetting the firmware password is not reproducible, as Apple generates an SCBO file that unlocks the EFI using their private key. You can read more about this process here. The problem with this system is that, if you are in the unfortunate situation of neither having the firmware unlock pass