Ascolta «Grazie al Podcast»: il Podcast del NoWhereBlog!

Friday, June 20, 2014

texliveonfly won’t escalate privileges on Mac OS X

texliveonfly is a simple python script that emulates the behavior of MiKTeX on TeXLive; that is, it automatically downloads missing TeX packages from CTAN. AFAIR the MiKTeX guys actually hooked into the package resolution routines triggering a prompt when the package is missing, while, if I’ve understood correctly, this script executes a compilation and traces the output of the compilation. It is not 100% perfect, but it works most of the times, so it is really, really useful. It works as a drop-in replacement for pdflatex so you just write

texliveonlyfly my-latex-file.tex

where you would have written pdflatex my-latex-file.tex (the name is unfortunate since it’s long and it has the same texl- prefix of many other scripts, but you can fix that with an alias or a symlink).

The script should try and escalate privileges, prompting for your root password when it install the new packages. However, this is currently not working on OS X 10.9. Since the author “Saitulaa Naranong” notes that he was using Ubuntu at the time, I wonder if the script were tested under OS X at all. This is not a critique. The script is cool. You just have to prepend sudo to make certain that the packages will be actually downloaded.

Anyway, I’ve been able to isolate the bug to line 95 of the script:

elif os.name == "mac":

this won’t work because current Python version on my Mac is returning posix (which is actually technically correct — of course, the best kind of correct). The line should actually read:

elif platform.system() == 'Darwin':

provided that at line 37 you make sure to import platform as well:

import re, subprocess, platform, os, time,  optparse, sys, shlex

I’m publishing here the patch I did on the original CTAN package. On my machine, the script is found at:

/usr/texbin/texliveonfly

just do a which texliveonfly to find where yours is located. I would contribute back the changes but unfortunately I don’t know how to contact the maintainer.

Here’s the diff

Monday, June 9, 2014

SVN chokes on case-insensitive file systems upon renaming

So, this is what I’ve been fighting over

!       src/silver/main/Sm
!       src/silver/main/Sm/Main.sv
!       src/silver/main/Sm/Syntax.sv
!       src/silver/main/Sm/Terminals.sv

The friggin’ exclamation mark was because I actually renamed the directory ‘Sm’ to ’sm’ (lower case ’s’) because otherwise the example I’m working on won’t probably work on a case-sensitive FS. Problem is, doing a local ‘rename’ caused SVN to go crazy, as it would watch both the ‘Sm’ and the ’sm’ directory which, of course, happened to be exactly the same.

No problem, I said, let me just delete it on the server. NOPE. So, here’s how I did it:

  • add the new directory
  • commit (explicitly dir-by-dir if necessary) the local changes in the renamed directory
  • `svn rm` the shit out of `Sm` (that is, the upper-case directory): DISCLAIMER: it will delete `sm` so please be sure that you have committed everything you needed to stay
  • `svn up` so the content is restored from server, and fucking SVN is happy again

and now, an appeal: dear tool developers, please be aware that case sensitive file systems are not the norm. THANKS.

Wednesday, September 25, 2013

Ad-Hoc Connection between Android and Mac OS X

You might have read in many places that the way to go is in the “Sharing” configuration panel (”Condivisione”) and then configure the thing as in the picture (yes, it is a localized version, deal with it).

sharing-osx.png

You most probably want to share FROM your Ethernet using your Wi-Fi.

What other people won’t tell you — and I am here just to do that — is that if your Ethernet adaptor is not connected (this is a Macbook Air), OS X won’t complain and just won’t do anything.

So, it’s not broken or anything, it’s just silently failing.

Anyway, do it like that, and then your Wi-Fi icon will turn into an arrow pointing up with the Wi-Fi icon grayed-out on the background. That means that your Android device can use the connection of your Mac.

Nota Bene :

1) No, you cannot share Wi-Fi over Wi-Fi, because The Most Advanced Operating System In The World™ is not as advanced as Windows 7, so, sucks for you (and me).

2) Apparently you cannot just connect to your laptop if it has no Internet. Well it makes sense given that the window is called “Internet Sharing” but I just wanted a WLAN.

Tuesday, August 27, 2013

IvyDE Plug-In Slow Download in Eclipse

I’m not really fond of Eclipse, so, losing 3 hours of my life trying to understand why IvyDE downloaded dependencies at the blazing speed of 50 Bytes/second did not really made my day, today. Anyhoo, if you, like me, have spent a big part of your afternoon banging your head against the nearest wall trying to understand why the stupid POS is going so fucking slow, while typing ivy at the prompt works as expected, and you wish horrible deaths to many people you do not know, then the answer might be inside this nice window.

eclipse-network.png

tl;dr: check Eclipse’s Network settings.

Yes, because, although you might even ignore the existence of this panel, your favorite IDE might have helpfully changed its settings that one time you actually changed your settings in the system panel of OS X1, and did not revert them back when you updated them to the defaults2.

So, Dear Eclipse,

lzebx7j.gif

Footnotes

  1. it might apply to other operating systems ^top
  2. also, because only HTTP section was affected, Eclipse’s updater worked, since it connected to the repositories through HTTPS ^top

Tuesday, August 13, 2013

The Eternal “Checked vs. Unchecked Exceptions” Debate

The question sprouted in my mind this afternoon, while chatting during job. If checked exceptions are so good, then which are the right use cases? Oracle’s bottom line is

If a client can reasonably be expected to recover from an exception, make it a checked exception. If a client cannot do anything to recover from the exception, make it an unchecked exception.

That’s good and all, but then I might ask: is a database connection error “recoverable” ? Is a failed commit “recoverable? Is a failed rollback “recoverable” ?

My opinion is that failing fast is good. But, you know…

tumblr_llgaeahjah1qiyqyfo1_500.gif

Monday, August 12, 2013

How to Disable Notifications in Foursquare’s Android App ?

You can’t.

At least, not within the app. Log in to Foursquare’s web app (namely, their website), go to your profile, settings, and uncheck this bastard:

foursquare.png

Now the app will finally stay silent. Yes, the most important setting cannot be set from within the app. Go figure.

No, Foursquare, I don’t really want to be notified about every fucking single movement my friends make.

Tuesday, March 5, 2013

Obvious things that are not: Evernote startup at logon

I like Evernote, I really do. I have used Onenote on my Windows PC, but I’ve been using Evernote on my Macbook Air. The only thing that I was wondering was why it kept on popping up at every logon, even though the “load helper” option in Preferences was unchecked.

evernote.png

Right click the dock, uncheck Options > Open at login.

Obvious things not so obvious.

Tuesday, January 15, 2013

Connecting an external Microphone to a Macbook Air

You don’t need any of the expensive solutions you might have read around. You just need a cheap splitter cable (”cavo sdoppiatore”) that costs about a couple bucks.

i9cVv.jpg

for instance: http://www.amazon.co … f=pd_sxp_grid_pt_1_0

This way you can plug a regular mic into one female jack and a regular headphone in the other.

Bonus OMG-I-AM-LATE-FOR-TOMORROW’S-DEMO: Just use the mic of a bluetooth headset. (un auricolare bluetooth)

Categories

Archives

Blogroll

Last 10 entries

Admin area