Thursday, June 16, 2016

Fix all the permissions uid/gid

To reset UID/GID on all files:

# for i in $(rpm -qa); do rpm --setugids $i; done

To reset permissions on all files:

# for i in $(rpm -qa); do rpm --setperms $i; done

Wednesday, June 1, 2016

gnome-shell super maximize

Ctrl-Alt-Enter

  • This is a two way toggle. Type it once to "super maximize". Type it again to un-"super maximize".
  • In gnome-shell this will maximize the currently focused window to the point that its titlebar will not be seen.
  • It will only do this to the Terminal (including xterm).
  • I've hit this by accident a few times but didn't know how to undo it, so I'm logging it here should I forget.
  • It's not listed on Gnome.org Keyboard Shortcuts or my first 5 Google results.

Monday, May 9, 2016

synergy dekstop sharing

I bought access to Synergy from the company supporting it because I've been using it for years and they deserve a few bucks. I use EPEL but don't want it clobber the version that I download from synergy-project.org. Thus, I have the following in my epel.repo:

$ sudo head /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
exclude=synergy*

$
This is another one of those posts I do to remind myself about what I did.

Friday, July 3, 2015

Burn RHEL7.1 ISO from RHEL7.1

I ran the following on a RHEL7.1 system to make a RHEL7.1 bootable ISO.

[root@box iso]# ls -lh rhel-server-7.1-x86_64-dvd.iso 
-rw-rw-r--. 1 qemu qemu 3.7G Mar 17 11:09 rhel-server-7.1-x86_64-dvd.iso
[root@box iso]# 

[root@box iso]# growisofs -dvd-compat -Z /dev/cdrom=rhel-server-7.1-x86_64-dvd.iso 
Executing 'builtin_dd if=rhel-server-7.1-x86_64-dvd.iso of=/dev/cdrom obs=32k seek=0'
/dev/cdrom: "Current Write Speed" is 8.2x1352KBps.
   15204352/3890216960 ( 0.4%) @3.1x, remaining 21:14 RBU 100.0% UBU  10.0%
   ...
   3864657920/3890216960 (99.3%) @7.3x, remaining 0:03 RBU 100.0% UBU 100.0%
builtin_dd: 1899520*2KB out @ average 5.4x1352KBps
/dev/cdrom: flushing cache
/dev/cdrom: updating RMA
/dev/cdrom: closing disc
/dev/cdrom: reloading tray
[root@box iso]#

I think growisofs has a slightly confusing name and an odd syntax.

Wednesday, March 18, 2015

Unpack a Python object with vars() to see what is inside of it

#!/usr/bin/env python
# Filename:                unpack.py
# Description:             This code will unpack a python object
# Supported Langauge(s):   Python 2.7.x
# Time-stamp:              <2015-03-18 18:41:56 none> 
# -------------------------------------------------------
# I had to figure this out twice I am logging it this time. 
# -------------------------------------------------------

# Suppose we have some object...

class FirstClass:
    def setdata(self, value):
            self.data = value
    def display(self):
            print self.data

# ...and someone instantiated it

x = FirstClass()
y = FirstClass()
x.setdata("King Arthur")
y.setdata(3.14159)

# If someone hands it to me and I want to know what inside 
# it, then printing it just gives me something like 
# <__main__.FirstClass instance at 0x7f794fab7b00>

print x

# Since I have the code to the class I can just use the
# display method. 

x.display()

# But what if I don't know about the dispaly method?
# Is there some way I an unpack any arbitrary object?

vars(x)

# The above returns {'data': 'King Arthur'} . 
# For a more complicated object you can pprint it. 

from pprint import pprint
pprint (vars(x))

Try dir([object]) too.