Technitribe

interesting problems (and a few solutions, too)

Technitribe
  • About the Authors
  • Log In
  • Log Out
  • Lost Password
  • Register
  • Reset Password
    • 2 Apr 2012

      Setting your Emacsens default directory when launched through a custom keyboard shortcut

      Written by Tim Bielawa

      I noticed that Emacs was getting a default-directory value of / when launching it with a custom keyboard shortcut I set up in Gnome (2). The result is that opening a file started my search in the root (/) of the filesystem.

      I suppose this is due to the way in which emacs was invoked (via the window manager). Given that there was no actual present working directory, I can understand that it would default back to using /.

      At the time I was just setting the window title:

      emacs -T Emacs

      When considering how to work around this I first considered setting the default-directory in my .emacs file. This turned out to be a less an idea solution. Doing so causes it to become a global configuration value (all subsequent emacs launched via the terminal opened in ~). So instead, I changed my launcher command to this:

      emacs -T Emacs -eval "(setq default-directory \"~/\")"

      Works like a champ!

      0 Comments
    • 3 Jan 2012

      Excluding in the Emacs file completion buffer

      Written by Tim Bielawa

      I realized tonight While hacking on Taboot that Emacs was showing particularly uninteresting files in the completion buffer when opening a file. For example, scripts.pyc.

      I assumed that there was a facility for customizing this, so I did some research on the topic. Trying emacs filter possible completions and emacs filter list of completions both came up with the same documentation. The GNU documentation describes a customization facility similar to the filtering I sought after via the completion-ignored-extensions variable (part of the Dired group). However, it stops a bit short of what I was looking for. Quote from describe-variable for the variable (emphasis added):

      Completion ignores file names ending in any string in this list. It does not ignore them if all possible completions end in one of these strings or when displaying a list of completions.

      I went through some more search results and sure enough, stackoverflow provides again. In that response the author provided a fantastic defadvice which did exactly what I was looking for. By default it uses the value of your existing completion-ignored-extensions variable.

      0 Comments
    • 22 Sep 2010

      Lots more docs published on PeopleAreDucks.com

      Written by Tim Bielawa

      While I’ve been gone from the blogging world I’ve still been working on projects. Mostly I’ve been working on documentation.

      • Debian/Fedora Package Management comparison. Since switching my Slice to Fedora from Ubuntu I’ve picked up plenty of commands for managing packages. This is just a quick wiki page giving the roughly equivalent commands from Debian/Ubuntu to Fedora/RedHat.
      • regexp basics is a brief tutorial on regular expressions. My roommate abutcher put it together for his WVU CS210 (Advanced File and Data Structures) course. The DocBook 5 sources are available in git.
      • The biggest doc project I’ve been working on again (finally) is my Virtual Disk Guide aimed at power users and sysadmins. Currently it’s a rough draft and is constantly undergoing major changes and additions. It’s available as a single HTML document, chunked into multiple pages, and in PDF format. You can get the DocBook 5 formatted source to it through my GitHub account.

      My Project Templates project has seen some much needed attention recently. The DocBook starter project has been completely redone. Here’s some reasons you might want to use it.

      • Includes a basic starter document with most of the available informational tags present but commented out so all you need to do is uncomment the elements you need for your document.
      • Inclues a customizable Makefile that can adapt itself to different operating systems (Debian/Ubuntu, Fedora/RedHat, and Mac OS X) by just uncommenting the proper directory paths for the schema and stylesheet files.
      • The Makefile has targets for: cleaning up, creating schema locator files for nxml-mode in emacs, publishing PDFs, and publishing chunked or single HTML documents.
      • The comments in the Makefile also tell you what packages you need to install to get the schema and stylesheet files.

      Using the Makefile for publishing only requires having xsltproc and dblatex installed. Both of which are available through your favorite package manager.

      1 Comment
    • 26 Mar 2010

      Zone out completely

      Written by Tim Bielawa

      While searching for modes which would help me edit bind9 configuration files I came across this mailing list post. It mentions zone-mode which ended up being great for editing the actual zone files A+. It also tipped me off to another emacs Easter Egg, M-x zone. Described thus:

      zone is an interactive compiled Lisp function.
      It is bound to    .
      (zone)
      Zone out, completely.

      It’s basically an emacs screensaver/psychedelic ascii mode using your focused buffer for content. It obfuscates the buffer in ways which involves wrapping your code around the screen or swapping characters around, and even just turning it all into curly braces and wiggling. Press a key to undo it all. Might be a neat trick to play on a friend, but I see no other usage for this mode.

      0 Comments
    • 3 Feb 2010

      Macports updates their Erlang version, update your load-path’s

      Written by Tim Bielawa

      I’ve been working on my XMPP server pet project recently, and the need for a good Erlang XML parser has finally struck. I decided to go with Erlsom. It’s in MacPorts, so from there I installed it. Now, since I don’t update my port tree frequently I get delightful surprises from time to time. This time installing Erlsom triggered an update of Erlang, to the latest version!

      Short story shorter, the update changes the path to the erlang-mode.el file so before you can M-x erlang-mode again you’ll have you fix your Emacs load-path to register the new location. (See my older post on how to initially set up Erlang and Emacs from MacPorts from scratch)

      The new load commands should be:

      (setq load-path (cons  "/opt/local/lib/erlang/lib/tools-2.6.5/emacs/" load-path))
      (setq erlang-root-dir "/opt/local/lib/erlang")
      (setq exec-path (cons "/opt/local/bin" exec-path))
      (require 'erlang-start)
      

      It just requires changing the tools-x.x.x to 2.6.5.

      p.s. about erlang-mode

      2 Comments
    • →
    Page 1 of 2
    • The Authors
    • Virtual Disk Guide

      Interested in virtualization? Do QCOWs rule your filesystem? Are you a libvirt or KVM+QEMU wizard? I wrote a book about virtual disk management. Check out the The Linux Sysadmin's Guide to Virtual Disks online for free at ScribesGuides.com.


      Consider supporting the author by purchasing a hard copy of the first edition for just $10.00 on Lulu.com.

    • bitmath

      bitmath is a Python library for dealing with file size units (GiB's, kB's, etc) in a sane way. bitmath supports arithmetic, rich comparison, conversion, automatic best human-readable representation, and many other utility functions. Read some examples on the docs site or check out the source on GitHub.

    • latest posts

      • Using jq to filter an array of objects from JSON September 9, 2019
      • Two Year Break — And we’re back! November 16, 2018
      • [Updated] GitHub + Gmail — Filtering for Review Requests and Mentions January 20, 2017
    • tags

      bitmath blog conference css dblatex DNS DocBook eclipse Emacs Erlang Fedora fedora 22 filter GNU Screen Haiku Introduction java jboss LCSEE Linux locale locales fix slicehost ubuntu Macports module nist nXML-Mode opengl open source OS X package packaging pki prefix units presentation project pypi Python scholarship si summit Tutorial ubuntu xcode XML XMPP
    • h4ck teh world

      tbielawatbielawa
      • Create
        aos-cd-jobs
        October 27, 2020 - 1:45 pm UTC
      • Pull Request
        openshift/aos-cd-jobs
        October 27, 2020 - 1:45 pm UTC

Creative Commons License
Technitribe by Tim Bielawa is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.