AI Assistant Translates Your Every Request For The Command Line

If you don’t live on the command line, it can be easy to forget the exact syntax of commands. It often leaves you running to the “/?” or “–help” switches, or else a quick Google search to find the proper incantations. Shell-AI is a machine-learning assistant that could change all that by helping you find the proper command for the job, right on the command line!

Shell-AI accepts natural-language inputs — simply type in “shai” followed by what you’re trying to do. It will then take in your request, run it through an OpenAI language model like GPT-3.5-Turbo, and then present you with three (or more) potential commands. You can then select which command to use and get on with your day.

As demonstrated, it’s more than capable of following commands like “download a random image” or “show only image files ls.” And, hilariously, it responds to the request “do something crazy” with just one suggestion: “rm -rf”. That seems rather fitting.

We wouldn’t blindly follow any commands coming out of a large language model, of course. But, if you know what you’re doing, it could prove a useful little tool to ease your regular duties on the command line.

Text Compression Gets Weirdly Efficient With LLMs

It used to be that memory and storage space were so precious and so limited of a resource that handling nontrivial amounts of text was a serious problem. Text compression was a highly practical application of computing power.

Today it might be a solved problem, but that doesn’t mean it doesn’t attract new or unusual solutions. [Fabrice Bellard] released ts_zip which uses Large Language Models (LLM) to attain text compression ratios higher than any other tool can offer.

LLMs are the technology behind natural language AIs, and applying them in this way seems effective. The tradeoff? Unlike typical compression tools, the lossless decompression part isn’t exactly guaranteed when an LLM is involved. Lossy compression methods are in fact quite useful. JPEG compression, for example, is a good example of discarding data that isn’t readily perceived by humans to make a smaller file, but that isn’t usually applied to text. If you absolutely require lossless compression, [Fabrice] has that covered with NNCP, a neural-network powered lossless data compressor.

Do neural networks and LLMs sound far too serious and complicated for your text compression needs? As long as you don’t mind a mild amount of definitely noticeable data loss, check out [Greg Kennedy]’s Lossy Text Compression which simply, brilliantly, and amusingly uses a thesaurus instead of some fancy algorithms. Yep, it just swaps longer words for shorter ones. Perhaps not the best solution for every need, but between that and [Fabrice]’s brilliant work we’re confident there’s something for everyone who craves some novelty with their text compression.

[Photo by Matthew Henry from Burst]

Explore FFmpeg From The Comfort Of Your Browser

If you’re looking to manipulate video, FFmpeg is one of the most powerful tools out there. But with this power comes a considerable degree of complexity, and a learning curve that looks suspiciously like a brick wall. To try and make this incredible tool a bit less obtuse, [Sam Lavigne] has developed a web interface that lets you play around with FFmpeg’s vast collection of audio and video filters.

To try out a filter, you just need to select one from the window on the left and it will pop up in the central workspace. Here, the input, output, and any enabled filters will show up as boxes that can be virtually “wired” together. Selecting a filter will populate its options on the right hand side, with sliders and input boxes that allow you to play around with their parameters. When you want to see the final result, just click “Render Preview” and wait a bit.

If there was any downside, it seems like whatever box the site is running on the overhead of running in the browser doesn’t provide it a lot of horsepower. Even with the relatively low resolution of the demo videos available, the console output at the top of the page shows FFmpeg sometimes flirts with a processing speed measured in single-digit frames per second. Still, for a filter playground, it gets the job done. Perhaps the best part of the whole tool is that you can then copy your properly formatted command right out of the browser window and into your terminal so you can put it to work on your local files.

FFmpeg is one of those programs you should really be familiar with because it often proves useful in unexpected ways. The ability to manipulate audio and video with just a few keystrokes can really come in handy, and we’ve seen this open-source tool used for everything from compressing podcasts onto floppy disks to overlaying real-time environmental data onto a video stream.

Bypassing Bitlocker With A Logic Analzyer

Security Engineer [Guillaume Quéré] spends the day penetration testing systems for their employer and has pointed out and successfully exploited a rather obvious weakness in the BitLocker full volume encryption system, which as the linked article says, allows one to simply sniff the traffic between the discrete TPM chip and CPU via an SPI bus. The way Bitlocker works is to use a private key stored in the TPM chip to encrypt the full volume key that in turn was used to encrypt the volume data. This is all done by low-level device drivers in the Windows kernel and is transparent to the user.

TPM chip pins too small? Just find something else on the bus!

