Hack a Folding Bike to Help You Catch Some Pike

For many of us, this whole pandemic thing has produced some unexpected upsides. One of [George Turvey]’s was finding a nice new scenic route to work that goes by a lake with bike trails. [George] thought it might be nice to go fishing after work, and use a folding bike to cover a lot of ground while looking for good spots on the shore. There was just one problem — riding a bike while transporting tackle is awkward.

The bike comes with a front mount that’s meant to hold the special bags they make, so that became square one for designing a rod and tackle holder. Then [George] had to weigh the pros and cons of additive vs. subtractive methods for prototyping the holder, or at least the connection between it and the mount on the bike.

Milling won out, at least for the initial proof of concept, and result is a modular mock-up that combines a milled Kydex connector and tackle box holder with a double-barrel PVC rod holder. This way, [George] had a prototype in a fraction of the time it would have taken to design and print it. Cast your line past the break to see how fast [George] can switch gears into fishing mode.

3D printing definitely has a place in the fishing world. How else are you gonna design your own lures?

source https://hackaday.com/2020/08/03/hack-a-folding-bike-to-help-you-catch-some-pike/

Cryptographic LCDs Use The Magic of XOR

Digital security is always a moving target, with no one device or system every being truly secure. Whether its cryptographic systems being compromised, software being hacked, or baked-in hardware vulnerabilities, it seems there is always a hole to be found. [Max Justicz] has a taste for such topics, and decided to explore the possibility of creating a secure communications device using a pair of LCDs.

In a traditional communications system, when a message is decrypted and the plaintext is displayed on screen, there’s a possibility that any other software running could capture the screen or memory state, and thus capture the secret data. To get around this, [Max]’s device uses a concept called visual cryptography. Two separate, independent systems with their own LCD each display a particular pattern. It is only when the two displays are combined together with the right filters that the message can be viewed by the user, thanks to the visual XOR effect generated by the polarized nature of LCDs.

The device as shown, working with both transparent OLEDs and traditional LCDs, is merely a proof of concept. [Max] envisions a device wherein each display is independently sourced, such that even if one is compromised, it doesn’t have the full message, and thus can’t compromise the system. [Max] also muses about the problem of side-channel attacks, and other factors to consider when trying to build a truly secure system.

We love a good discussion of cryptography and security around here; [John McMaster]’s talk on crypto ignition keys was a particular hit at Supercon last year. Video after the break.

source https://hackaday.com/2020/08/03/cryptographic-lcds-use-the-magic-of-xor/

Linux-Fu: Help Messages for Shell Scripts and Here Documents

Imagine that you want to output multiple lines of text in Bash, or any shell script. Maybe it’s for a help string for a particularly convoluted shell script you’re writing. You could have a separate echo command for each line.  Or you could use the “here document“.

The “here document” construction takes the text between two delimiters and passes it, as if it were piped, to a command.

