Remove a package with its dependencies

You know that if you install a package that needs many dependencies, zypper will resolve them for you, easy.

For example, Valve’s “steam” that is in the SUSE Non-OSS repository.

It will install 84 new packages. Why? Because it’s a 32 bit program and it needs 32 bit libraries that are not used for anything else. x86 processors have been 64 bit for many years now. As a matter of fact, SUSE does not have a 32 bit distribution anymore. But it does have 32 bit libraries for a lot of stuff, to maintain backwards compatibility.

zypper install steam
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 84 NEW packages are going to be installed:
 Mesa-32bit Mesa-libEGL1-32bit Mesa-libGL1-32bit Mesa-libglapi0-32bit alsa-devel alsa-devel-32bit dbus-1-glib-32bit gdk-pixbuf-query-loaders-32bit glibc-devel
 gtk2-engine-oxygen-32bit gtk2-tools-32bit libLLVM-32bit libSDL-1_2-0-32bit libX11-xcb1-32bit libXcomposite1-32bit libXcursor1-32bit libXdmcp6-32bit libXft2-32bit
 libXi6-32bit libXxf86vm1-32bit libatk-1_0-0-32bit libcairo2-32bit libcanberra-gtk0-32bit libcanberra-gtk2-module-32bit libcanberra0-32bit libcurl4-32bit libdatrie1-32bit
 libdrm2-32bit libdrm_amdgpu1-32bit libdrm_intel1-32bit libdrm_nouveau2-32bit libdrm_radeon1-32bit libedit0-32bit libelf1-32bit libfreebl3-32bit libgbm1-32bit
 libgdk_pixbuf-2_0-0-32bit libgio-2_0-0-32bit libglib-2_0-0-32bit libgmodule-2_0-0-32bit libgobject-2_0-0-32bit libgraphite2-3-32bit libgtk-2_0-0-32bit
 libgudev-1_0-0-32bit libharfbuzz0-32bit libicu57_1-32bit libjasper1-32bit libjbig2-32bit libjpeg8-32bit libltdl7-32bit libncurses6-32bit libnghttp2-14-32bit
 libnm-glib4-32bit libnm-util2-32bit libopenal1-32bit libpango-1_0-0-32bit libpciaccess0-32bit libpixman-1-0-32bit libpsl5-32bit libsoftokn3-32bit libsqlite3-0-32bit
 libssh2-1-32bit libthai0-32bit libtheora0-32bit libtiff5-32bit libudev1-32bit libvorbisfile3-32bit libwayland-client0-32bit libwayland-server0-32bit libxcb-dri2-0-32bit
 libxcb-dri3-0-32bit libxcb-glx0-32bit libxcb-present0-32bit libxcb-render0-32bit libxcb-shm0-32bit libxcb-sync1-32bit libxcb-xfixes0-32bit libxshmfence1-32bit
 linux-glibc-devel mozilla-nspr-32bit mozilla-nss-32bit mozilla-nss-certs-32bit steam zenity

84 new packages to install.
Overall download size: 33.7 MiB. Already cached: 0 B. After the operation, additional 112.8 MiB will be used.
Continue? [y/n/? shows all options] (y):

If you later decide to uninstall steam, use this to remove all those 84 packages:

zypper remove --clean-deps steam

Surprisingly easy.

Alternatively, YaST Software Manager has an Option called “Cleanup when deleting packages”. If you leave it checked, it will do that every time you remove a package with Software Manager.

Change X Window DPI, make everything on screen bigger

I use an old computer as media box, it’s connected through HDMI to a FullHD TV. Sound goes through the HDMI cable to the TV, if you need help with that, look at this post

The problem is that X Window auto configures the DPI to 96, which is ok for a monitor that’s 50 cm away from you, but not for a TV that’s 3 meters away. I want a DPI of 192, this will have the effect of making everything on screen bigger. Ideally there should be a setting accessible with a mouse click, but this depends on the desktop environment. My method is universal, it works at a lower lever.

The newer X Window starts up without a configuration file, but it still can be customized. It only needs a few simple lines. I tested this on Leap 42.1, with an nVidia card, nouveau driver. It should apply to other versions or distributions as well.

First of all, gather some information by running this in Konsole or Gnome Terminal.

xrandr --query

It should output something like this, the interesting information is purple

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
HDMI-1 connected primary 1920x1080+0+0 (...) 477mm x 268mm
 1920x1080 60.00*+
 1600x900 60.00 
 1280x1024 75.02 60.02 
 1152x864 75.00 
 1024x768 75.08 60.00 
 800x600 75.00 60.32 
 640x480 75.00 60.00 
 720x400 70.08

