Skip to content

Instantly share code, notes, and snippets.

@ruario
ruario / make_dated_directory.md
Last active March 24, 2024 22:20
This script creates a directory named with the current date, followed by the current Swatch .beat (down to "decibeat" level, which gives ≈ 9 seconds of time resolution)

This is a short shell script to make date named directories.

#!/bin/sh
a=`TZ=UTC-1 date +%y%m%d-%T`;b=${a#*-};c=${b#*:}
mkdir -v ${a%-*}`printf %04d $(echo "((${b%%:*}*60+${c%:*})*60+${c#*:})/8.64"|bc)`|grep -Eo \[0-9]+

Usage

@ruario
ruario / terminal-beats.md
Last active March 24, 2024 13:32
Swatch .beats to centibeat level from the terminal

To print the time in Swatch .beats from the terminal, issue the following:

printf @;TZ=UTC-1 date '+scale=2;((%H*60+%M)*60+%S)/86.4'|bc

You can save this as a shell alias so that you can check the time in .beats whenever you like alias beat="printf @;TZ=UTC-1 date '+scale=2;((%H*60+%M)*60+%S)/86.4'|bc".

Notes:

@ruario
ruario / authy-fetch-extract-snap.md
Last active March 8, 2024 22:00
How to download and install Twilio Authy on a desktop Linux system without snap support
  • Make an install directory somewhere convenient and switch to it
mkdir -p ~/.local/share/authy
cd ~/.local/share/authy
  • Fetch the current Authy snap
@ruario
ruario / standalone-vivaldi-mac.md
Last active March 7, 2024 17:54
A small App that starts Vivaldi for Mac in such a way that it will store its profile within a subfolder (Useful for testing)

Vivaldi "Standalone Mode" on Mac

The following commands will produce a small application that allows you to run Vivaldi—or any other Chromium-based browser—in Standalone mode on a Mac. This could be used for testing a specific setup or version, without touching the system wide settings (profile). It can also be used to create a portable (USB install) of Vivaldi that you could store on an external disk, for sharing between computers.

Manual method

Start Terminal and issue the following:

mkdir -p Standalone\ Mode.app/Contents/MacOS
@ruario
ruario / small-slackware.md
Last active February 26, 2024 02:10
A short guide to quickly setting up a small Slackware install

Setting up a "small" Slackware install

Intro

Before you do this, reconsider if it is really needed. More often than not, it isn't. This is why.

A common reason for attempting a minimal install is an expectation that Slackware will run faster. This is not true. Some example, (IMHO) valid, reasons for stripping back the install include:

  • Installing on a device with limited disk space, where it is hard to add additional storage
  • A setup where there is an ongoing cost to rent disk space (e.g. a Virtual Private Server)
@ruario
ruario / latest-firefox.sh
Last active February 20, 2024 09:12
This script will find the latest Firefox binary package, download it and repackage it into Slackware format.
#!/bin/bash
# latest-firefox Version 1.6.3
# Contributer: drgibbon (thanks!)
# This script will find the latest Firefox binary package, download it
# and repackage it into Slackware format.
# I don't use Firefox for regular browsing but it is handy for
# comparative tests against Vivaldi. :P
@ruario
ruario / 1-README.md
Last active February 7, 2024 18:46
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)

@ruario
ruario / intro-latest-widevine.md
Last active January 29, 2024 07:53
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@ruario
ruario / 1-signal-linux-manual-unpack.md
Last active January 17, 2024 21:47
Steps to fetch and run Signal on a Linux desktop that is not deb or apt based

The following is a quick guide on how to manually download, extract and run Signal for Linux on a non-(deb)apt based distro (and includes a shell script that automates the entire process). This is for use when no suitable, native (re)package is available. It also includes some additional instructions on how to integrate with your desktop environment. Almost any recent distro (configured for desktop use) will likely have all the dependencies already installed—especially so if you already have any other Electron apps or a Chromium based browser installed, since they will require the same things.

[Note: Triple-click to easily select any of the lines below for copy and pasting into the terminal]

Fetch, extract and launch

  • Switch to a directory you think is suitable for housing Signal (for example ~/opt)
mkdir -p ~/opt && cd ~/opt
@ruario
ruario / dtime.sh
Created October 16, 2023 13:29
Show the current Decimal time or convert from "Standard time" to Decimal time
#!/bin/sh -eu
# Check for -s as an argument and if so convert decimal time to 'standard time'
if [ "${1-}" = '-s' ]; then
if [ -n "${2-}" ]; then
TIME_IN_SECS="$(echo 864*$(echo "$2" | tr -d :)/10 | bc)"
if [ "$(uname -s)" = Darwin ]; then
date -j -f "%s" "$(expr $(date -j -f '%H:%M:%S' '00:00:00' '+%s') + $TIME_IN_SECS)" '+%H:%M'
exit 0
else
date --date="0 today + $TIME_IN_SECS seconds" '+%H:%M'