Skip to content

Instantly share code, notes, and snippets.

@ruario
ruario / viv2slk.sh
Last active December 13, 2024 14:15
This script will convert an official Vivaldi Linux package into Slackware package format (it should work on any Linux distro, under macOS or even using BusyBox tools)
#!/bin/sh -eu
# This script will convert an official Vivaldi Linux package into Slackware
# package format.
#
# To use, just run this script, followed by the name of the Vivaldi package.
#
# Note: Since this script was created with Slackware 15 and above in mind, it
# uses the new 'douninst.sh' script to clear down any proprietary media libs
# fetched by 'update-ffmpeg' during post install.
@ruario
ruario / register-vivaldi.sh
Last active December 24, 2024 11:12
This script allows you to extract and register a Vivaldi Linux deb or rpm package with your Desktop Environment using a unique keyword, to assist with multiple side-by-side "installs".
#!/bin/sh -eu
a=off
if [ "x${1:-}" = "x-n" ] && [ -n "${2:-}" ]; then
n="${2#vivaldi-}"
c="Vivaldi-$n"
a=on
echo "Using the name: vivaldi-$n"
shift 2
fi
if [ -n "${1:-}" ]; then
@ruario
ruario / vivaldi-linux-media-single-user.md
Last active September 20, 2021 14:31
Running the the Vivaldi Linux update-ffmpeg and update-widevine scripts without using root

Intro

The update-ffmpeg and update-widevine scripts included in the Vivaldi install directory are provided to fix situations where proprietary media (AVC/H.264 and AAC) and Widevine (DRM/EME) respectively, are not setup correctly.

These scripts are primarily intended to be run as root (or under sudo) as they create and update files and directories that are root owned. However both support a command line option (--user) that adjusts their installation directories and thus allows them to be run without escalation.

The --user options were made for internal usage, with locally ‘unpacked’ copies of Vivaldi (i.e. not installed). However, it is possible to use them with standard installs (albeit with a little tweaking in the case of update-widevine).

update-ffmpeg

@ruario
ruario / make_vivaldi_sbo_pkg.sh
Last active August 15, 2022 07:05
A script to simplify maintaining the SBo version of Vivaldi for Slackware
#!/bin/sh -eu
TMP="${TMP:-/tmp}"
REPACKDIR="$TMP/vivaldi-sbo-tar/vivaldi"
mkdir -p "$REPACKDIR"
cd "$REPACKDIR"
# Find out Vivaldi stable version and calculate md5sums
VERSION="${VERSION:-$(wget -qO- http://repo.vivaldi.com/archive/deb/dists/stable/main/binary-amd64/Packages.gz | gzip -d | grep -A6 -x 'Package: vivaldi-stable' | sed -n '/Version/s/.* //p' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1 | cut -d- -f1)}"
@ruario
ruario / chrome-ua-test.md
Last active January 24, 2023 11:40
Launching Google Chrome with a Vivaldi User Agent

The following will allow you to test Chrome with a Vivaldi user agent. Shutdown Chrome and start a Terminal (or cmd.exe on Windows), then paste in the code that is relevant for your platform and press “Enter”–you can triple-click to select an entire line.

Testing with Chrome

NOTE: There is little point testing in Vivaldi because old versions already had workarounds for these specific issues and from 2.10 onwards we use a Chrome User Agent string.

Windows

"%PROGRAMFILES(X86)%\Google\Chrome\Application\chrome.exe" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.94 Safari/537.36 Vivaldi/2.10.1745.21"
@ruario
ruario / macos-private.md
Last active December 6, 2021 18:55
A small App that starts Vivaldi for macOS as a Private Window

Vivaldi Private Window Launcher for macOS

The following commands will produce a small application that allows you to launch Vivaldi in Private mode on a Mac.

Start Terminal paste in the the following code (pressing Enter when done):

mkdir -p Vivaldi\ Private.app/Contents/MacOS
printf '#!/bin/sh\nopen -a Vivaldi.app --args --incognito' > Vivaldi\ Private.app/Contents/MacOS/Vivaldi\ Private
chmod +x Vivaldi\ Private.app/Contents/MacOS/Vivaldi\ Private
@ruario
ruario / f2sb.sh
Last active October 18, 2019 07:32
A script for those who "Forgot to make a SlackBuild". Following a manual install (e.g. `make install`), use this script to make a Slackware package.
#!/bin/sh -eu
#
# This script allows you to create a Slackware package from software you
# previously installed manually (e.g. via `make install`).
#
# Usage:
#
# ./script name-version /path/to/reference/file [seconds]
#
# Provide the name and version of the package, path to one file that forms
@ruario
ruario / make-install-remove.md
Last active July 13, 2024 07:53
Uninstalling (removing) a package installed via make install. No make uninstall target required

make install, uninstall help (howto remove)

Background

A common mistake for users who are new to Linux (and even a few seasoned users) is to install a package from source without any clear idea about how they will remove it in the future, should they want to.

The classic instructions to install a source package are ./configure && make && make install. This (or slight variants) can work nicely for installation but

@ruario
ruario / make-vivaldi-private-desktop-launcher.sh
Last active December 20, 2019 15:32
Run this to create a Vivaldi launcher for Linux desktops that always starts in private mode.
#!/bin/sh
mkdir -p ~/.local/share/applications
cat << END > ~/.local/share/applications/vivaldi-private.desktop
[Desktop Entry]
Version=1.0
Name=Vivaldi (Private)
Exec=vivaldi-stable --incognito
StartupNotify=true
Terminal=false
Icon=vivaldi
@ruario
ruario / 1-README.md
Last active August 8, 2024 12:41
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)