As root, add these lines to /etc/X11/xorg.conf.d/50-monitor.conf

Section "Monitor"
  Identifier "HDMI-1"
  DisplaySize 238 134
EndSection

The value for Identifier is the same as what xrandr –query reports and DisplaySize values are half of what you get with xrandr –query. Practically, you trick X Window into thinking you have a smaller display, so it will display bigger graphics.

Relogin into your account to activate the changes.

Share files between servers when user “oracle” has different UIDs

If you need to read and write files between servers where the UID of the oracle user is different, the easiest, working solution is with Samba. First, I have tried with NFSv4. After wasting a day with that, I found out it actually doesn’t work because of a lower layer, the RPC mapping. It still sends numeric UIDs instead of strings.

Samba can be configured easily to overcome this, so you will be able to read and write files as user “oracle”, even with different UIDs, on both server and client. I tested this on SUSE Enterprise Server 11, but the method is generic, for any Linux distribution. The configuration tokens that must be identical have the same colors in the next paragraphs.

Server

  • install samba, if you don’t already have it. As root:
    zypper install samba
  • edit /etc/samba/smb.conf
    [global]
            workgroup = WORKGROUP
            passdb backend = tdbsam
            printing = cups
            printcap name = cups
            printcap cache time = 750
            cups options = raw
            map to guest = Bad User
            include = /etc/samba/dhcp.conf
            logon path = \\%L\profiles\.msprofile
            logon home = \\%L\%U\.9xprofile
            logon drive = P:
            usershare allow guests = Yes
    [oracle_share]
            comment = Oracle Share
            path = /opt/oracle/some/directoryname
            valid users = oracle
            hosts allow = clientIP1, clientIP2
            read only = no
    
  • add oracle user to Samba, note the password
    smbpasswd -a oracle
  • start the service and enable it
    /etc/init.d/smb start
    chkconfig --add smb
  • verify that it works
    smbclient -L //servername -W workgroup -U oracle%password

    Should display something like this:

    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64]
    
    Sharename Type Comment
    --------- ---- -------
    IPC$ IPC IPC Service (Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64)
    oracle_share Disk Oracle share
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.58.1-3399-SUSE-CODE11-x86_64]
    
    Server Comment
    --------- -------
    
    Workgroup Master
    --------- -------

Client

The nicest way is to configure it with automount.

  • make a directory
    mkdir -p /mnt/automount/servername
  • edit /etc/auto.master
    /mnt/automount/servername /etc/auto.servername
  • edit /etc/auto.servername
    oracle_share -fstype=cifs,username=oracle,password=password,uid=oracle,gid=oinstall ://servername/oracle_share
  • start the service and enable it
    /etc/init.d/autofs start
    chkconfig --add autofs
  • verify that it works. As user oracle:
    ls /mnt/automount/servername/oracle_share
    touch /mnt/automount/servername/oracle_share/testfile
    
  • make a symlink where you actually need the directory
    cd /opt/oracle/need/it/here
    ln -s /mnt/automount/servername/oracle_share/somename
    

No space left on device! SSD, snapper, btrfs, making it all work in openSUSE 13.2

If you’re reading this, it’s very probable you’re doing it from your phone, tablet or even the Windows partition, because your openSUSE system is barely giving you a text login. Even if “df -h” reports a few free GiBs on /, you’re still getting “No space left on device”. So, in short, this is what you need to do, as root:

snapper list
snapper delete x y z v w

x y z v w are numeric snapshot IDs from the list. You can delete all of them but leave snapshot 0, it doesn’t make sense to erase it and won’t probably work.

openSUSE 13.2 has sensible defaults for the number of snapshots kept, however, these defaults are generic, not proportional to the capacity. If you have a SSD and you share it with Windows and what not, space is too precious to waste on old snapshots.

Edit the configuration fileĀ /etc/snapper/configs/root and further reduce the defaults, these lines are the most effective, I use a value of 2 now:

NUMBER_LIMIT="10"
NUMBER_LIMIT_IMPORTANT="10"

Another thing you can do to save space is limit the size of the logs. Edit /etc/systemd/journald.conf and add this line:

SystemMaxUse=128M

Oracle Business Intelligence 11gR2 11.1.1.7 authentication to Microsoft Active Directory

This will take you through the steps to have BI users authenticate against Active Directory. The users already defined in BI can still login. For example, the user “weblogic”.

