Tag Archive for 'centos'

CentOS 7 Repository for Owncloud Desktop Client

CentOS 7 Repository for OwnCloud desktop sync client is online. This application works well with Nextcloud.  Use (k)statusnotifieritem/appindicator extension and Topicons plus extensions in Gnome to ensure the icon works as it should.

The Url is https://robertknight.io/el7/robertknightio.repo

To add the repo, type the following command:

yum-config-manager –add-repo https://robertknight.io/el7/robertknightio.repo

Office 2007 and Wine with dual prefix

When configuring Wine in the form in the previous article, the first prefix created may be 64-bit.  In this situation, e-sword installed correctly.  An issue presented itself when attempting to run Microsoft Office 2007 related to MSXML5 installation.  This issue prevents adding custom buttons to the quick access bar, adding the data analysis add-ons to Excel, and it even prevents saving files in Word or other documents.  The solution for this is creating a second prefix, this one 32 bit.  The prefixes can exist side by side and run programs from each at the same time.   If .wine is a 64 bit prefix, create a new folder, called .wine32, and launch Wine to create the appropriate folder structure.

$ WINEPREFIX=”$HOME/.wine32″ WINEARCH=win32 wine wineboot

Then, to install the app in the 32 bit prefix, use the following while replacing the word username with the actual user name. In this case, the Office 2007 installer was renamed setup.exe.

$ WINEARCH=win32 WINEPREFIX=/home/username/.wine32 wine /home/username/Downloads/setup.exe

This will create the appropriate icons for the software installed into the 32 bit prefix.  Then, it is possible to run programs from the 32 bit prefix (such as Office 2007) and the 64 bit prefix (the default at the time the first application was installed).

Office 2007 running in 32-bit Wine prefix on CentOS 7

32 Bit Wine on CentOS 7

This process is confirmed with Wine 2.0 and CentOS 7 (updated through December 31, 2017).

E-Sword running in 64-bit Wine 2.0 Prefix on CentOS 7

As root:

yum install samba-winbind-clients
yum groupinstall ‘Development Tools’
yum install libjpeg-turbo-devel libtiff-devel freetype-devel
yum install glibc-devel.{i686,x86_64} libgcc.{i686,x86_64} libX11-devel.{i686,x86_64} freetype-devel.{i686,x86_64} gnutls-devel.{i686,x86_64} libxml2-devel.{i686,x86_64} libjpeg-turbo-devel.{i686,x86_64} libpng-devel.{i686,x86_64} libXrender-devel.{i686,x86_64} alsa-lib-devel.{i686,x86_64} glib2-devel.{i686,x86_64} libSM-devel.{i686,x86_64}
yum install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer-plugins-base-devel gstreamer-devel ImageMagick-devel fontpackages-devel libv4l-devel gsm-devel giflib-devel libXxf86dga-devel mesa-libOSMesa-devel isdn4k-utils-devel libgphoto2-devel fontforge libusb-devel lcms2-devel audiofile-devel
yum install openldap-devel libxslt-devel libXcursor-devel libXi-devel libXxf86vm-devel libXrandr-devel libXinerama-devel libXcomposite-devel mesa-libGLU-devel ocl-icd opencl-headers libpcap-devel dbus-devel ncurses-devel libsane-hpaio pulseaudio-libs-devel cups-devel libmpg123-devel fontconfig-devel sane-backends-devel.x86_64
yum install glibc-devel.i686 dbus-devel.i686 freetype-devel.i686 pulseaudio-libs-devel.i686 libX11-devel.i686 mesa-libGLU-devel.i686 libICE-devel.i686 libXext-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXxf86vm-devel.i686 libXrender-devel.i686 libXinerama-devel.i686 libXcomposite-devel.i686 libXrandr-devel.i686 mesa-libGL-devel.i686 mesa-libOSMesa-devel.i686 libxml2-devel.i686 libxslt-devel.i686 zlib-devel.i686 gnutls-devel.i686 ncurses-devel.i686 sane-backends-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 libexif-devel.i686 lcms2-devel.i686 gettext-devel.i686 isdn4k-utils-devel.i686 cups-devel.i686 fontconfig-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pkgconfig.i686 libtiff-devel.i686 unixODBC.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 freeglut-devel.i686 giflib-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 libXmu-devel.i686 libXxf86dga-devel.i686 libieee1284-devel.i686 libpng-devel.i686 librsvg2-devel.i686 libstdc++-devel.i686 libusb-devel.i686 unixODBC-devel.i686 qt-devel.i686 libpcap-devel.i686

