Archive for the ‘unix/windows’ Category

ZSH man pages missing on Ubuntu 14.04

Tuesday, July 28th, 2015

ZSH logoFix is from a bug report:

sudo apt-get install zsh=5.0.5-4ubuntu1~ubuntu14.04.1 zsh-common=5.0.5-4ubuntu1~ubuntu14.04.1 zsh-doc=5.0.5-4ubuntu1~ubuntu14.04.1

Hattip to this comment on the original bug.

Bonus: it gets you a newer ZSH.

Printing OU style

Thursday, April 2nd, 2015

OU logoFollowing up on my previous instructions, this time the full story – including double sided printing.
update 2017-06-28: additions to clarify some points (there was some confusion for me after a reinstall, hopefully this fixes things).
Edit 2017-10-23: New printers, see new update.

  • Go to the “add printer” dialog
  • Choose LPD printer, add the name.
    Name is something like MFP-XXX-A0YYYY. XXX for my building is HLR – my printer is MFP-HRL-A09950.
  • Download the C360 printer driver (PPD) from the Konica Minolta website (I found multiple options, ended up using the file KOC360UX.ppd)
  • Use this printer driver. Configuration:
    • paper source unit: PC-408
    • Finisher: FS-529
    • Punch Unit: none
    • Saddle kit: none
  • Now you need to set up authentication. With thanks to:
    here:

    1. Configure the printer normally as LPD – write down the name you choose eg. CASACRISTO
      IMPORTANT: Choose the driver Generic Postcript/FoomaticEdit: don’t, use the regular ppd as explained above.
    2. Open a terminal and stop CUPS.
      sudo service cups stop
    3. Edit /etc/cups/ppd/CASACRISTO.ppd
      Adding these 3 lines just before the last line:
      Edit: that means: make sure these 3 lines are the last in the file. A newline at the end of the last one of these ends the file.

      *cupsFilter: "application/vnd.cups-raw 0 minolta"
      *cupsFilter: "application/vnd.cups-command 0 commandtops"
      *cupsFilter: "application/vnd.cups-postscript 0 minolta"
      
    4. Create /etc/cups/ppd/CASACRISTO.km (enter your own tracking number instead of 1234).
      Edit:I used the pincode for scanning here, and the name of the printer, i.e. MFP-HRL-A09950.
      ACCOUNT_NAME="casacristo"
      ACCOUNT_PASSWORD="1234"
      ACCOUNT_COETYPE="0"
      
    5. Create /usr/lib/cups/filter/minolta with this content:
      #!/bin/bash
      source /etc/cups/ppd/${PRINTER}.km
      
      echo -en "\033%-12345X"
      echo -en "@PJL JOB\015\012"
      echo -en "@PJL SET KMSECTIONNAME = \"${ACCOUNT_NAME}\"\015\012"
      echo -en "@PJL SET KMSECTIONKEY2 = \"${ACCOUNT_PASSWORD}\"\015\012"
      echo -en "@PJL SET KMCOETYPE = ${ACCOUNT_COETYPE}\015\012"
      echo -en "@PJL ENTER LANGUAGE = POSTSCRIPT\015\012"
      
      cat -
      
      echo -en "\004\033%-12345X\015\012@PJL EOJ\015\012"
      echo -en "\033%-12345X"
      
    6. Make it executable: sudo chmod +x /usr/lib/cups/filter/minolta
    7. Restart CUPS: sudo service cups start
  • To print doublesided: choose tab “advanced”, not tab “page setup”.

USB3 DisplayLink adapter and Linux: a big YESYES

Monday, March 30th, 2015

OU logoThe OU is using Kensington DisplayLink docking stations. They’re pretty nifty: one USB plug gets you internet, audio, and video. Under windows, that is :s.

After googling a bit, it turns out that DisplayLink did not release any drivers for the USB 3.0 version for Linux. Why? Because they support HDCP, a copy-protection measure for displays. And they have not (yet?) figured out how to preserve that type of copy protection and have open source drivers (nor, apparently, preserving that with closed-source drivers).

