Jul 02

Control VLC Media Player through D-Bus

By Xeross Posted in How-To's, Linux, Tech

I recently switched back to VLC from MPD/MPC because VLC seems to play more formats and is easier to use/set-up. However I did want to keep my global keybindings, considering I couldn’t find an option in VLC to enable them and knowing that it has a D-Bus interface I decided to figure out how it works.

After some research I found out that VLC adheres to the Media Player Remote Interfacing Specification” (or MPRIS for short) for its D-BUS commands, which can be found here. To use it you can use the command line utility to send D-Bus messages dbus-send for example:

dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop

Which returns.

method return sender=:1.50 -> dest=:1.143 reply_serial=2

And stops the audio output.

The spec lists all the available commands however as I’ll only be using the org.mpris.MediaPlayer2.Player.* commands I made a simple wrapper script:


# Simple proxy script to interface with VLC over DBUS
# Available commands can be found at http://specifications.freedesktop.org/mpris-spec/latest/Player_Node.html

dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$1

Now I can simply call vlc-proxy <command> to control VLC.


Aug 23

Customized Zenburn Palette For gnome-terminal

By Xeross Posted in Linux, Tech

I’ve recently switched to using Zenburn for Vim, and I like it a lot. Though I also wanted my terminal to match, so after some searching I found this palette setting for gnome-terminal.

However the colours didn’t match with the original colours, for example what used to be green ended up being the same colour as regular text.

So I’ve made some modifications and you can use the following palette setting to get a more ‘compatible’ Zenburn palette.


To apply it follow the instructions from the thread (Mirrored below in the case the link goes dead).

  1. Make sure that your menu bar is showing. If it is not, right click on the terminal window and select “Show menubar”.
  2. In the Edit menu, select “Profiles…”
  3. Create a new profile with whatever name you like.
  4. In your terminal, start the program “gconf-editor”.
  5. Navigate to “/apps/gnome-terminal/profiles/” and then to whatever you called the profile. If it does not show up with name, it might be called something like “Profile0″. If the latter is the case for you, check the “visible_name” property, which should match your chosen name.
  6. Double click on the “palette” property.
  7. Remove the current contents, and paste the above color palette string
  8. Close everything related to gconf-editor.
  9. Switch to the profile you selected via the Terminal’s Edit menu, and (if you want) change it to the default profile in Edit -> “Profiles…”.

Colour Preview

Tagged with:
Jul 27

Specify (Envelope) From address with mailx

By Xeross Posted in How-To's, Linux, SysAdmin, Tech

As I was setting up my Icinga install today I needed to modify the notification command so it had a specific from address, and it was using mailx.

So off I go onto google, etc. most of the answers said you could do something like:

mailx [args] example@domain.tld -- <sendmail options>

Turns out that that syntax doesn’t exist in the versions nowadays, luckily it turns out to be quite easy:

mailx [args] -S from="Name <example@domain.tld>"

Of course you can also only specify an email for the from parameter.

Anyway, hope this was helpful.


Tagged with:
Mar 12

Can’t change time/date on Xen guests

By Xeross Posted in How-To's, Linux, Tech

So I’ve encountered this problem with my VPS on 2host, for some reason the current time was 15 minutes behind the actual time the NTP servers were reporting.

I had NTPd running and everything but for some reason I couldn’t change the system clock in any way, it would just stay the same.

Luckily someone on the InspIRCd support channel mentioned a sysctl setting that would enable me to change the clock.

All you need to do is add


To /etc/sysctl.conf and then reload sysctl.conf with “sysctl -p”

Something you also might need to do is append jiffies to the current clock source

echo "jiffies" >> /sys/devices/system/clocksource/clocksource0/current_clocksource

Credits/thanks go to linuxwave for the actual commands/info.