Skip to content

Instantly share code, notes, and snippets.

@ruario
ruario / op2slk
Created Mar 20, 2014
Converts Opera Linux Generic (cross distro) tar packages into the Slackware package format
View op2slk
#!/usr/bin/env bash
#
# op2slk Version 0.9.15
#
# This is a script to convert Opera Linux Generic (cross distro) tar
# packages into the Slackware package format.
#
# Use as follows: 'op2slk operapackage'
#
# Recent stable and beta versions of Opera can be downloaded from:
@ruario
ruario / multichrome
Last active Aug 29, 2015
Permits install and update of all Chrome channels side by side
View multichrome
#!/bin/bash
# Multichrome Version 0.7.1
# This script will find the latest Unstable, Beta or Stable Google
# Chrome package, download it and repackage it into a generic tar
# format. It allows for multiple versions to be installed side by side.
# I don't use Chrome for regular browsing but it is handy for
# comparative tests against Opera. :P
@ruario
ruario / extractrpm
Created Mar 22, 2014
Extracts rpms to similarly named directories, using only bash, grep, tail, cpio and a decompressor
View extractrpm
#!/bin/bash
mkdir -p ${1%.rpm} || exit 1
RPMHDRLGTH=$(LANG=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 | ( cd ${1%*.rpm} ; cpio --quiet -imd )
@ruario
ruario / standalonechrome
Last active Aug 29, 2015
This scripts allows you to run Chrome on Linux, with a self contained profile and without a system wide install
View standalonechrome
#!/bin/bash
# standalonechrome Version 0.2.1
# This script will extract the contents of a Google Chrome rpm package
# into a folder, from which it be can run in a self contained fashion,
# i.e. the profile (settings) will also be saved in the same location.
# I don't use Chrome for regular browsing but it is handy for
# comparative tests against Opera. :P
@ruario
ruario / README.md
Last active Aug 29, 2015
Unpacks an Opera Debian package into a similarly named directory and creates a startup script that will cause Opera to save its profile within this directory (Useful for USB installs). Completely unofficial and unsupported.
View README.md

Disclaimer: I wrote this script for my own personal usage. It is not officially supported by Opera Software.

This script converts an Opera Debian package into standalone (portable) format. If you do not already have it, fetch it as follows:

git clone https://gist.github.com/8416e36372f1a976a713.git

Now use the script to convert an Opera package as follows:

sh standalone-opera.sh opera-developer_27.0.1670.0_amd64.deb
@ruario
ruario / extract-air-files.md
Created Jun 2, 2014
How to extract the files from within the Linux Adobe Air Installer
View extract-air-files.md

Find the location of the LZMA compressed tar:

LANG=C grep -abom1 ]$'\000\000'....$'\377\377\377\377\377\377' AdobeAIRInstaller.bin
6704:]�������

Add 1 to this value (e.g. 6705).

Extract the contents of this tar:

tail -c+6705 AdobeAIRInstaller.bin | xz -qqd | tar -xf- --xform='s,^./build,Adobe_AIR_Files,'
@ruario
ruario / extract-acrobat-files.md
Last active Aug 29, 2015
How to extract the files from within the Linux Adobe Reader (Acrobat) Installer
View extract-acrobat-files.md

When making native Linux packages for Adobe Reader (Acrobat) it is better to use the installer as a source, since it is approximately 13.5 Mb smaller due to use of LZMA compression (the same type of high compression used in 7z and xz files).

The .bin actually has a .tar.lzma archive inside it with the exact same files as the .tar.bz2 that is more commonly used as a source package. The contents of this compressed tar can be extracted using tail, XZ-Utils and tar.

Find the location of the LZMA compressed tar:

$ LANG=C grep -abom1 ]$'\000\000'....$'\377\377\377\377\377\377' AdbeRdr9.5.5-1_i486linux_enu.bin
6888:]�������

Add 1 to this value (e.g. 6889).

@ruario
ruario / mac-activation-order-tab-cycling.md
Created Oct 8, 2014
Start Opera for Mac with activation order tab cycling
View mac-activation-order-tab-cycling.md

Start a terminal and launch Opera via the following command:

open -a /Applications/Opera\ Beta.app --args --with-feature:activation-order-tab-cycling=true

To make that permanent, create a small launcher application. To do this start AppleScript Editor and then choose "File → New (⌘N)" and enter this command:

do shell script "open -a /Applications/Opera\\ Beta.app --args --with-feature:activation-order-tab-cycling=true"

Now "File → Save (⌘S)" as "File format: Application" in a suitable location (/Applications perhaps?). Finally add this launcher application to your Dock and use it to start Opera.

@ruario
ruario / opera-developer-standalone.md
Last active Aug 29, 2015
Extracting Opera from the .deb package to run in place with a self-contained profile.
View opera-developer-standalone.md

Running Opera without installing it

Using Opera developer version (28.0.1719.0) as an example:

ar p opera-developer_28.0.1719.0_amd64.deb data.tar.xz | tar -xJf- --strip 4 --exclude opera_sandbox --wildcards './usr/lib/*'
opera-developer/opera-developer --user-data-dir=opera-developer/profile &

For comparison with Opera 12:

tar xf opera-12.16-1860.x86_64.linux.tar.xz
@ruario
ruario / flareget-slackware-package.sh
Last active Aug 29, 2015
Flareget package for Slackware. I didn't use makepkg, in case Flareget upstream want an easy way to create Slackware compatible packages directly, without requiring local copies of Slackware packaging tools.
View flareget-slackware-package.sh
#!/bin/sh
# As this is a binary repack, it can be run on any Linux distro.
# I account for the 'quirks' of Slackware packaging.
flareget_version=${flareget_version:-4.1.80}
deb_ver=$(echo ${flareget_version} | sed 's/\([0-9]\+\.[0-9]\+\)\.\([0-9]\+\)/\1-\2/')
ARCH=${ARCH:-$(uname -m)}
case "$ARCH" in
x86_64) deb_arch=amd64 ;;
i?86) deb_arch=i386 ;;
*) echo "$ARCH is unsupported"; exit 1 ;;