As normal user:

Download the latest version of wine from WineHq.
Then, extract to a folder. Go into that folder and create two folders, one for 32 bit, and one for 64 bit. Both are required, and 64 bit must be compiled first.

1)  mkdir x86
2)  mkdir amd64
3)  cd amd64
4)  ../configure –enable-win64
5)  make -j 4
6)  cd ..
7)  cd x86
10) PKG_CONFIG_PATH=/usr/lib/pkgconfig ../configure –with-wine64=../amd64
11) make -j 4
12) sudo make install
13) cd ..
14) cd amd64
15) sudo make install

After this, “which wine” shows 32 bit, and “which wine64” shows 64 bit. Now, opening wine setup.exe on a 32 bit app will work correctly.

A more complex shell script for this is discussed hereHere is a screenshot of e-sword working, without any special modifications.

Grub2 change with latest CentOS update

The previous article regarding configuring Grub 2 for Windows 10 no longer works with the latest CentOS updates.  Here is the newer one.

File to edit:

Content to add:
menuentry "Windows 10 (system) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    insmod ntldr
    set root='(hd0,msdos1)'
    ntldr ($root)/bootmgr

Command to rebuild menu:
grub2-mkconfig -o /boot/grub2/grub.cfg

Data science work station

As of October 2017, these installations on Cent OS 7 create a functional data science workstation.

  1. yum install epel-release
  2. yum install ImageMagick
  3. yum install python-pip
  4. yum install python-devel
  5. yum install tkinter
  6. yum groupinstall “Development Tools”
  7. yum install R
  8. pip install –user parsedatetime
  9. pip install –user matplotlib
  10. pip install –user cython
  11. pip install –user scipy
  12. pip install –user xlsxwriter
  13. pip install –user pystan
  14. pip install –user fbprophet
  15. from R prompt of the user who uses R: install.packages(‘prophet’)

AMD black screen on Linux

The AMD Radeon HD 5770 PCIe card causes difficulty when installation Linux. The screen turns black very quickly and the monitor displays the no signal message on the DVI input. There are several sources that say to set a the boot parameter acpi_osi in Grub .1, 2 Even though ACPI 3 was available in 2005, newer systems often support version 1 or version 2.3 ACPI 1 and 2 specified _OS as a string that shows the operating system. ACPI 3 specified OSI. Many BIOS still use _OS. It is acpi_os=Linux, not acpi_osi=Linux that resolves the high fan speed and black screen issue with AMD cards and fan speeds on legacy chip sets. This may not work in all instances.It seems that some BIOS configuration need _OS rather than _OSI.

Add this to the boot parameters in the file
/etc/default/grub and
rebuild the boot menu via grub2-mkconfig -o

1. What does the kernel boot parameter “set acpi_osi=Linux” do?
2. Fan not working after resume – Toshiba Satellite L300-214
3. What features does enabling ACPI 2.0 support in BIOS enable?
4. Before_OSI, there was _OS

SHA1 Hash in Right Click Menu

Minecraft’s server.properties file has a field for sha1 hash for resource packs. To use this, install nautilus-python and then copy this python script using any file name (such as sha1_hash.py) into ~/.local/share/nautilus-python/extensions.  This provides a SHA-1 hash on the right click menu.

# Robert Knight, 

from gi.repository import Nautilus, GObject
import hashlib
import urllib

class Sha1Menu(GObject.GObject, Nautilus.MenuProvider):
    """ This places a SHA-1 sum in the context menu in Nautilus.
    To use it, nautilus-python is required.  This script then goes in
    ~/.local/share/nautilus-python/extensions and should work after a 
    restart of Nautilus
    def __init__(self):

    def menu_activate_cb(self, menu, file):
        print "menu_activate_cb",file

    def get_file_items(self, window, files):
        if len(files) != 1:

        file = files[0]
        filename = urllib.unquote(file.get_uri()[7:])
        sha1sum = hashlib.sha1()
        with open(filename,'rb') as f:
            for chunk in iter(lambda: f.read(8192), ''):
        string = sha1sum.hexdigest()
        item = Nautilus.MenuItem(name="Sha1Menu::Show_File_Name",
                                 label="SHA-1: %s" % string,
                                 tip="SHA-1: %s" % string)
        item.connect('activate', self.menu_activate_cb, file)
        return [item]

SHA-1 is not the most secure, but is the version used in the Minecraft server for resource pack hashing.