There’s at least one person looking into getting USB3 DisplayLink working via Linux. And it kind of sounds like he’s trying to hack HDCP in the process, just because he wants to use his hardware to actually do something. Ugh.

UPDATE (2017-02-07): Woohoo! Solution! There’s an Ubuntu display driver available from Displaylink. See http://support.displaylink.com/knowledgebase/articles/684649-how-to-install-displaylink-software-on-ubuntu. It requires kernel v3.16, which you can get from Ubuntu 14.04.2 onwards. (Thanks to new colleague Fabian for finding this out!).

In a nutshell:

  • Make sure you’re running linux kernel 3.16 or above
  • Download driver-installer
  • Install a signed kernel, boot into signed kernel
    sudo apt-get install linux-signed-generic-lts-$VERSION – currently, version is “xenial” but you can check which is the latest by using filename completion (i.e., press <Tab>) and picking the newest one.
  • Install DKMS: sudo apt-get install dkms
  • Execute the downloaded installer:
    sudo ./displaylink-driver-$version.run
  • Unplug your monitor cable and give the system 10-20 sec to resetup the monitor via the USB3 port.

Sidenote:
Using the actual USB3 port on my system instead of a USB2 port increases the speed sufficiently to allow internet, sound, webcam and display all over one port. In retrospect, it’s kind of obvious that even just running internet and sound over it would become challenging for video conferencing. Great detecting there, Sherlock me.

Update 2017-02-17: If you’re updating the kernel, the installed driver might no longer work (happened to me). In that case: sudo displaylink-installer uninstall to remove the driver, reboot, reinstall the driver by sudo ./displaylink-driver-$version.run and you’re good to go again!
You don’t even need to reboot after reinstalling the driver.
I’m not sure if you need to reboot at all, but I figured better 20 secs extra and sure about having purged the previous install than lingering in limbo.

Thanks to:
http://displaylink.org/forum/showthread.php?t=1748&page=16
http://airlied.livejournal.com/80516.html

Libreoffice and Apache OpenOffice side by side on Ubuntu 14.04.2 LTS

Friday, March 27th, 2015

Ubuntu logoOU logoHere’s the conundrum: to load slides into BlackBoard Collaborate (the Open Universiteit’s online teaching environment), I need Apache OpenOffice (AOO). To collaborate with people who work in MS Office (most of my colleages, most of the students), Apache OpenOffice is not good enough. Libreoffice (LO) is.

So I need the two side-by-side on Ubuntu. Which isn’t easy.

1. Getting Apache OpenOffice to work with Collaborate

  • sudo apt-get purge libreoffice\*
  • Download openoffice and dpkg -i the necessary files (don’t forget the desktop-integration subdir!)

If you install AOO before removing LO, then the install isn’t complete. Even though you can use AOO, Collaborate cannot. So purge your LibreOffice :s

2. Getting LibreOffice back on your system without destroying things

DO NOT INSTALL LibreOffice FROM THE OFFICIAL REPOSITORIES!
It fails and leaves your package database in an inconsistent state. I had to manually solve the problem by using

  • dpkg -l | grep libreoffice to check which packages there were, and
  • removing these with dpkg --purge.

The convenient command ended up being:
dpkg -l | grep libreoffice | cut -f 3 -d ' ' | xargs sudo dpkg --purge

That wasn’t quite enough to fix the database — there was a remnant of another package in the way. Removing that one (dpkg --purge python3-uno) addressed that, and then apt-get was happy with me again.

So what to do? Here’s how: download the latest LibreOffice, and install LO from the downloaded DEB files (tar -zxvf $downloadedfile; cd $LOdir/DEBS; sudo dpkg -i *deb). That works, and you now have the two side by side :)

BlackBoard Collaborate powerpoint import problem

Wednesday, March 18th, 2015

OU logoIn a nutshell: if you get an error “the <ppt> file type is not supported“, download the Visual Basic 5 Runtime from Microsoft and install it.

This solved the problem for a colleague of mine in windows.

Hattip to http://www.wecollaborate.com/forum/topics/workaround-for-the-ppt-file-type-is-not-supported?xg_source=activity.

