Mounting NFS shares on Mac OS

When trying to mount a NFS share that is exported by a Linux NFS server (the kernel implementation), I got a „Permission denied“ error. There are lots of explanations around in the internet that recommend to use the resvport mount option like

$ sudo mount -t nfs -o resvport,rw kepler:/home/bwalle /Volumes/kepler

However, I didn’t want to change the settings on the client but on the server. This has the advantage that I can still use Finder to mount NFS which isn’t able to provide special mount options.

The solution was to use insecure in /etc/exports like

/home/bwalle *(rw,no_subtree_check,insecure)

What is insecure about that option? Well, the check comes from the early days of Unix where only the system administrator had the root password. So only applications running as root can open TCP connections with privileged source ports (below 1024). However, nowadays everybody knows that NFS in its versions 2 and 3 are insecure by design and removing the check for the source port doesn’t make it more insecure.

Veröffentlicht unter Allgemein, Mac | Hinterlasse einen Kommentar

Using a dark background with CoIDE

At work I had to develop some firmware for two different ARM micro controllers (LPC and STM32). Although I don’t like IDEs in general, after some search I’ve chosen CoIDE for that task.

It works well with Segger JLink, supports a broad list of micro controllers (including the ones our hardware had)  and it’s free (in terms of beer, not speech). Well, it only works on Microsoft Windows, but as long as I only have to work under Windows and not for Windows, that’s okay for a while.

The only thing I missed was the ability to choose a dark colour theme. Yes, I don’t like white background when coding. I hate it! CoIDE is based on Eclipse and on eclipsecolorthemes there are plenty of themes available for that IDE, including – of course – dark ones.

Unfortunately the developers of CoIDE removed the ability import options, which makes it also impossible to import that theme. But when using an text editor, the theme can be imported manually by editing a few settings file. That’s what I describe here.

So let’s download a theme and open the EPF file. It looks like

/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Foreground.SystemDefault=false

Most settings are for different Eclipse plugin (in Eclipse, every function is a plugin, even the core text editor). My theme has settings for C/C++ (CDT), Java (JDT), PHP, Ruby, Python and so on. In case of CoIDE, we care about following:

  • /instance/org.eclipse.ui.editors
  • /instance/org.eclipse.cdt.ui

That’s it. All lines that don’t start with one of the two prefixes can be removed.

Now make sure that CoIDE is not running and open the file C:\CooCox\CoIDE\configuration\ProgramData\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.cdt.ui.prefs in the text editor of your choice. That can be ViM or Notepad++. Append each line that starts with /instance/org.eclipse.cdt.ui but remove the prefix. Example:

asm_directive=147,199,99
asm_label=224,226,228
c_braces=232,226,183
c_comment_task_tag=255,139,255

The same for org.eclipse.ui.editors.prefs in the same directory: Add everything that starts with /instance/org.eclipse.ui.editors and remove the prefix. Either use rectangular selection or search and replace.

Now start CoIDE and enjoy the result:

coide_screenshot

That’s Obsidian, BTW.

Veröffentlicht unter Allgemein, Embedded | 5 Kommentare