Pages

Friday, February 5, 2016

HPLIP Binary Plugin Installation

Recently ran into this exact bug with my junk laserjet printer P1108.


From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#40 

Package: hplip
Version: 3.13.4-1
Followup-For: Bug #605589

since the update to 3.13.4 I cannot seem to print with my P1005.
When sending a job to the printer, a window pops up asking to install the
plugin. When following the dialogs, they end saying that the plugin is
installed, followed by another window saying it failes.
Manually launching hp-plugin completes the plugin installation successfully,
the printer comes alive, but sending a print job goes back to requesting the
plugin.

The solution is here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#50

Briefly:
Create the directory /var/lib/hp
Update hplip-gui
Install/update cups-pk-helper if required
Unplug, then re-plug in printer
HPLip will ask to download and install the plugin, which is a run file.

If you are behind a firewall or your internet connection is dodgy, this automatic download will fail, and you will need to manually download and install the plugin.

In a terminal run hp-plugin
Watch the terminal for URL of the plugin file.

Download *.run file from hplip website.

Tex Studio Keyboard Shortcuts

TexStudio had an annoying habit of jumping to the the previous brace when I wanted to go one word (CTRL + left / right). This is because this key combination is assigned by default to "Next (or prev) word / placeholder".

Fix:
Assign nothing to "Next word / placeholder".
Assign CTRL+Right to "Move cursor right (1 word)"
Assign a different combination, e.g. Meta+Shift+Right to "Next placeholder".
Repeat for left.

PS
Meta = Usu key with the windows logo.
On GNOME the "windows" / meta key is used in lots of shortcuts, so assign carefully.

Wednesday, December 9, 2015

Colored output from Bash

Problem:
I've got colored output from bash (mostly git diffs) which I need to save *with* the coloring intact.

Solution:
- Pipe the output (*with coloring enabled - use --color switch or equivalent*) to a file.
- Get ansifilter
Download source , compile and install.
- Convert input to latex, compile the tex, save the PDF

Friday, August 21, 2015

Inkscape Latex render improvement

This little fix by KaKiLa allows passing of packahe options to the latex renderer (TexText) in inkscape.
To use, back up and then patch your source file eqtexsvg.py (usu. located in /usr/share/inkscape/extensions). Backup and delete the compiled bytecode (eqtexsvg.pyc), then restart Inkscape!

Tip: Remember that python is "indentation space" sensitive. So when you patch the script pay attention to the leading whitespaces.

Saturday, February 14, 2015

Nexus Un-Lollipop-ping

So Android Lollipop 5.0 was a fairly disappointing experience, as reported by many other Nexus 7 users. 5.0.1 and 5.0.2 were better, but significantly worse than KK 4.4.4, so I'm back to on KitKat using the instructions provided on the Android Developers' site. In brief the steps are:

  1. Download image for your device from the link above and extract the . Enable developer options on your device
  2. Go to Settings > Developer options > Enable USB debugging
  3. Connect USB Cable to a computer where adb is installed (On Ubuntu 14.04 you can install android-tools-adb package from synaptic)
  4. Click "allow" on device to always allow connections from that computer (useful incase you ever get locked out of the device)
  5. Reboot the device into bootloader. Use the device specific instructions or, in a terminal, run: adb reboot bootloader
  6. Unlock the bootloader (CAUTION:this wipes the device)
    fastboot oem unlock
  7. Flash the new image by executing flash-al script in the image directory
  8. Reboot into Bootloader as in step 5, then lock the bootloader using  fastboot oem lock

Wednesday, October 22, 2014

Guest Login

Recently there was a need to have a "volatile" guest account on my debian box. The solution it to create a user account with the $HOME in /tmp so it will get wiped out. (This is on Debian Wheezy / stable)

The relevant command is in this answer on SuperUser

> # Create account called guest with $HOME in /tmp
> # and default shell as 'none' so ssh access is not possible
> sudo useradd -mb /tmp -s /bin/false -c "Welcome Guest" guest;
> #Disable the password - Click on "Guest" in login screen
> #Make sure you have users displayed on the login screen!
> sudo passwd -d guest

Now I need to figure out how to display a nice welcome message for the Guest user *after* login (Ubuntu 14.04 does this out of the box)

Sunday, October 19, 2014

Recording Stereo Mix using avconv

Based on instructions here:
http://askubuntu.com/questions/233060/recording-speaker-audio-using-avconv

Identify your device first:

$ pactl list sources | grep output



Get the string under "Name:", it will be something like: alsa_output.pci-[some number].analog-stereo.monitor

Record audio and Video:
avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -f x11grab -r 30 -s 1920*1080 -i :0.0 -vcodec libx264 -preset ultrafast -ab 320k -t 10 -threads 8 screen.mkv

Record only audio:
 avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -t 1620 -threads 8 screen.mp3