Ubuntu + Bluetooth disabling / re-enabling every 5 seconds on Toshiba Z930

Wednesday, March 11th, 2015

Ubuntu iconThere’s an interesting thing happening with Bluetooth and Ubuntu 14.04. If you check dmesg, you’ll see something like:

....
[  464.115830] toshiba_bluetooth: Re-enabling Toshiba Bluetooth
[  464.155555] usb 1-1.2: USB disconnect, device number 90
[  464.655517] usb 1-1.2: new full-speed USB device number 91 using ehci-pci
[  464.848663] usb 1-1.2: New USB device found, idVendor=8087, idProduct=07da
[  464.848675] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
...

This is repeated every 5 seconds. Thankfully, people are working on a solution!

See:

The latter has a proposed patch that I’m using right now. It stops the spam in the logs, that’s clear :)
What’s not yet clear to me (see also my comment there) is whether Bluetooth keeps working well.

NTLM authentication working!

Thursday, February 26th, 2015

OU logoWoohoo! I got NTLM to work! What a relief to finally feel “connected” with the rest :)
How I finally managed: I installed NTLM APS version 0.9.9.5, and used the following config values (keeping only the pertinent values, the rest isn’t changed):

[GENERAL]
PARENT_PROXY:

[NTLM_AUTH]
NT_HOSTNAME:
NT_DOMAIN:pwo
USER:hjo
PASSWORD:
LM_PART:1
NT_PART:1
NTLM_FLAGS: 07820000
NTLM_TO_BASIC:0

Let’s see if it still works with debugging turned off…yup! So I’ve updated that in the above description.

I’ve now added a tiny PAC file, proxy-for-local-domain.js:

function FindProxyForURL(url, host) {
        host = host.toLowerCase();
        
        // Route all OU traffic through local NTLM authentication-
        // handling proxy
        if (dnsDomainIs(host, ".ou.nl"))  {
                return "PROXY 127.0.0.1:5865";          // (IP:port)
        }

        // Anything else: just direct
        return "DIRECT";
}

and then configured Firefox to use an automatic proxy configuration url of file://.../proxy-for-local-domain.js. Tested and it works! woohoo!

CNTLM downer (setting up my laptop for the OU, part X)

Thursday, February 19th, 2015

OU logoFrom the CNTLM man page:

But please note that NTLM WWW auth (that is auth to HTTP servers), when it is running without any parent proxy as a standalone proxy server in itself, won’t probably be implemented ever. Even though the tasks share common NTLM authentication, they are different things. Also, I’ve never seen any access-protected HTTP server requiring solely NTLM without any alternative. Such a narrow-spectrum tool can be written in Perl in a few minutes. I strive to keep the code of cntlm simple and efficient.

“Never seen that”? Well, allow me to introduce to you: The Open Universiteit :s.

And yes, me and perl won’t see eye to eye in “a few minutes”.

Cleaning up Windows & Ubuntu

Tuesday, February 10th, 2015

Windows 8 logoThanks to some helpful tips from Wichard, I’ve cleaned up my Win8 installation. Funny thing: I’ve hardly used it (time I spent actively using it is measured in minutes, not in hours), yet Windows had managed to accumulate a lot of garbage. Probably most is due to upgrading from 8.0 to 8.1, but still…

