jwallace.us

tech, tunes, and other stuff

Running Remote X Apps on the OSX Desktop

I recently had need to get an server’s console application up and running on my screen so I could do what I needed to do. It had been a while since I had done this, and the first time on OSX. I’m running OSX 10.9 Mavericks, and Apple has not shipped an X server with OSX since 10.5 Leopard. So what does one do given this situation? Here is the list of things you want to do:

On the remote server:

  • Set up your display environment variable for X, where 111.222.333.444 is the IP of your OSX computer. Its probably a good idea to append this to your .bashrc command shell initialization file.
    export display=111.222.333.444:0.0
  • Create an .Xauthority file by issuing a similar command as seen below. Substitute each of the Xs with a hexidecimal digit. The entire command argument should be exactly 32 bytes.:
    xauth add 111.222.333.444:0 . XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

On your local OSX computer:

  • Download and install the open source X server, XQuartz.
  • Open a tcp port range in your router: 6000-6063
  • Go into System Preferences > Security & Privacy > Firewall and allow XQuartz to accept incoming connections
  • Run an xterm, and inside the xterm issue the command: xhost +
  • Connect to the remore server using ssh using the -X option:
    ssh -X 555.666.777.888 -l yourlogin

After you ssh into the remote server you should be ready to run your remote X app and have it display on your local OSX computer’s desktop. Simply run the application you want from the command line. For example:
xclock &

Wirelurker

There is a new virus / trojan threat that has recently emerged that affects Apple Mac OSX and iOS devices. Taking a couple of simple precautions will ensure that you don’t have any problems. Read more below:

WireLurker: A New Era in OS X and iOS Malware
WireLurker, Masque Attack malware only a threat for users who disable Apple’s iOS, OS X security
Apple Has Shut Down The ‘WireLurker’ Malware Attacking iPads and iPhones

Now, many people who run Macs think they are immune to viruses and trojans. While not as vulnerable as Windows systems, this is certainly not the case. There is an excellent article on Tom’s Hardware that reviews the anti-virus software options available for Macs.

Best Mac Antivirus Software 2014

Dashcode in Mavericks

The last version of Apple’s developer tool called Dashcode is 3.0.5, and stopped working after OSX 10.7 Lion. So, if you have OSX 10.9 Mavericks like myself and you wish to run Mavericks, you’ll have to do a little hacking.

Using your favorite editor using sudo, go into the Dashcode application’s Contents directory and edit the following file:

/Volumes/orion/Developer/Applications/Dashcode.app/Contents/Info.plist
1
2
3
4
5
6
7
8
9
10
11
12
<key>CFBundleHelpBookName</key>
<string>Dashcode User Guide</string>
<key>CFBundleIconFile</key>
<string>Dashcode</string>
<key>CFBundleIdentifier</key>
<string>com.apple.DashcodeLegacy</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.5</string>

Look for the CFBundleIdentifier key. In version 3.0.5 it can be found on line 234. In the string that follows (line 235) change com.apple.Dashcode to com.apple.DashcodeLegacy as I have done above. Save the file and you will now be able to run Dashcode in Mavericks.

Xfce4 Lost Window Manager

There is a bug in Linux Mint 13 Xfce where the window manager will need to be restarted. You will know when this happens because all of your application’s windows are missing their borders, and that it is impossible to click on different windows to change focus.

The best solution is to restart the window manager. As a normal user (not sudo) issue the following command:

xfwm4 --replace

Adding Pepper Flash to Chromium

Adobe stopped their Flash support for Linux some time ago. However, you can still get the latest Flash through Google’s Pepper Flash player. This comes with Google Chrome, but if you’re using Chromium you will have to add it manually. Fortunately, its easy to do.

For Linux Mint 17+ the Pepper Flash is available via the default repositoies. Just do this:

1
2
$ sudo apt-get update
$ sudo apt-get install pepperflashplugin-nonfree

If you’re running an earlier version of Mint you’ll need to do this:

1
2
3
4
$ sudo apt-get update
$ sudo add-apt-repository ppa:skunk/pepper-flash
$ sudo apt-get update
$ sudo apt-get install pepflashplugin-installer

After Pepper Flash plugin is installed, you’ll need to tell Chromium to use it. Run this command as root:

echo ". /usr/lib/pepflashplugin-installer/pepflashplayer.sh" >> /etc/chromium-browser/default

It may be the case that the above command will not be sufficient if the /etc/chromium-browser/default file is constantly being overwritten. If this is the case, then you have a couple of choices.

The best choice would be to add the CHROMIUM_USER_FLAGS variable to your $HOME/.profile file. Since this filename starts with a dot (.) it will be hidden. Rest assured it does exist in your home directory.

$HOME/.profile
1
2
3
## add the next two lines, using the correct Flash version
export FLASH_VERSION=14.0.0.145
export CHROMIUM_USER_FLAGS="--ppapi-flash-path=/usr/lib/pepflashplugin-installer/libpepflashplayer.so --ppapi-flash-version=$FLASH_VERSION"

If you would rather make the change system-wide, find the chromium-browser script, search for the CHROMIUM_FLAGS variable, and add the following two lines below it:

/usr/bin/chromium-browser
1
2
3
4
5
6
# Prefer user defined CHROMIUM_USER_FLAGS (fron env) over system
# default CHROMIUM_FLAGS (from /etc/$APPNAME/default)
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
# add the next two lines, using the correct Flash version
FLASH_VERSION=14.0.0.145
CHROMIUM_FLAGS="$CHROMIUM_FLAGS --ppapi-flash-path=/usr/lib/pepflashplugin-installer/libpepflashplayer.so --ppapi-flash-version=$FLASH_VERSION"

Restart Chromium, and load the chrome://plugins page to verify that the plugin is active. (Note that if you see a Flash plugin with a version of 11.2 or lower, then that is an old, non-PPAPI version of Flash. A current version of Pepper Flash will be 11.7 or higher.)

Removing MySQL From Debian

If you simply wish to keep the MySQL service from loading on system startup, then an easy way to do that is to install either sysv-rc-conf or rcconf and turn off MySQL for the different runlevels. I prefer sysv-rc-conf for its old old school style, but they’re both really simple so it comes down to a matter of taste. To install both of these:

sudo apt-get install sysv-rc-conf rcconf

Once you have the utilities installed, just run them by either typing sysv-rc-conf or rcconf at the command line.

Now, if you’ve decided you’re really finished with MySQL, then you have a couple of options. You can either uninstall it leaving the configuration and data files, or you can completely remove it and all related files completely off your system.

In either case, the first step in removing MySQL is to stop the service:

$ sudo service mysql stop

Now MySQL is ready to be removed. To remove MySQL while saving your configuration and data files issue the following commands:

1
2
3
$ sudo apt-get remove mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean

To remove EVERYTHING, simply add the purge option:

1
2
3
$ sudo apt-get remove --purge mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean

Setting Chromium as Your Default Browser

To REALLY set it, edit (or create) the following file:

~/.local/share/applications/mimeapps.list

Add the following:

1
2
3
4
5
6
7
8
9
[Added Associations]
x-scheme-handler/http=chromium-browser.desktop
x-scheme-handler/https=chromium-browser.desktop
x-scheme-handler/ftp=chromium-browser.desktop

[Default Applications]
x-scheme-handler/http=chromium-browser.desktop
x-scheme-handler/https=chromium-browser.desktop
x-scheme-handler/ftp=chromium-browser.desktop

Then open up Chromium and set it as the default browser.