Skip to content

Instantly share code, notes, and snippets.

Linux free command with percent

Introduction

This script is a simple and fast awk rewrite of the first two lines of the Linux free -wh command (with amount of memory fixed to mebibytes), calculating the percentage of the total for each value and running on Ubuntu or on the Raspberry Pi. It reads data from /proc/meminfo.

I developed this because free does not provide percentages.

Code

@Ircama
Ircama / PT-P300BT.md
Last active March 26, 2024 08:55
Print to Brother PTP300BT from a computer

Printing to a Brother P-Touch Cube PT-P300BT label printer from a computer

Introduction

The Brother P-touch Cube PT-P300BT labelling machine is intended to be controlled from the official Brother P-touch Design&Print 2 app for Android and iOS devices, instead of from a computer.

This Gist provides small code revision and some additional scripts to the dogtopus/Pipfile one, which in turn is forked from the excellent stecman one, in order to print text labels via scripts on computers with different O.S. or subsystems.

The scripts are used to convert text labels to appropriate images compatible with 12mm width craft tapes like [TZe-131

@Ircama
Ircama / LgMagicRemoteKeys.md
Last active March 23, 2024 13:48
Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

This procedure allows substituting one or both Netflix and Amazon keys of the Magic Remote Control Unit with other apps or TV control menus of the webOS LG TV.

Netflix and Amazon keys can be found just over the Red-Green-Yellow-Blue color buttons of such remote.

Assumption for this procedure is that you accept to uninstall the apps related to the keys to be substituted. Example: if you want to replace the Netflix key, you need to uninstall Netflix (possibly, you are not using Netflix if you do not need such key).

To uninstall Netflix or Amazon Prime, press the Home key of the Magic Remote, select the "LG Content Store" app, press "APP" at the top of the screen, press "My Apps", press the "Rem

@Ircama
Ircama / Digispark.md
Last active April 23, 2024 16:21
Configuring the Digispark ATtiny85 board for Arduino IDE and upgrading the bootloader

Configuring the Digispark ATTINY85 board for Arduino IDE and upgrading the bootloader

Warning: this document has to be updated by pointing to https://github.com/SpenceKonde/ATTinyCore

This note describes the configuration of an ATtiny85 based microcontroller development board named Digispark and similar to the Arduino line. It is available in many online marketplaces for roughly 1 dollar (e.g., Ebay, Amazon, AliExpress) and is shipped fully assembled, including a V-USB interface (a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers). Coding is similar to Arduino: it uses the familiar Arduino IDE and is already provided with a ready-to-use bootloader (