Tips

  • Turn hibernation off – that saves the diskspace for the hibernation file (several gigabytes).
    Open a command prompt as an administrator (open command prompt, right-click on icon and select “Run as Administrator” and type powercfg -h off (for powerconfiguration hybernation off).
    Space won:±5GB
  • Do a disk cleanup.
    Regular disk cleanup will catch some things, but go into the advanced settings to get rid of all system restore points but the last one. You can even turn off system restore points, though I’m not sure you’d want to.
    Space won (regular disk cleanup): ±1.5GB.
    Space won (advanced disk cleanup): ±8GB.
  • Turn off the memory dump when crashing.
    I have no clue any longer where this is found (probably “My computer > Properties” and then click around somewhere), but if you have a lot of memory in your computer, and it crashed once, you now have several gigs of hard disk space filled.

I went from roughly 14 GB free space to roughly 27.5GB free space.
Keep in mind that I’ve mostly run windows to install updates… :s

Seriously, MS, my disk isn’t so big and I’m dual-booting. Could you kindly stop gorging on the disk space buffet?

PS: Two more things to try:

  1. Reduce the size of the WinSXS folder.
    Apparently, this one stores system restore points or somesuch, so maybe that was included in the “drop all system restore points but the last one”. Still, it can be a huge dir (was 15 gig before we started cleaning, didn’t check afterwards).
    Edit: 7.9 GB. That’s worth cleaning up.
  2. enable compression.
    I don’t really use windows anyway. Moreover, my laptop is pretty kick-ass in the power department. Nothing fantastic, but it should be more than enough to enable disk compression… which will probably gain some more space.

Edit: I’ve also cleaned up the Ubuntu partition a bit: got rid of all photos from my phone (gain: 7 GB) and everything in the Videos folder (gain: 3 GB). Then I cleaned up old kernels following this advice, in a nutshell:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge
Gain: 3 GB.

I now have:
– 14 GB of free space in /home,
– 11 GB in /,
– 27 GB on the Windows partition.
So provisional plan:

  1. Clean up WinSXS folder to gain more GBs.
  2. Reduce windows partition by 15 GB or so.
  3. Increase Linux-/ partition by 10 or so GB.
  4. Increase Linux-/home partition by 5 GB or so.
    Problem: this is an encrypted partition. So I might also just go for the SD slot option (see below).

As Wichard pointed out, I do have a slot for SD cards, so I might also use that for movies/photos/whatever. To ponder.

Printing running; NTLM authentication 1 step closer

Friday, February 6th, 2015

With some help of the OU IT staff, I got one step closer to two things!

NTLM authentication

This was my goof-up. The cntlm config file was only readable by root. Le doh!
So:

  1. install cntlm
  2. config /etc/cntlm.conf as:

    Username hjo
    Domain www.intranet.ou.nl

    # List of parent proxies to use. More proxies can be defined
    # one per line in format : Proxy 145.20.126.12:8080
    #Proxy 10.0.0.42:8080

    # List addresses you do not want to pass to parent proxies
    # * and ? wildcards can be used
    #
    NoProxy localhost, 127.0.0.*, 10.*, 192.168.*

    # Specify the port cntlm will listen on
    # You can bind cntlm to specific interface by specifying
    # the appropriate IP address also in format :
    # Cntlm listens on 127.0.0.1:3128 by default
    #
    Listen 3128
    Listen 3310

  3. run chmod go+r /etc/cntlm.conf
  4. Generate the password hashes for authentication: cntlm -H and enter your password. Example:

    $ cntlm -H
    Password:
    PassLM FE03A594184396D6552C4BCA4AEBFB11
    PassNT F3496B77FA086840D57D7F868C476AC8
    PassNTLMv2 9AB19C7C88EADFC4DE62B818E2878131 # Only for user ‘hjo’, domain ‘www.intranet.ou.nl’

  5. copy the password hash lines to //etc/cntlm.conf below username/domain.

That’s where I’m at now. It still doesn’t work, but we jumped through another hoop! :)

Printing

I followed now the Mac instructions again:

  1. Go to the “add printer” dialog
  2. Choose LPD printer, add the name.
    Name is something like MFP-XXX-A0YYYY. XXX for my building is HLR – my printer is MFP-HLR-A09550.
  3. Download the C360 printer driver (PPD) from the Konica Minolta website (I found multiple options, ended up using the file KOC360UX.ppd)
  4. Use this printer driver. Configuration:
    • paper source unit: PC-408
    • Finisher: FS-529
    • Punch Unit: none
    • Saddle kit: none
  5. Now you need to set up authentication. I’m not clear on how to do this (doesn’t work yet), but good info seems to be available from:
    • here for printers in the same class (Konica Minolta C220/280/360 share the same printer driver, apparently)
    • here for other printers.
      This explanation includes a link to an explanation on how to send the correct printer commands apparently.

This actually works!

PS: I was running this while using the Java Juniper client, so I was on the VPN.