Skip to content

Instantly share code, notes, and snippets.

@ruario
ruario / check-user-namespace.sh
Last active Sep 11, 2018
A bourne shell function to check for the presence of user namespace support in the linux kernel by calling the unshare command to set one up
View check-user-namespace.sh
check-user-namespace () {
if ! command -v unshare >/dev/null 2>&1; then
echo "The unshare command is not available. Install the util-linux package to fix this." >&2
return 2
fi
if unshare -U true >/dev/null 2>&1; then
echo "User namespace support enabled"
return 0
else
echo "User namespace support not enabled"
@ruario
ruario / README.md
Last active Nov 14, 2018
Run Vivaldi Package (rpm, deb or recompressed contents)
View README.md

Run Vivaldi Package

The attached script (rvp.sh) will allow you to directly run a Vivaldi .deb or .rpm package without “installing” it. This works by quickly extracting the package contents into /var/tmp and then executing the binary therein (the extracted files are removed when you close Vivaldi).

Vivaldi is run with a temporary user data (settings) that are specific to that exact version. This is to avoid messing up the main install's user data.

To run Vivaldi in this way, make rvp.sh executable and start a build like so:

./rvp.sh vivaldi-snapshot-1.15.1159.7-1.x86_64.rpm
@ruario
ruario / latest-skype.sh
Last active Nov 30, 2018
This script will find the latest Skype for Linux binary package, download it and repackage it into Slackware format.
View latest-skype.sh
#!/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 / README.md
Last active May 14, 2020
HTML5 MP4 (H.264/AAC) video issues with Vivaldi for Linux snapshots
View install-vivaldi-via-repo.sh
sudo add-apt-repository 'deb https://repo.vivaldi.com/stable/deb/ stable main'
wget -qO- https://repo.vivaldi.com/stable/linux_signing_key.pub | sudo apt-key add -
sudo apt update && sudo apt install --install-recommends vivaldi-stable
View manually-extract-vivaldi.md

Manually extract Vivaldi from the deb like so:

ar p vivaldi-stable_1.13.1008.34-1_armhf.deb data.tar.xz | tar Jx ./opt/vivaldi --strip 2

To start Vivaldi from a terminal:

vivaldi/vivaldi&
@ruario
ruario / latest-vivaldi.sh
Last active Jun 12, 2021
This script will find the latest Vivaldi binary package, download it and repackage it into Slackware format.
View latest-vivaldi.sh
#!/bin/bash
# latest-Vivaldi Version 1.6.5
# This script will find the latest Vivaldi binary package, download it
# and repackage it into Slackware format.
# Copyright 2019 Ruari Oedegaard, Oslo, Norway All rights reserved.
#
# Redistribution and use of this script, with or without modification,
# is permitted provided that the following conditions are met:
@ruario
ruario / 7x.sh
Last active Dec 6, 2016
Shell script that wraps the 7-Zip commands and makes them work like a normal UNIX compressor in streaming mode for multithreaded XZ compression
View 7x.sh
#!/bin/sh
# https://web.archive.org/web/20140301113249/http://my.opera.com/ruario/blog/2013/01/15/faster-xz-compression
case $1 in
-d) 7za e -si -so -txz ;;
*) 7za a /dev/null -si -so -txz ;;
esac 2> /dev/null
@ruario
ruario / vivaldi-user-profiles-mac.md
Last active Mar 16, 2021
How to switch user profiles under Vivaldi on macOS
View vivaldi-user-profiles-mac.md

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 / auto-unpack-dmgs.md
Last active Feb 7, 2020
A folder action to automount and extract downloaded .dmg files on macOS
View auto-unpack-dmgs.md

This Automator folder action will monitor the Downloads folder for new dmg files and automatically unpack them into a similarly named sub directory. It requires no interaction from the user. On completion a notification will display.

As mounting and extraction happens in the background you save time, since you can continue to work. In addition with all disk image contents pre-copied to disk, moving any .app to "/Applications" is pretty much instant (or in the case of Vivaldi, you could run it in standalone mode directly from the created extraction folder).

To setup

  • Open the Automator.app (part of macOS) and create a new "Folder Action"
  • Choose the Downloads folder
  • Drag "Run Shell Script" (found under "Utilities") into the actions area
  • Change the Pass Input drop down to "as arguments"