Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilkuznetsov/395cca9a88fa04eed53a2a2c49f82b83 to your computer and use it in GitHub Desktop.
Save danilkuznetsov/395cca9a88fa04eed53a2a2c49f82b83 to your computer and use it in GitHub Desktop.
this script is based on another for Sublime Text (http://www.simonewebdesign.it/install-sublime-text-3-on-linux/). It will handle updates (detects the latest developer or nightly edition) and locale (using your $LANG environment variable) (only tested on a 64 bit, fedora system, feedback welcome).
#!/bin/sh
# Firefox Developer Edition install
# No need to download this script, just run it on your terminal:
# $ curl -L git.io/firefoxdev | sh
# When you need to update Firefox Developer Edition, run this script again.
START_CMD="firefox-dev"
INSTALLATION_DIR="/opt/${START_CMD}"
# Detect the locale
LOCALE=$(echo ${LANG/_/-} | cut -d. -f1)
# Download the tarball, unpack and install
URL="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=${LOCALE}"
curl -L -o ${HOME}/${START_CMD}.tar.bz2 $URL
if tar -xf ${HOME}/${START_CMD}.tar.bz2 --directory=${HOME}; then
# Create an application launcher file based on the regular firefox launcher
cat /usr/share/applications/firefox.desktop | sed -r 's/Name=Firefox/Name=Firefox Developer Edition/g' | sed -r "s/Exec=firefox %u/Exec=${START_CMD} %u/g" | sed -r "s/Icon=firefox/Icon=$(echo ${INSTALLATION_DIR} | sed -r 's/\//\\\//g')\/browser\/chrome\/icons\/default\/default128.png/g" > ${HOME}/firefox/firefox.desktop
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf ${INSTALLATION_DIR} /bin/${START_CMD}
sudo mv ${HOME}/firefox ${INSTALLATION_DIR}
sudo ln -s ${INSTALLATION_DIR}/firefox /bin/${START_CMD}
fi
rm ${HOME}/${START_CMD}.tar.bz2
# Add to applications list
sudo ln -sf ${INSTALLATION_DIR}/firefox.desktop /usr/share/applications/${START_CMD}.desktop
echo ""
echo "Firefox Developer Edition installed."
echo "Run with: ${START_CMD}"
#!/bin/sh
# Firefox Nightly Edition install
# No need to download this script, just run it on your terminal:
# $ curl -L git.io/firefoxnightly | sh
# When you need to update Firefox Nightly Edition, run this script again.
START_CMD="firefox-nightly"
INSTALLATION_DIR="/opt/${START_CMD}"
# Detect the locale
LOCALE=$(echo ${LANG/_/-} | cut -d. -f1)
# Download the tarball, unpack and install
URL="https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=${LOCALE}"
curl -L -o ${HOME}/${START_CMD}.tar.bz2 $URL
if tar -xf ${HOME}/${START_CMD}.tar.bz2 --directory=${HOME}; then
# Create an application launcher file based on the regular firefox launcher
cat /usr/share/applications/firefox.desktop | sed -r 's/Name=Firefox/Name=Firefox Nightly Edition/g' | sed -r "s/Exec=firefox %u/Exec=${START_CMD} %u/g" | sed -r "s/Icon=firefox/Icon=$(echo ${INSTALLATION_DIR} | sed -r 's/\//\\\//g')\/browser\/chrome\/icons\/default\/default128.png/g" > ${HOME}/firefox/firefox.desktop
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf ${INSTALLATION_DIR} /bin/${START_CMD}
sudo mv ${HOME}/firefox ${INSTALLATION_DIR}
sudo ln -s ${INSTALLATION_DIR}/firefox /bin/${START_CMD}
fi
rm ${HOME}/${START_CMD}.tar.bz2
# Add to applications list
sudo ln -sf ${INSTALLATION_DIR}/firefox.desktop /usr/share/applications/${START_CMD}.desktop
echo ""
echo "Firefox Nightly Edition installed."
echo "Run with: ${START_CMD}"
#!/bin/sh
# golang install (last update: Thursday 31 May 2018)
# No need to download this script, just run it on your terminal:
# curl -L https://gist.github.com/grenade/3b3c5b17586881d01142/raw/update_golang.sh | sh
# todo: obtain latest version number and checksum
VERSION="1.10.2"
CHECKSUM="4b677d698c65370afa33757b6954ade60347aaca310ea92a63ed717d7cb0c2ff"
OS="linux"
INSTALL_DIR_PARENT="/opt"
if [[ "$(uname -m)" = "x86_64" ]]; then
ARCHITECTURE="amd64"
else
ARCHITECTURE="386"
fi
ARCHIVE="go${VERSION}.${OS}-${ARCHITECTURE}.tar.gz"
INSTALL_DIR="${INSTALL_DIR_PARENT}/go${VERSION}.${OS}-${ARCHITECTURE}"
rm -f ${HOME}/Downloads/${ARCHIVE}
curl -o ${HOME}/Downloads/${ARCHIVE} https://dl.google.com/go/${ARCHIVE}
sudo rm -rf ${INSTALL_DIR}
sudo mkdir -p ${INSTALL_DIR}
if sudo tar -C ${INSTALL_DIR} -xzf ${HOME}/Downloads/${ARCHIVE}; then
sudo rm -f /usr/local/go
sudo ln -sf ${INSTALL_DIR}/go /usr/local/go
rm -f ${HOME}/Downloads/${ARCHIVE}
fi
echo ""
echo "go ${VERSION} installed."
#!/bin/sh
# Skype install
# No need to download this script, just run it on your terminal:
# $ curl -L https://gist.githubusercontent.com/grenade/3b3c5b17586881d01142/raw/update_skype.sh | sh
# When you need to update Skype, run this script again.
START_CMD="skype"
INSTALLATION_DIR="/opt/skype"
URL="http://www.skype.com/go/getskype-linux-beta-dynamic"
# Download the tarball, unpack and install
curl -L -o $HOME/$START_CMD.tar.bz2 $URL
if tar -xf $HOME/$START_CMD.tar.bz2 --directory=$HOME; then
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf $INSTALLATION_DIR /bin/$START_CMD
sudo mv $HOME/skype-* $INSTALLATION_DIR
sudo ln -s $INSTALLATION_DIR/skype /bin/$START_CMD
fi
rm $HOME/$START_CMD.tar.bz2
# Add to applications list
for i in 16 32 48 64 128; do sudo cp $INSTALLATION_DIR/icons/SkypeBlue_${i}x${i}.png /usr/share/icons/hicolor/${i}x$i/apps/$START_CMD.png; done
sudo ln -s $INSTALLATION_DIR/skype.desktop /usr/share/applications/$START_CMD.desktop
# Install dependencies
sudo dnf install -y libX11.i686 libv4l.i686 alsa-plugins-pulseaudio.i686 qt-x11.i686 libXScrnSaver.i686 libXv-1.0.10-2.fc22.i686 qtwebkit-2.3.4-6.fc22.i686
echo ""
echo "Skype installed successfully!"
echo "Run with: $START_CMD"
#!/bin/sh
# Sublime Text 3 Install (last update: Friday 30 March 2018)
# No need to download this script, just run it on your terminal:
# curl -L https://gist.github.com/grenade/3b3c5b17586881d01142/raw/update_sublime_text_3.sh | sh
# Detect the architecture
if [[ "$(uname -m)" = "x86_64" ]]; then
ARCHITECTURE="x64"
else
ARCHITECTURE="x32"
fi
# Fetch the latest build version number (thanks daveol)
BUILD=$(echo $(curl -s http://www.sublimetext.com/3) | sed -rn "s#.*<p class=\"latest\"><i>Version:<\/i> Build ([0-9]+)..*#\1#p")
URL="https://download.sublimetext.com/sublime_text_3_build_${BUILD}_${ARCHITECTURE}.tar.bz2"
INSTALLATION_DIR="/opt/sublime_text_${BUILD}"
# Download the tarball, unpack and install
curl -o ${HOME}/st3.tar.bz2 ${URL}
rm -rf ${HOME}/sublime_text_3
if tar -xf ${HOME}/st3.tar.bz2 --directory=${HOME}; then
sudo rm -rf ${INSTALLATION_DIR}
sudo mv ${HOME}/sublime_text_3 ${INSTALLATION_DIR}
sudo rm -f /opt/sublime_text
sudo ln -sf ${INSTALLATION_DIR} /opt/sublime_text
sudo ln -sf ${INSTALLATION_DIR}/sublime_text /usr/local/bin/subl
fi
rm $HOME/st3.tar.bz2
# Add to applications list
sed -i -e 's/Icon=sublime-text/Icon=\/opt\/sublime_text\/Icon\/256x256\/sublime-text.png/g' ${INSTALLATION_DIR}/sublime_text.desktop
sudo ln -sf ${INSTALLATION_DIR}/sublime_text.desktop /usr/share/applications/sublime_text.desktop
echo ""
echo "Sublime Text 3 installed."
echo "Run with: subl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment