Fix for Emacs in Gnu/Linux under VirtualBox

Filed in Emacs, GNU/Linux, WindowsTags:

I use Oracle’s VirtualBox on my employer issued laptop. I’ve vented on Twitter about my frustrations with the product.

One such frustration, one which nagged me slightly below my “drop everything and fix it” threshold, was the inability to make use of the right Control key on the laptop and external keyboards. When I issued any key chord relying on the control key, nothing happened.

This morning my frustration boiled over to the point where I banged on the malfunctioning Control key repeatedly. VirtualBox popped up a dialog box reminding me of its role as the “Host” key. The metaphorical light bulb over my head suddenly illuminated.

I switched back to the host OS, Windows 7. In the Oracle VirtualBox window I selected FilePreferences from the menu. Select Input, and then the Virtual Machine tab. At the Host Key Combination line, erase Right Ctrl and input a new one. For reasons yet investigated, only modifier keys are available. I chose a key combination unlikely in my Emacs config – Right-Shift + Right-Ctrl + Alt.

The setting takes effect immediately without having to restart the guest virtual machine.

Why I don’t use Cygwin

Filed in Emacs, GNU/Linux, Non-Free, WindowsTags: , , , ,

My work PC unsurprisingly runs Windows, specifically Windows 7 Enterprise. When customer engaged the PCs they provide unsurprisingly run Windows, typically Windows 7 Professional or Enterprise.

If I can use Gnu/Linux, be it on the “bare metal” or virtualized, that’s my preference. I want that clear at the outset.

Usually I can’t run a proper Gnu/Linux environment at a customer’s site. There are many reasons that I won’t go in to. That they deny my first choice is OK. While not optimal it is more than workable. I see it as a challenge.

When I’ve mentioned this to others, often they ask “Why don’t you use Cygwin?” Cygwin, for those who don’t know, is basically a *nux abstraction layer for Windows similar to what WINE provides as a Windows abstraction layer for *nix environments.You can DuckDuckGo for more information and a better explanation.

My biggest problem with Cygwin is that often I am prevented from running it in a corporate environment. Anti-virus, anti-malware, endpoint protection, content filters, proxies, next generation firewalls, and other mechanisms prevent the download or install or execution of Cygwin.

That alone means I cannot rely on Cygwin in many contexts.

Next, many Gnu utilities like Emacs compile natively on Windows and/or are available as native binaries, rendering Cygwin unnecessary. Non-Gnu *nix utilities are also available in similar forms. Most make it through the security mechanisms described, and if so rarely does an organization’s security or compliance team balk at them with a decent use case.

Third, many Windows environment scripting challenges are better met through Powershell than *nix shell scripts. For example, anything remotely Active Directory related can, in my opinion, be done better in Powershell. Plus often I have to provide knowledge transfer to the local IT resources, often Windows administrators.

What I Use:

There may be some bits and bobs from other sites, but these make up the main part of my portable workable environment.

I have a bigger write-up coming describing how I set up my Emacs environment in Windows.

What are your thoughts?

Emacs 24.4, ERC & SASL

Filed in EmacsTags: , , , ,

Occasionally I connect to ERC over my personal VPN. I run into a problem with freenode.net. It flags my VPN as such and requires me to use SASL to connect.

I found the erc-sasl project on githib at [https://github.com/joseph-gay/erc-sasl]. According to the author’s comment at [http://www.emacswiki.org/emacs/ErcSASL] the erc-login function in elc.el must be modified in addition to copying the erc-sasl.el file into the load-path.

Here’s what I did:

  1. Get the erc-sasl.el file from the repository above. Place it in your load-path.
  2. In your emacs init file, add the following:

  “Perform user authentication at the IRC server.”
(erc-log (format “login: nick: %s, user: %s %s %s :%s”
(erc-current-nick)
(user-login-name)
(or erc-system-name (system-name))
erc-session-server
erc-session-user-full-name))
(if erc-session-password
(erc-server-send (format “PASS %s” erc-session-password))
(message “Logging in without password”))
(when (and (featurep ‘erc-sasl) (erc-sasl-use-sasl-p))
(erc-server-send “CAP REQ :sasl”))
(erc-server-send (format “NICK %s” (erc-current-nick)))
(erc-server-send
(format “USER %s %s %s :%s”
;; hacked – S.B.
(if erc-anonymous-login erc-email-userid (user-login-name))
“0” “*”
erc-session-user-full-name))
(erc-update-mode-line))

You can also edit the system’s erc.el, replacing erc-login with this one. You may need to recompile the *.elc files if you get errors.

  1. Add the following to your Emacs initialization file

(require ‘erc-sasl)
(add-to-list ‘erc-sasl-server-regexp-list “.*”)

or

(use-package erc-sasl
:config(add-to-list ‘erc-sasl-server-regexp-list “.*”)

Let me know how it works for you. If there’s interest I will post code and patches and whatnot.

Cross Platform System-wide Org-Capture

Filed in BSD, Emacs, F/OSS, GNU/Linux, Org-Mode, OS X, Unix, WindowsTags: , , , , , ,

Here’s how I leverage Emacs org-capture from wherever I am in Windows, OS X, and other Unix and Unix-like operating systems.

I use F9 as my global capture key. It will either switch to or launch Emacs and then send [Ctrl]-c c to trigger org-capture. This way, no matter what I’m working on I’m one keystroke away.

Windows

Install AutoHotKey and add the following to your autohotkey.ahk script:

 

; org-capture
~F9::
If WinExist("ahk_class Emacs")
{
WinActivate
Send ^{c}
Send {c}
}
else
{
Run "runemacs.exe"
WinWaitActive, emacs
Send ^{c}
Send {c}
}
return
;

 

Save the file. Reload the script (right click on the notification icon and select “Reload This Script”). You can find the original version of this on my personal blog from 2011.

Gnu/Linux & BSD & Unix

Install autokey-gtk or autokey-qt depending on your desktop environment. In the main window create a new script and paste the following in:

 

import subprocess
command = 'wmctrl -l'
output = system.exec_command(command, getOutput=True)

if "emacs" in output:
    window.activate("emacs", switchDesktop=True)

else:
    subprocess.Popen("emacs")
    window.wait_for_exist("emacs")
    time.sleep(10)

keyboard.send_keys("<ctrl>+c")
keyboard.send_keys("c")

 

Assign F9 to the hotkey. Click Save. Thanks to the autokey-users group for their help troubleshooting my typos!

OS X

There are two ways I’ve accomplished this. The first is to use Keyboard Maestro if you already have it. Create a new macro called Org-Capture that triggers on F9. Have it Activate Emacs, simulate keystroke Control-C, and simulate keystroke C.

If you don’t have Keyboard Maestro, you can use the following Applescript in Automator:

 

on run {input, parameters}

tell application "Emacs"
activate
tell application "System Events"
keystroke "c" using {control down}
keystroke "c"
end tell
end tell

return input
end run

 

Save it as a service, and then in the Keyboard Shortcuts panel assign the service to F9.

Let me know how this works for you. Comments, suggestions, and recommendations are welcome as always.

How do I use feedly.com as an RSS feed source in Emacs?

Filed in Emacs, Org-ModeTags: ,

I posed the following question on Stack Exchange’s Emacs Beta site:

How do I use feedly.com as an RSS feed source in Emacs?

I’ve searched on and off for months. I haven’t found anything to even point me in the right direction to get started. I’ve opened a ticket with Feedly as well.

Context

feedly.com feeds my RSS reading across platforms and devices since Google Reader’s demise. I don’t relish moving off of feedly.com as it works well and I bought the lifetime subscription.

I want Emacs as one of the clients, eventually becoming my primary (or only) desktop client. Today I use the Feedly web app and the OS X ReadKit app on my various desktops with iOS’ Newsify and Android’s Press on mobile. They all tie into secondary services like Evernote and Buffer with varying degrees of success.

I aspire to bring my RSS desktop workflow into Emacs:

  • storing full text articles to read later (today in Evernote, eventually in org-mode);
  • sharing interesting articles (today in Buffer, eventually in twittering-mode & perhaps others);
  • emailing full text-articles (in gnus or any Emacs email client);
  • using the article as a basis for a blog post (via org-mode’s org2blog perhaps);
  • defining todos and reminders and appointments (again in org-mode);
  • browsing the original article (today in the OS’ default browser, eventually in eww or any Emacs web client [or launching the OS’ default browser]).

NOTE: I’m not asking for the whole kit + caboodle. I’m just looking for help to get started.

NOTE2: If you have solved or want to solve the whole thing, I will not object.

Web Site Maintenance 18 Oct 2014 23:00 EDT

Filed in AdministriviaTags:

Dear Friends,

The hosting provider is performing maintenance on the servers that host this site on Saturday 18 October 2014 at 23:00:00 EDT (Sunday 19 October 2014 at 03:00:00 UTC). They expect the maintenance to last 30-40 minutes. During the maintenance the site will be down.

Please plan accordingly.

Yours Truly,

The Management

[GNU/Linux] Mint 17 & Ubuntu 14.04 Graphics Fix in OS X Parallels 9

Filed in GNU/Linux, Linux Mint, Non-Free, OS X, UbuntuTags: , , , ,

I ran into an unfortunate flaw installing Mint 17 in Parallels 9. Mint 17 is built upon Ubuntu 14.04.

Here’s what I did:

  • Complete the install
  • Install Parallels Tools
  • Reboot
  • Log in as usual; don’t panic that the display and Cinnamon interface is a bit wonky
  • From the Parallels’ Devices menu under Keyboard, select Ctrl-Alt-1 to bring you to a console
  • Log in again
  • Then execute the following:

sudo mv /etc/X11/xorg.conf.`date +%Y%m%0d` /usr/share/X11/xorg.conf.d/xorg.conf
sudo reboot

Once I logged back in the graphics and Cinnamon interface displayed fine.

Let me know how this works for you!

[Ubuntu in the wild] Mercedes-Benz uses Ubuntu | Iloveubuntu: Ubuntu blog

Filed in UbuntuTags:

30 million users are using Ubuntu for school projects, online shopping, reading novels, creating 3D objects, editing images, playing games, etc, group of Ubuntu users covering artists, field workers, PHDs, essentially, covering the whole spectrum of life.

As seen across the latest years, Ubuntu has also a built-in magnet for scientific and research communities, being adopted and used in academic and research environments all over the globe, areas shaping, testing and finally creating the future.

The 500 INTELLIGENT DRIVE is a research-oriented vehicle created by Mercedes-Benz, vehicle through which Mercedes-Benz became in August 2013 the first automobile manufacturer demonstrating the actuality of the autonomous driving in both rural and urban traffic.

via [Ubuntu in the wild] Mercedes-Benz uses Ubuntu | Iloveubuntu: Ubuntu blog.

French National Police Switch 37,000 Desktop PCs to Linux | Wired Enterprise | Wired.com

Filed in GNU/Linux, UbuntuTags: ,

France’s National Gendarmerie — a national law enforcement agency — is now running 37,000 desktop PCs with a custom version of the Linux operating system, and by summer of next year, the agency plans to move all 72,000 of its desktop machines to the open source OS.

Linux is now the primary means of running computer servers inside the data centers that drive the web’s biggest services, from Google to Amazon to Facebook, but it has struggled to replace Microsoft Windows on the desktop. The news from the Gendarmerie could be a sign that this is changing.

The agency claims the total cost of ownership of Linux and open source applications is about 40 percent less than proprietary software from Microsoft, according to an article published on the European Union’s Interoperability Solutions for Public Administrations website.

To make the switch less abrupt, the Gendarmerie first moved to cross-platform open source applications such as OpenOffice, Firefox, and Thunderbird. That allowed employees to keep using Windows while they got used to the new applications. Only then did the agency move them onto a Linux OS running these same applications.

via French National Police Switch 37,000 Desktop PCs to Linux | Wired Enterprise | Wired.com.

Ubuntu user replaces proprietary OS with Ubuntu on mother’s computer, the result: “she loves it” | Iloveubuntu: Ubuntu blog

Filed in UbuntuTags:

Anecdotal but awesome:

The Ubuntu-passionate user Suicidalparrot shared on reddit an interesting personal happening, namely, installing Ubuntu 13.04 on the computer of the user’s mother, shifting the mother’s machine from the proprietary Windows 7 to the agile, solid-as-a-rock Ubuntu 13.04: “just took Windows 7 off of my 62 year old mother’s laptop, and made it brand new with Ubuntu 13.04″.

The result: “she loves it, especially since it went from a barely usable hunk of junk to running like a brand new machine”, third-party testimony once again proving how Ubuntu can transform computing lives from issue-full, sluggish to fast, brand new-like experiences, Ubuntu OS having the capacity to destroy misconceptions and faultily-spread myths, latter such as “only proprietary software can deliver performance, only with proprietary OSes one can enjoy the latest goodies on the web, professional worflows demand proprietary applications, etc”.

via Ubuntu user replaces proprietary OS with Ubuntu on mother’s computer, the result: “she loves it” | Iloveubuntu: Ubuntu blog.

While I love the big stories like the French Gendarmerie installing Ubuntu on 37K hosts, these intimate stories make my day.

%d bloggers like this: