Circularspace

Tag: linux

Linux debugging tips

📘 💻 ℹ️ Tips designed to help new Linux users work out what is going on

Making windows feel more like Linux

I haven’t posted for a while, and this is not going to be a very useful post, you have been warned… At work we use Windows. I vowed when I left my last job that I’d never go to work somewhere that uses Windows. I am very much still not a fan, especially since I have not got admin rights and we are using Windows 8 - one of the most hated versions of Windows since ME.

Command line inconsistency

RTFM! Today I brought down our head node at work, because of a misunderstanding of command line arguments for a linux program. In fairness, I should have read the man page more carefully for the entry in question! I was using xargs for some nice command line parallelism and process running. The command I ran was: ls | grep action119 | grep exposureCycle | xargs -n 1 -I {} find {} -name 'IMAGE*.

Tiling png images in linux

For printing multiple images, it’s usually handy to tile images so that more than one page fits on a piece of paper at once. This can be achieved with ImageMagick and the montage command. Building a tiled image For a 2x2 image an example command is: montage -tile 2x2 -geometry 1600x1200 1.png 2.png 3.png 4.png output.png Be careful with the output specification, as if you forget it it’ll overwrite the last png in the list.

Failed loading plugin: copr

If you’re: running Fedora using dnf as a package manager get the following error: Failed loading plugin: copr then listen up, your solution is at hand: install python-requests using yum: sudo yum install -y python-requests I have not tested if this will work installing with pip yet. The linked bug report suggests that this will be registered as a dependency as of 2014-06-05 so this problem should go away.

Mac keyboard keys with Synergy

Synergy is a great program to control multiple computers from a single keyboard or mouse even without them being plugged in. The only requirement is that theyre on the same local network. Im sharing my configuration which has my windows desktop as the server, and my macbook as the client. Using a windows keyboard creates some issues with the macbook, so here are the settings I use to map the keys correctly:

Tunneling to a remote machine via ssh

Update: For the most part, I want to tunnel from the server to the local machine. This only works with the localhostname set to localhost, for example to tunnel a mysql server to the current machine port 10101: ssh -L 10101:localhost:3306 user@remoteserver.com -N The localhost is important, and in this case the mysql client (on the local machine) has to have the hostname set to 127.0.0.1 (for some reason localhost doesnt work).

Synergy

I have recently been playing with the Synergy software, which allows a single mouse and keyboard to control multiple computers whatever operating system they may be using. I am currently using my PC’s mouse and keyboard to write this on my macbook pro! It’s pretty easy to set up, the windows server is pretty simple, the only bit the documentation does not emphasise enough is that the screens must be named after the hostname of the computer, so for widows it’s the ‘Computer name’ and for OSX/linux it’s the output of the ‘hostname’ command.

Linking on linux

I’ve just found out what some strange linking options mean with gcc! Quite often i’ve seen at the linking stage gcc object.o -o executable.out -lsomelibrary -Wl,-rpath,somepath I’ve discovered that the -Wl,-rpath,somepath expands basically to -Wl -rpath=somepath and this means the location of the shared library in somepath is hard coded into the executable to be used at runtime. rpath means runtime path, all of which means the dangerous LD_LIBRARY_PATH environment variable is not needed.