Open the admin console http://obiee.example-domain.com:7001/console.

Go to Security Realms/myRealm/Providers tab/Authentication [Lock & Edit]

OBIEE-MSAD

Click New. type ActiveDirectoryAuthenticator, eg myADAuthenticator

OBIEE-MSAD1

Set the control flag to Sufficient. This ensures that either authentication in AD or in BI is sufficient to let a user login. It means you’ll still be able to use the “weblogic” account. For that, you must set to Sufficient the control flag of the default authenticator. If you forget this, the AD users will not be able to login.

OBIEE-MSAD2

Click on myADAuthenticator, go to Provider Specific tab

Input host of AD server and a user

userbase DN: ou=wlsusers,dc=example-domain,dc=com

If you can’t get it to work with “ou=wlsusers,dc=…”, you can also try only “dc=example-domain,dc=com”, but this means that all your AD users will be able to login into BI.

All users filter: (&(sAMAccountName=*)(objectclass=user))

User From Name Filter: (&(sAMAccountName=*)(objectclass=user))

Now restart the admin server.

Then you have to add three keys in the identity store provider.

Enterprise Manager, WebLogic Domain, bifoundation_domain, Security, Security Provider Configuration, Identity Store Provider, Configure

OBIEE-MSAD3

These are the keys:

  1. user.login.attr=sAMAccountName
  2. username.attr=sAMAccountName
  3. virtualize=true

OBIEE-MSAD4

Then you should define three groups in AD and add them to the corresponding roles in BI.

  1. AD_BIAdministrator
  2. AD_BIAuthor
  3. AD_BIConsumer

OBIEE-MSAD5

This was all, you should be able to login now into BI with your domain user.

Log rotation for Oracle 11gR2 database

Up to Oracle 11gR2 the database logs (that is traces, dumps etc) were spawned all over the place and Oracle did not care about the pile-up.

Starting with 11g, Oracle is keeping the logs in check with a default deletion policy of 30 days for dumps and one year for the rest. The mmon process is deleting them. The management tool for logs is called “adrci” Automatic Diagnostic Repository Command Interpreter and is documented here.

However, there’s a problem: this tool is looking at the timestamp of files and not at the content. It erases files that are older than the deletion policy. Logs with frequent writes will grow indefinitely. For example: alert.log, listener.log, sqlnet.log. To resolve this, there’s a file you can add in /etc/logrotate.d so good old Linux will clean up after Oracle.

  1. First, you have to find out where the logs are. As user oracle, give this command
    echo -e "show base\nshow homes" | adrci

    The ouput will be like this:

    ADRCI: Release 11.2.0.3.0 - Production on Wed Jun 5 14:41:05 2013
    
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    
    ADR base = "/opt/oracle"
    adrci> ADR base is "/opt/oracle"
    adrci> ADR Homes: 
    diag/tnslsnr/exampledb/listener
    diag/rdbms/exampledb/exampledb

    Note the base and the homes

  2. Then, as root, create the file /etc/logrotate.d/oracle_trace
    /opt/oracle/diag/tnslsnr/exampledb/listener/trace/*.log /opt/oracle/diag/rdbms/exampledb/exampledb/trace/*.log {
        compress
        monthly
        dateext
        maxage 365
        rotate 99
        size=+16M
        notifempty
        missingok
        copytruncate
    }

    Note that the base and homes from above were concatenated and also trace/*.log was added.

Some more useful info: if you want to shorten the default one year policy, there are two commands you need to know (as user oracle, type adrci to invoke the interpreter):

  1. show control
    This shows the default policy
  2. set control (LONGP_POLICY = 4380)
    This sets the parameter to half of year = 4380 hours

Installing Teamviewer 8 on openSUSE 12.3

It’s incredibly easy, considering what you had to do to install Teamviewer 7.

  1. Download Teamviewer 8 from their site.
  2. Become root (“su -“), change to the directory where you have downloaded the .rpm and just give this command:
    zypper install teamviewer_linux.rpm

    zypper will resolve all the needed dependencies, like this:

    The following NEW packages are going to be installed:
      libICE6-32bit libSM6-32bit libXdamage1-32bit libXext6-32bit libXfixes3-32bit libXrender1-32bit libXtst6-32bit 
      libasound2-32bit libfreetype6-32bit teamviewer

    Awesome!

  3. It will show a graphical license screen, then will start Teamviewer. Remember that you are root, so close that window and start it from the desktop environment menu, as regular user.