Pages

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

Thursday, September 12, 2013

QGit Segfaults on opening the settings dialog

Seem to be running into a few corner cases today. Qgit is a really nice viewer for git repositories, but it would crash each time I attempted to open the settings dialog. After some hours of debugging I traced the problem to the presence of newlines in the branch description. Full details can be seen in the bug report on launchpad.net

Octave PDF print error

Spent a while debugging a mysterious error with exporting PDF plots from Octave. To test if you have the same bug run the following commands on an octave prompt:

clear
close all
sombrero
print -deps temp.eps
print -dpdf temp.pdf

Now check for the following errors/warnings:

1. Did you get an error saying epstool binary not found?
Solution:
Install epstool from your package manager (synaptic or equivalent)

2. Did you get an error from Ghostscript?
e.g. GPL Ghostscript X.XX: Unrecoverable error, exit code 1

and/or

Is the EPS file unreadable?
Try to convert the EPS to pdf using ps2pdf temp.eps. If you get an error like "Error: /limitcheck in /fontfont" then there is a problem with the installed fonts. Try the diagnostic test described here [3]:
octave:1> set (0, "defaultaxesfontname", "Helvetica")
Solution: remove the package font-pagul. [1,2]

Links:
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662892
[2] http://octave.1599824.n4.nabble.com/3-6-1-produces-eps-files-that-are-unusable-on-Debian-wheezy-td4438420.html
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710272#17


Friday, January 11, 2013

Syntax highlighting for SPICE in gedit

Ever viewed a SPICE netlist in gedit, and struggled to make sense of it? One thing that makes life easier is Syntax highlighting.

We first need the .lang file for spice, which has been  which can be downloaded here. Then copy this file (as root) to the relevant directory, which is : /usr/share/gtksourceview-3.0/language-specs/
(You may have 1.0 or 2.0 etc. instead of 3.0)
Restart gedit,open a netlist file, and click on highlighting scheme (probably "plain text" by default, and select SPICE)


Ref: Ubuntu Forums

Sunday, November 4, 2012

Mobile posting

Setting up mobile posting for the phone!