Longpress on macOS

By pure coincidence I manage to find a to me previously unknown function in macOS 10.14. For some characters you can actually “longpress” (holding down the key on your keyboard a little while longer than usual) and just like on your cellphone get a little popup bubble with special characters and other related special symbols and whatnot related to the key you are pressing.

The effect of some “longpresses”

This is system wide and a really smooth way of inserting special characters which are not on your keyboard. I am a bit surprised that this has not been marketed better since today is the first time I’ve ever seen this feature or even heard about it.

Graphical editing

To continue along the lines of images and media, i often need to work with images, photographs and graphics for teaching or publication purposes. For work I do have the option of getting access to Photoshop which has been the standard and go-to for editing and dealing with graphical material and Adobe has also developed their product line to contain software optimized for a number of other tasks than just photo editing throughout the years. However, this might not be a given alternative for the average home user and enthusiasm since it does costs a bit. The monetary factor did send me out on a chase for better and cheaper alternatives a few years ago.

Continue reading “Graphical editing”

CCSearch search engine

Once again, a service I found a long while ago and have been using regularly since. Perfect for finding images to websites or publications when you just know that someone else must have produced something so much better then anything you can accomplish in the allocated time frame.

What is it, CCSerach is a search engine which allows you to search for free material in the public domain that falls under the Creative Commons licenses.

Most of the material you find is acceptable to use as is though you should of course attribute and credit the creator of the material if you use it and find it useful (goes without saying, right). It is a perfect service when you need some graphic material fast, for a presentation, publication, post or anything else without having to worry about stepping on toes or getting into a legal mess due to copyright issues.

Thanos – The Infinity Gauntlet

So apparently, the Marvel-fever is here again. I am of course thinking about the new Avengers movie, Endgame. So catching on to this trend and doing something goofy, Google decided to make a publicity stunt. Go to the Google page and search for “Thanos“. In the field containing the summary on the right hand side, there is a little animated image of “The Infinity Gauntlet“. If you clock in this, what you would expect is exactly what happens, half of everything disappear. Below there is a little movie showing this, of the feature wold happen to be removed in the future though a spoiler warning is appropriate here.

Continue reading “Thanos – The Infinity Gauntlet”

Firefox Send

I was under the impression that this was something that most people would have found out about by know since it is free, secure and so incredibly useful. Despite this it seems that very few people have found out about this service that I have now been using for over a year.

Sometimes you need to send files, big files which you do not want to upload to some sort of cloud storage, create a shared link and then send this link to someone else to later remember to delete this file again. There is a better way, go to send.firefox.com, upload your file by drag-n-drop or choosing your file and upload. Choose of you want to password protect the file, how many downloads are allowed and/or how many days this file should be available on the server before it is removed, regardless of downloads.

Yes, there is no guarantee that these files are actually removed after having been download or when the deadline is passed though generally I have relatively high confidence in Firefox as a company and I do trust this service, otherwise I would not recommend it.

Go check it out!

Självklart är det ingen som kan säga att dessa filer faktiskt tas bort efter att de har laddats ned eller när den deadline man satt passerats men generellt sett har jag relativt högt förtroende för Firefox och litar även på denna service.

OpenGL through X/VNC

Have you spent time pounding your head against the wall trying to get OpenGL displays working when connecting through SSH against a server? I have. Turns out that the solution was pretty damn simple, apparently XQuartz no linger supports this by default and hence you just need to activate the function…

defaults write org.macosforge.xquartz.X11 enable_iglx -bool true

After this you can connect to your server and enjoy OpenGL displays over X or VNC.

ssh [-X/-Y] username@server

The logic underlying paid/free coffee and lock-policy

I often find myself smiling a bit when contemplating the logic behind the decisions regarding our new university building. There are a number of different areas, some of which are public. Hence, it is important to separate between which resources are available in public or locked/private spaces. One such resource is coffee, there are coffee machines spread out throughout the building. All of the machines placed outside of “locked” areas, where students and the general public have access, are paid machines. Hence, you cannot get yourself a cup of free coffee without paying for it, which in the surface is not completely illogical.

Now to the point, in an effort to make the facilities more “open” and increase staff comfort levels since staff likely have to lock and unlock the door to the staff room a couple of times per day (I assume), the decision was made to leave the doors to the staff room and kitchen open. What this means is that if you take a little walk arond the building and look at the different floor maps spread throughout the building you can pretty quickly locate the staff room and kitchen which is well equipped with three or four coffee machines, mugs, spoons, plates, forks, knives, fridges with milk, butter and the staff members lunch boxes and reasonably well stocked supply of bisquits, hard bread and tea. The only thing stopping anyone from visiting this room, supplying yourself with whatever you find or doing whatever you want to peoples food is a sense of it “being wrong”. Nowhere are there any signs or other information available that in any way states or demands that you have to be an employee to make use of the facilities or the consumables stored there and since all the doors are unlocked I see no reason not to do so either.

The the becomes, what is the logic in having a several coffee machines and other vending machines where you can buy coffee and hard bread while at the same time making the decision not to lock the room(s) containing the machines where anyone has access to an unlimited amount of coffee and assorted snacks for free? Making it even more comical is the fact that several staff members have their offices in the same space as the staff room, behind these unlocked doors. This means that these individuals now must lock and unlock their offices every time they need to visit the restroom or have a cup of coffee since anyone now can walk in and supply themselves with whatever they desire from any unlocked office, one of the reasons we now have numerous locked doors spread out throughout our new university building.

I have no answers and I fail to see the logic behind this decision compared to the motivation of installing an infinite number of doors and locks.

Install AmberTools18 (amber18) on Mac OS X 10.14 (Mojave) using Homebrew (or not)

So after a fair bit of contemplating I made the decision to switch from MacPorts to Homebrew. This has not been a painless process and even if I like Homebrew, there are a number of caveats and I cannot for the life of me understand the motivation for implementing this “features”. Having this said, I am now fully committed to Homebrew and hence instructions for how to compile software will from now on out use Homebrew (or not).

With the recent update from OS X 13.X High Sierra to OS X 14.X Mojave a lot of things broke, as anticipated. This is something that I have now sadly come to expect from any update of the macOS. This did of course include the ability to compile amber on macOS. It turns out that, among other things, Apple decided that ”libstdc++” is deprecated and you should now use ”libc++” without leaving any backwards compatibility solution. Some other important files have also gone missing that used to reside in /usr/include/ that you now need to manually installed from an PKG installer buried in Xcode, this will however stop working with the next major Xcode release and undoubtedly brake a lot of other things as well. Long story short, this is what you need to do to compile AmberTools18/amber18 on macOS Mojave using Homebrew GCC8 or just using the macOS clang compiler. The journey resulting in this post is long and includes more issues than reported though I will not describe all of them since that would take a looooong time and would potentially not be very interesting for the general public.

Compile AmberTools18/amber18 using Homebrew GCC8

  1. Install Xcode and Command Line Tools
    Xcode10 is most appropriately installed from the AppStore
    You need to install Command Line Tools manually by executing the following in Terminal.app
    sudo xcode-select --install

  2. Install Homebrew and GCC
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew install gcc

  3. Install missing header files
    In Terminal.app, run the following command to open the PKG installer and follow the instructions.
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

  4. Download the AmberTools18/amber18 archives and extract them where you want to install them.
    tar xvf AmberTools18.tar.bz2

  5. Configure and install
    export AMBERHOME=/[PATH]/[TO]/amber18
    export PATH=${AMBERHOME}:$PATH
    cd $AMBERHOME
    export MACOSX_DEPLOYMENT_TARGET='10.14'
    Eliminates an error: "cannot find <include> file".
    ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc
    ln -s /usr/local/bin/g++-8 /usr/local/bin/g++
    ln -s /usr/local/bin/c++-8 /usr/local/bin/c++
    ./configure -macAccelerate gnu
    make install

This will produce a working version of AmberTools18/amber18 using Homebrew GCC8 though there are still issues and there will undoubtedly be more issues that will surface before everything works as intended.

Compile AmberTools18/amber18 using macOS clang

  1. Install Xcode and Command Line Tools
    Xcode10 is most appropriately installed from the AppStore
    You need to install Command Line Tools manually by executing the following in Terminal.app
    sudo xcode-select --install

  2. Install the missing header files
    In Terminal.app, execute the following command to launch the PKG installer and follow the instructions.
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

  3. Download AmberTools18/amber18 archives and extract where you want to install.
    tar xvf AmberTools18.tar.bz2

  4. Configure and install
    export AMBERHOME=/[PATH]/[TO]/amber18
    export PATH=${AMBERHOME}:$PATH
    cd $AMBERHOME
    export MACOSX_DEPLOYMENT_TARGET='10.14'
    Eliminates an error: "cannot find <include> file".
    vi $AMBERHOME/AmberTools/src/configure2
    Comment out rows 2237-2241
    # if [ "$intelmpi" = 'yes' ]; then
    # echo "Intel MPI must be used with the Intel compilers."
    # exit 1
    # fi
    #


    vi $AMBERHOME/AmberTools/src/pytraj/setup.py
    Change libstdc++ to libc++ on row 142
    142 extra_compile_args.append('-stdlib=libstdc++’)
    --->
    142 extra_compile_args.append('-stdlib=libc++’)



    Also change the same on rows 2289-2293
    2289 # mac/clang
    2290 if [ "$skippython" = "no" ]; then
    2291 cpptrajcxxflags="-stdlib=libstdc++ $cpptrajcxxflags"
    2292 cpptrajldflags="-stdlib=libstdc++ -L/usr/lib/"
    2293 fi
    --->
    2289 # mac/clang
    2290 if [ "$skippython" = "no" ]; then
    2291 cpptrajcxxflags="-stdlib=libc++ $cpptrajcxxflags"
    2292 cpptrajldflags="-stdlib=libc++ -L/usr/lib/"
    2293 fi


    ./configure -macAccelerate clang
    make install

This produces a working version of AmberTools18/amber18 using macOS clang though there are still issues and there will, without a doubt, be more issues that will surface.