The whole point of BitLocker was to prevent access to data on the secured volume in the event of a physical device theft or loss. Simply pulling the drive and dropping it into a non-secured machine or some other adaptor would not provide any data without the key stored by the TPM. However, since that key must pass as plaintext from the TPM to the CPU during the boot sequence, [Guillaume] shows that it is quite straightforward — with very low-cost tools and free software — to simply locate and sniff out this TPM-to-CPU transaction and decode the datastream and locate the key. Using little more than a cheapo logic analyser hooked up to some conveniently large pins on a nearby flash chip (because the SCK, MISO, and MOSI pins are shared with the TPM) the simple TIS was decoded enough to lock onto the bytes of the TPM frame. This could then be decoded with a TPM stream decoder web app, courtesy of the TPM2-software community group. The command to look for is the TPM_CC.Unseal which is the request from the CPU to the TPM to send over that key we’re interested in. After that just grabbing and decoding the TPM response frame will immediately reveal the goods.

Continue reading “Bypassing Bitlocker With A Logic Analzyer”

QSPICE Picks Up Where LTSpice Left Us

[Mike Engelhardt] is a name that should be very familiar to the hardcore electronics nerd. [Mike] is the developer responsible for LTSpice, which is quite likely the most widely used spice-compatible simulator in the free software domain. When you move away from digital electronics and the comfort of software with its helpful IDEs and toolchains, and dip a wary toe into the murky grey waters of analog or power electronics, LTSpice is your best friend. And, like all best friends, it’s a bit quirky, but it always has your back. Sadly, LTSpice development seems to have stalled some years ago, but luckily for us [Mike] has been busy on the successor, QSpice, under the watchful eye of Qorvo.

It does look in its early stages, but from a useability point of view, it’s much improved over LTSpice. Performance is excellent (based on this scribe’s limited testing while mobile.) Gone (thankfully!) is the uncommon verb-noun usage paradigm — replaced with a more usual cut-n-paste flow. Visually it still kind of looks like LTspice in places, but nicer with a clear and uncluttered design that gets straight to the point. Internally, the simulation engine has improved in speed and accuracy, as well as adding native support for modern semiconductor types, such as wide bandgap materials like SiC. Noted is that this updated software has a particular emphasis on power integrity and noise analysis, which are sticky problems that have a big impact on modern high-power systems.

Continue reading “QSPICE Picks Up Where LTSpice Left Us”

Where Did Your PCB Go Wrong? KiRI Knows

When working on a PCB design in KiCad, it’s helpful that the files are all text and can easily be checked into Git or other source control. However, stepping back through the revisions to determine where precisely a trace got routed wrong can be tricky. [Leandro] started with a simple script that exported the KiCad project to an image for inspection — over time it grew into a full-blown visual diff tool named KiCad Revision Inspector (KiRI).

The primary mechanism exports the revisions of a KiCad 5, 6, or 7 project to SVG, which can then be compared via a handy onion skin view. As this is a tool written for those using KiCad, shortcuts are a huge part of the experience. A command line interface generates artifacts to view the diff in any web browser. As these outputs have the KiRI tooling baked in, it is relatively easy to archive the output as a build artifact and allow easy access to review design changes.

For the long-time reader, you might remember back in 2018 talked about another diffing tool called plotgitsch (which this KiRI uses for KiCad 5 projects). KiCad has grown significantly in the last five years. It might be time to update our tips to utilize Git better for your PCB designs.

Continue reading “Where Did Your PCB Go Wrong? KiRI Knows”

Update Your Chinese Radio Without The Pain

The new hotness in cheap radios this year has been the Quansheng UV-K5, a Chinese handheld transceiver with significant RF abilities and easy modding. The amateur radio community have seized upon it with glee and already reverse-engineered much of the firmware, but flashing the thing has always required a minor effort. Now thanks to the work of [whosmatt], it can be flashed with little more than a web browser and a serial cable.

This feat was made possible through the magic of WebSerial, a handy feature that allows web applications to talk to connected hardware. We’ve seen it in action a few times in the world of badges, and as browser support for it has improved it’s now available through browsers on all the major platforms.

The web app allows tweaking of the Quansheng settings and will, no doubt, be capable of uploading that when fully open-source firmware is available. It should be of great interest well beyond the world of Chinese radios, though, because we’re guessing there are a lot of projects that could benefit from such a ubiquitous interface tool.

If you’d like to know more, WebSerial is something we’ve looked at in the past.

Header image: [Concretedog]