if [[$# == 0 ]] || [[ "$1" == "-h" ]]; then
cat << EOF
This is my help message. There are many like it but this one is mine.
My help message is my best friend.
EOF

All of the text, as written, with line breaks and spaces and all, get passed to cat and your helpful formatted message is printed to the user.

You can use here documents interactively at the command prompt, and you can use them in functions:

#!/bin/bash
help() {
    cat << EOF
Here is your help.
EOF
}

More About Here Documents

More than just writing help scripts, here documents are useful any time that you want to enter multiple lines and have them piped to a command. We use them most often from the shell directly. There are a few nuances, however.

You probably figured out that the “EOF” string in the above examples marks the beginning and end of the here document. There’s nothing special about it. You can use any word that doesn’t appear in your document. So “<< END_OF_HERE_DOC” would work.

The end of document string has to be at the beginning of a line, and by itself. You should not have whitespace before or after it. It is usually a good idea to use something odd and more than a few characters as the end string, although — in theory — you could use even a single character.

But that requirement messes up code indentation — see the help() function above.  If you put a dash between the redirection brackets and the string, the shell will consume any leading tab characters (but not spaces!). That lets you indent your message so it doesn’t all run together. But here, you have to be careful about spaces in the declaration: cat <<- EOF and cat <<-EOF work, while cat << -EOF doesn’t.  (It expects the delimiter “-EOF”.)  Still, it lets you indent your code if you can get it right, and use tabs instead of spaces.

 
#!/bin/bash 
help() { 
    cat <<- EOF 
        Here is your help. 
    EOF 
} 

Substitution

One thing that might not be obvious is that the here document can handle variable expansion. Try typing:

cat << EOF
Your path is $PATH
Your prompt is $PS1
EOF

Your path is /usr/local/sbin:/usr/local/bin:...
Your prompt is ($HOSTNAME \w)\$

That even works with things like command substitution. So you could put things in like $(ls), for example. Sometimes you don’t want that, though. In those cases, just quote the end string. For example:

cat << "EOF"
Your path is $PATH
Your prompt is $PS1
EOF

Your path is $PATH
Your prompt is $PS1

Peculiarities

You can even send the input to a program that does nothing like : which might seem odd. But some people use that to comment out large blocks of script for debugging or other purposes. It is a bit wasteful, because the lines you don’t want get put in a temporary file and fed to the input of a program that will ignore them, but you might see it done.

Clearly, here documents are niche. I use them a lot for writing help strings in scripts, but they’re just the ticket when you need to pass multiple lines in a script or to a script as you typed multiple lines into stdin.

 

source https://hackaday.com/2020/08/03/linux-fu-help-messages-for-shell-scripts-and-here-documents/

Reach the right target audience with Junk Mail’s digital marketing products

We have some great news for South African businesses! Junk Mail offers a comprehensive variety of digital marketing products that can help you reach the right target audience, spread the word about your products or services, and get the leads and conversions you need to expand your business!

Sign Up For Junk Mail's Digital Marketing Products

Read more Reach the right target audience with Junk Mail’s digital marketing products ›

Cheap And Effective Mosquito Trap Looks Like A Disco

Words cannot quite articulate the collective loathing humankind has for mosquitoes, and rightfully so! These parasite peddling, blood sucking little critters are responsible for a great deal of human suffering. Mosquito-borne diseases such as malaria still account for a significant proportion of human mortality, especially in under-developed parts of the world . So it’s no wonder that people try to reduce their numbers; see this latest $40 mosquito trap by [jacobsk]. (Video, embedded below.)

The idea is critically simple, opening up the potential for widespread deployment. The base and body of the trap are made out of three five-gallon buckets with a mini desk fan sandwiched in between, providing suction into the main trap bin. An opening is cut in the top bucket as a point of entry, and an old school incandescent blacklight is mounted in the centre, with just enough IR and UV output to entice these little vermin, who will definitely regret mistaking it for a black-light rave.

[jacobsk] also does a very good job of showing every step of its construction in his videos. Whilst this solution is purposefully low tech, check out this admittedly overcooked way of killing mosquitoes, with a laser turret.

source https://hackaday.com/2020/08/03/cheap-and-effective-mosquito-trap-looks-like-a-disco/

Rhombicdodecahedron

Polyhedra

https://www.polyhedra.net/en/

So I saw a video on the Rhombic Icosahedron made by Adam Savage and the Numberphile.

I thought I may try my hand at it and hunted for the relevant angles.

Found this site that has cardboard cutouts with the relevant measurements and layouts to assemble.

Pop around and have a look, most can be done with cardboard, though i want mine as an infinity box.

Pinephone Gets Thermal Imaging Backpack

When you buy a mass-market mobile phone, you’re making the decision to trust a long list of companies with your private data. While it’s difficult for any one consumer to fully audit even a single piece of consumer technology, there have been efforts to solve this problem to a degree. The Pinephone is one such example, with a focus on openness and allowing users to have full control over the hardware. [Martijn Braam] is a proud owner of such a device, and took advantage of this attitude to add a thermal imager to the handset.

The build is not a difficult one, thanks to the expansion-friendly nature of the Pinephone hardware. The rear of the phone sports six pogo pins carrying an I2C bus as well as power. [Martin] started by modifying the back cover of the phone with contacts to interface with the pogo pins. With this done, the MLX90640 thermal imager was attached to the case with double-sided tape and wired up to the interface.

While the 32×24 output from the sensor isn’t going to help you build cutting edge heat-seeking missiles, it’s an affordable sensor with good performance for low-end thermal imaging tasks. We’ve featured teardowns of thermal imaging hardware before, too.

source https://hackaday.com/2020/08/03/pinephone-gets-thermal-imaging-backpack/