Skip to content

Instantly share code, notes, and snippets.

@ruario
ruario / README.md
Last active January 11, 2020 22:53
Using an Ubuntu 14.04 Docker image to build the Vivaldi Source code package

Install docker via your distro's package manager and configure it for your user.

Use the "vivaldibld.docker" docker template file as follows, to build an appropriate Docker image:

docker build -t vivaldibld - < vivaldibld.docker

After this completes successfully, you can run the docker image, like so:

@ruario
ruario / example-spec-files.md
Last active February 11, 2020 16:57
Example rpm .spec files for recent versions of Opera.

The following are some example .spec files I created to demonstrate how to deal with a more recent libudev version and the different naming of libcrypto on Fedora, via the use of compatibility symlinks. I do this in post install for maximum compatibility as the resultant rpms could also be used on systems where libudev and libcrypto naming matches what Opera expects.

To fetch all the .spec files:

git clone https://gist.github.com/f0183807a9f708067475.git

Place the version of Opera you wish to repackage in your sources directory (usually ~/rpmbuild/SOURCES). Tweak the Version field in the .spec file(s).

To repackage Opera stable:

@ruario
ruario / README.md
Last active May 20, 2021 17:02
This script provides a method for creating generic (cross-distro), installable, binary packages. The created packages include a log that makes uninstall easy.

Createpkg

Intro

This script provides a simple method for tracking software that you have built from source, or binaries that you want to repackage from another distribution. It also simplifies transferring the software to other machines for install or backup. It works as a nice secondary package management tool, without the need to work with complex, distro specific, build tools.

@ruario
ruario / rpm2cpio
Last active September 5, 2021 06:28
Minimal rpm2cpio using only bash, grep, tail and a decompressor
#!/bin/bash
RPMHDRLGTH=$(LC_CTYPE=C grep -abom1 '.7zXZ\|]'$'\000\000''....'$'\377\377\377\377\377\377''\|BZh9\|'$'\037\213\b' "$1")
case "$RPMHDRLGTH" in
*7zXZ) COMPRESSOR=xz ;;
*]*) COMPRESSOR=lzma ;;
*BZh9) COMPRESSOR=bzip2 ;;
*) COMPRESSOR=gzip ;;
esac
tail -c+$[${RPMHDRLGTH%:*}+1] "$1" | $COMPRESSOR -d
@ruario
ruario / install-vivaldi.md
Last active September 8, 2021 13:48
This script automates extracting the contents of a Vivaldi package and installing it into the XDG data home directory (typically "$HOME/.local/share"). It also provides a convenient uninstall script.

Summary

Vivaldi Technologies currently only provide .deb and .rpm packages but it is possible to install it on different distros. This install script automates the process.

Install and Upgrade

You can use the script to fetch and install the latest public snapshot like so:

chmod +x install-vivaldi.sh # Only needed the first time
@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 / latest-skype.sh
Last active September 27, 2021 20:48
This script will find the latest Skype for Linux binary package, download it and repackage it into Slackware format.
#!/bin/bash
# latest-skype Version 1.1.2
# This script will find the latest Skype binary package, download it and
# repackage it into Slackware format.
# Copyright 2018 Ruari Oedegaard, Oslo, Norway
# All rights reserved.
#
@ruario
ruario / latest-opera.sh
Last active September 27, 2021 20:48
This script will find the latest Opera stable binary package, downloads and repackage it into Slackware format
#!/bin/bash
# latest-opera Version 2.1
# This script will find the latest Opera stable binary package,
# download it and repackage it into Slackware format.
# Copyright 2018 Ruari Oedegaard, Oslo, Norway
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ruario
ruario / vivaldi-user-profiles-mac.md
Last active November 9, 2021 22:02
How to switch user profiles under Vivaldi on macOS

Chromium based browsers such as Vivaldi support the concept of user profiles. These are different user configurations, under a single operating system login. You could use different users profiles for home and work, or to allow a friend to use your browser without messing up your setup or interacting with your open tabs.

Vivaldi does not currently provide any user interface for switching user profiles outside of the command line switch —profile-directory= (where you pass the name of the profile). However on macOS, you can make a quick launcher application in Automator.

To setup

  • Open the Automator.app (part of macOS) and create a new “Application”
  • Drag “Ask for Text” (found under “Text”) into the actions area
  • Set the “Question” to “Vivaldi Profile Name?”
@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