Category Archives: Linux

How To: Run Arch Linux on Windows 10

Windows 10 has the ability to run a Linux subsystem.  However, you can now run Arch Linux instead of the default Debian thanks to some great work by “turbo” at github.com.  Here’s the skinny on getting this setup.

First, download the alwsl.bat file from: https://github.com/alwsl/alwsl

Next, open a command Windows command prompt and execute the following:

alwsl install

Follow the steps provided by the batch file and voila! Arch Linux on Windows.

Lastly, just open ArchLinux from the Windows menu and enjoy.

I’ve noticed using Arch Linux instead of Debian on Windows appears to have some performance gains, especially around the usage of Vim and other console editors.

How To: Xfinity TV and Arch Linux

Hey everyone, I’ve figured out how to get tv.xfinity.com working on Arch Linux today. Here’s what I did in case anyone else needs help:

First install pipelight:

user@computer:$ yaourt -S pipelight

Next, if you don’t already have it install firefox:

user@computer:$ sudo pacman -S firefox

Next, update and configure pipelight:

user@computer:$ sudo mkdir /root/.gnupg
user@computer:$ sudo pipelight-plugin ––update

Next, enable the flash plugin:

user@computer:$ sudo pipelight-plugin ––enable flash

Next, add the plugins to firefox:

user@computer:$ sudo pipelight-plugin ––create-mozilla-plugins

Lastely, make sure you have hal installed:

user@computer:$ yaourt -S hal-flash-git
user@computer:$ yaourt -S hal-info

Once you’ve completed the steps above, completely kill of firefox (Super+Q), then restart and browse to tv.xinfinity.com, you should be able to watch it with no problems.

Arch Linux Hydra Build

For a long time now I’ve been wanting to build my ideal computer. A powerful Linux machine with surrounding monitors. Recently I had the opportunity to do so. The following is a time lapse video of the entire build as well as the configuration files and list of components and where to buy them. This way, if anyone else wants to construct either the same or something along the same lines, they’ll have some footsteps to follow if they need the help.

During the trial and error process there were little milestones along the way.

Finally I got everything working correctly and the Hydra came to life.

Build Components

The following is a list of all the components used in this build along with links to purchase.

#archlinux #hydra the calm before the storm. #Linux

A photo posted by Jason Graves (@godlikemouse) on

On to part three of the Linux Hydra setup, the heads. 24” monitors all around.

A photo posted by Jason Graves (@godlikemouse) on

Part 2 wire maintenance of the Linux Hydra complete.

A photo posted by Jason Graves (@godlikemouse) on

Physical Configuration

I went with Dual Nvidia Quadro K620 video cards because they were very inexpensive and had the ability to display up to 4 monitors per video card via daisy chain through DisplayPort 1.2.  The monitors that I found that were pretty inexpensive however didn’t support direct daisy chaining so I had to purchase 2 multi monitor display adapters which essentially did the daisy chaining.  Physically, this is the setup.

GPU 1 DisplayPort Splitter 1 Monitor 1
Monitor 2
Monitor 3
Monitor 4
GPU 2 DisplayPort Splitter 2 Monitor 5
Monitor 6
Monitor 7
Monitor 8

 

Xorg Configuration

My chosen distribution for this build was Arch Linux, yours maybe different however, the Xorg configuration should be similar if not identical if you’re using the same components.  If not, then perhaps this might just help you along the way.

My first setup was using the nvidia proprietary driver, installed by the following:

user@computer:$ yaourt nvidia-beta-all

This driver set didn’t have Base Mosaic nor Xinerama working.  Everytime it was turned on the screen would black out and I would have to hard reset the machine and manually remove the settings.

Visually what I was setting up as 2 screens, one for the first GPU and another for the second.  The use of nvidia-settings made this very painless, I suggest you use it as well if you’re using Nvidia cards.

user@computer:$ sudo pacman -S nvidia-settings
user@computer:$ sudo nvidia-settings

Once you save the changes to the Xorg.conf file, you should be able to see the file located at /etc/X11/xorg.conf.

Here’s a visual representation of my screen Xorg setup.

Screen0 Screen1
Monitor 1 Monitor 2 Monitor 5 Monitor 6
Monitor 3 Monitor 4 Monitor 7 Monitor 8

Hopefully this helps in understanding what I was trying to achieve. This gave great results and allowed me to get all monitors working however, there were two issues with this setup.

The first, getting a graphical environment to support eight monitors was a bit troublesome at first. I started off using Gnome 3, tried KDE, etc. yet none of them supported anything other than a dual monitor setup. Also, xrandr did nothing to help here and even reported that the second GPU wasn’t available which was absolutely not the case. The solution here was to install a different desktop which supported multiple monitors. I went with XFCE4.

The second, windows could only be moved in the screen in which the window was created. In other words, a window created in Screen0 could only move through monitors 1-4. This became more of a problem over time and was resolved later. Here’s my first working Xorg.conf file.

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 370.28 (buildmeister@swio-display-x64-rhel04-17) Thu Sep 1 20:21:47 PDT 2016
 
Section "ServerLayout"
 Identifier "Layout0"
 Screen 0 "Screen0" 0 0
 Screen 1 "Screen1" 3840 0
 InputDevice "Keyboard0" "CoreKeyboard"
 InputDevice "Mouse0" "CorePointer"
 Option "Xinerama" "0"
EndSection
 
Section "Files"
EndSection
 
Section "InputDevice"
 # generated from default
 Identifier "Mouse0"
 Driver "mouse"
 Option "Protocol" "auto"
 Option "Device" "/dev/psaux"
 Option "Emulate3Buttons" "no"
 Option "ZAxisMapping" "4 5"
EndSection
 
Section "InputDevice"
 # generated from default
 Identifier "Keyboard0"
 Driver "kbd"
EndSection
 
Section "Monitor"
 # HorizSync source: edid, VertRefresh source: edid
 Identifier "Monitor0"
 VendorName "Unknown"
 ModelName "Ancor Communications Inc VE248"
 HorizSync 30.0 - 83.0
 VertRefresh 50.0 - 76.0
 Option "DPMS"
EndSection
 
Section "Monitor"
 # HorizSync source: edid, VertRefresh source: edid
 Identifier "Monitor1"
 VendorName "Unknown"
 ModelName "Ancor Communications Inc VE248"
 HorizSync 30.0 - 83.0
 VertRefresh 50.0 - 76.0
 Option "DPMS"
EndSection
 
Section "Device"
 Identifier "Device0"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 BoardName "Quadro K620"
 BusID "PCI:1:0:0"
EndSection
 
Section "Device"
 Identifier "Device1"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 BoardName "Quadro K620"
 BusID "PCI:2:0:0"
EndSection
 
Section "Screen"
 Identifier "Screen0"
 Device "Device0"
 Monitor "Monitor0"
 DefaultDepth 24
 Option "Stereo" "0"
 Option "nvidiaXineramaInfoOrder" "DFP-2.2.1"
 Option "metamodes" "DP-1.2.1: nvidia-auto-select +1920+1080, DP-1.2.2: nvidia-auto-select +0+1080, DP-1.1.1: nvidia-auto-select +1920+0, DP-1.1.2: nvidia-auto-select +0+0"
 Option "SLI" "Off"
 Option "MultiGPU" "Off"
 Option "BaseMosaic" "off"
 SubSection "Display"
 Depth 24
 EndSubSection
EndSection
 
Section "Screen"
 Identifier "Screen1"
 Device "Device1"
 Monitor "Monitor1"
 DefaultDepth 24
 Option "Stereo" "0"
 Option "metamodes" "DP-1.2.1: nvidia-auto-select +0+0, DP-1.2.2: nvidia-auto-select +1920+0, DP-1.1.1: nvidia-auto-select +0+1080, DP-1.1.2: nvidia-auto-select +1920+1080"
 Option "SLI" "Off"
 Option "MultiGPU" "Off"
 Option "BaseMosaic" "off"
 SubSection "Display"
 Depth 24
 EndSubSection
EndSection

The above configuration eventually became a bit problematic and reached out to NVidia to find out if there was anything that could be done to get Base Mosaic and Xinerama working in their driver.  The response I received was to try using the following driver:

http://www.nvidia.com/download/driverResults.aspx/106780/en-us

This turned out be very helpful.  Once the driver was installed I once again turned on Base Mosaic and to my surprise the entire panel of screens were being utilized under a single Screen0 entry.  This made it possible to drag windows from Monitor 1 all the way across to Monitor 8.

Screen0
Monitor 1 Monitor 2 Monitor 5 Monitor 6
Monitor 3 Monitor 4 Monitor 7 Monitor 8

This final Xorg.conf file is what I decided to keep and use going forward.

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 367.44 (buildmeister@swio-display-x86-rhel47-01) Wed Aug 17 22:53:32 PDT 2016
 
Section "ServerLayout"
 Identifier "Layout0"
 Screen 0 "Screen0" 0 0
 InputDevice "Keyboard0" "CoreKeyboard"
 InputDevice "Mouse0" "CorePointer"
 Option "Xinerama" "0"
EndSection
 
Section "Files"
EndSection
 
Section "InputDevice"
 # generated from default
 Identifier "Mouse0"
 Driver "mouse"
 Option "Protocol" "auto"
 Option "Device" "/dev/psaux"
 Option "Emulate3Buttons" "no"
 Option "ZAxisMapping" "4 5"
EndSection
 
Section "InputDevice"
 # generated from default
 Identifier "Keyboard0"
 Driver "kbd"
EndSection
 
Section "Monitor"
 # HorizSync source: edid, VertRefresh source: edid
 Identifier "Monitor0"
 VendorName "Unknown"
 ModelName "Ancor Communications Inc VE248"
 HorizSync 30.0 - 83.0
 VertRefresh 50.0 - 76.0
 Option "DPMS"
EndSection
 
Section "Device"
 Identifier "Device0"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 BoardName "Quadro K620"
 BusID "PCI:1:0:0"
EndSection
 
Section "Screen"
 Identifier "Screen0"
 Device "Device0"
 Monitor "Monitor0"
 DefaultDepth 24
 Option "Stereo" "0"
 Option "nvidiaXineramaInfoOrder" "DFP-2.2.1"
 Option "metamodes" "GPU-05f6316a-a480-b2c4-7618-d19e2bd555aa.GPU-0.DP-1.2.1: nvidia-auto-select +1920+1080, GPU-05f6316a-a480-b2c4-7618-d19e2bd555aa.GPU-0.DP-1.2.2: nvidia-auto-select +0+1080, GPU-05f6316a-a480-b2c4-7618-d19e2bd555aa.GPU-0.DP-1.1.1: nvidia-auto-select +1920+0, GPU-05f6316a-a480-b2c4-7618-d19e2bd555aa.GPU-0.DP-1.1.2: nvidia-auto-select +0+0, GPU-0cc1f3f6-5d22-fe69-aa54-cb7c8c051daa.GPU-1.DP-1.2.1: nvidia-auto-select +3840+0, GPU-0cc1f3f6-5d22-fe69-aa54-cb7c8c051daa.GPU-1.DP-1.2.2: nvidia-auto-select +5760+0, GPU-0cc1f3f6-5d22-fe69-aa54-cb7c8c051daa.GPU-1.DP-1.1.1: nvidia-auto-select +3840+1080, GPU-0cc1f3f6-5d22-fe69-aa54-cb7c8c051daa.GPU-1.DP-1.1.2: nvidia-auto-select +5760+1080"
 Option "MultiGPU" "Off"
 Option "SLI" "off"
 Option "BaseMosaic" "on"
 SubSection "Display"
 Depth 24
 EndSubSection
EndSection

I hope this helps anyone who gets stuck trying to get multiple monitors working under Linux using Nvidia video cards.  Please feel free to drop me a line if you get stuck and I’ll see what I can do to help.

Running Graboid on Linux

Want to run Graboid on Linux, cool, here’s how you do it.  First you’ll need to install either wine  to run graboid.

user@computer:$ sudo pacman -S wine

Great, next we’ll need to install Graboid.  The good news is I’ve made it very easy for you, simply download my premade version containing everything you’ll need.

Download: Graboid for Linux

Next unpack the tgz file.

user@computer:$ tar xpf graboid.tgz

Under the Graboid directory you’ll notice two files, the first is the graboid.png file which you can copy to your shared icons directory (on Arch Linux this is /usr/share/pixmaps).  The second is a simple bash script which you can use to launch Graboid from the command line.  Feel free to modify this file until your heart’s content.  Also, if for some reason you can’t execute the graboid file, be sure to change the permissions of the file.

user@computer:$ chmod +x graboid

Lastely, run Graboid.

user@computer:$ ./graboid

I hope this helps you get up and running with Graboid on Linux.  Enjoy!

Windows 10 BASH: Tips and Tricks

I’ve been using the Windows 10 BASH shell for quite a while now forcing myself to get used to it. Along the way I’ve figured out a few working arounds for features such as sshfs and simple copy paste commands. First, the copy paste. When I first started using the Windows BASH shell I found it very frustrating when trying the copy and paste using the CTRL-C and CTRL-V commands. As any Linux user will tell you, these are kill commands and it doesn’t really make sense to use them. However, I did find another set of commands which work much better, here they are.

COPY: Select text, hit ENTER.
PASTE: Right click

So much easier than trying to fiddle with CTRL commands which are sometimes working and sometimes not.

Now let’s talk about sshfs, at the time of this writing FUSE support was not part of the Windows 10 BASH shell. There is/was however a petition to get it introduced, if it’s still not included and you would like to help, vote it up using the link below.

Windows 10 BASH FUSE Support

So, how did I get something similar to sshfs working, simple I put together a couple of shell scripts that utilize rsync and here’s the gist.  Basically what we want is a way to pull all the files we want to modify locally, use an editor to modify files and when the files are modified, push them back up to the server.  To do this, I created 3 BASH shell scripts named “pull”, “push” and “watcher”.  First the pull script, this script performs an incremental rsync pulling the remote files locally into a directory of your choosing.  The “pull” file looks like this:

#!/bin/sh
 
rsync -au --progress user@someserver:/path/to/remote/directory /path/to/local/directory

 

The above requires that you pass change the “user@someserver” to your actual username and server name.  Also, the “/path/to/remote/directory” and “/path/to/local/directory” need to be changed to your specific files.  For my specific needs, I used something similar to the following:

root@myserver:/var/www/html/zf /mnt/c/Users/Jason/Documents/zf

You’ll noticed I have the end point of the rsync specified under the standard Windows file system, this is so I can use a native Windows editor (LightTable in my case) to edit the files.

Next, let’s look at the “push” file.  The “push” file looks like this:

#!/bin/sh
 
rsync -au --progress /path/to/local/directory user@someserver:/path/to/remote/directory

 

The above is very similar to the “pull” file, just in reverse. This will do an incremental push only for files that have changed.

Lastely let’s look at the “watcher” file:

#!/bin/sh
 
while ./pull && ./push;do : ;done

 

The above file continually attempts to do an incremental rsync push until you kill it (Ctrl-C). After you’ve customized the above files to your liking, all you need to do is execute a pull then execute the watcher, and you’ll have yourself a poor man’s sshfs.

user@computer:$ ./watcher

 

As an optimization approach, you can also add –exclude directives to the “pull” file which will ignore files and directories, for example:

#!/bin/sh
 
rsync -au --progress --exclude .svn --exclude .git user@someserver:/path/to/remote/directory /path/to/local/directory

How To: Hulu.com and Arch Linux

Hey everyone, I’ve figured out how to get Hulu.com working on Arch Linux today. Here’s what I did in case anyone else needs help:

First install pipelight:

user@computer:$ yaourt -S pipelight

Next, if you don’t already have it install firefox:

user@computer:$ sudo pacman -S firefox

Next, update and configure pipelight:

user@computer:$ sudo mkdir /root/.gnupg
user@computer:$ sudo pipelight-plugin --update

Next, enable the flash plugin:

user@computer:$ sudo pipelight-plugin --enable flash

Next, add the plugins to firefox:

user@computer:$ sudo pipelight-plugin --create-mozilla-plugins

Lastely, make sure you have hal installed:

user@computer:$ yaourt -S hal-flash-git
user@computer:$ yaourt -S hal-info

Once you’ve completed the steps above, completely kill of firefox (Super+Q), then restart and browse to Hulu.com, you should be able to watch it with no problems.

Browsing The Web Through An SSH Tunnel (Putty / Firefox)

Foreword

I needed a way to get inside my work firewall from home.  There was a DMZ linux machine that I could SSH to, but no VPN available.  What I really needed was a way to configure the router/firewall, but the only way to do that was to be on the internal network and browse to it using a browser.  Trying text based browsers didn’t work, the only way to access and administer the router was to use a full featured browser from behind the firewall itself.  To make a long story short, I figured out how to do it using Putty and Firefox, and this is how you do it.

Getting Started

First things first, make sure you have Putty and Firefox installed.  Next you’ll want to be able to establish an SSH connection to a remote server using Putty.  For example, launch putty, enter the host name or IP and make sure you can connect and login.  Once you have that, you’re ready to setup the SSH tunnel and browse through it.

Configuring The SSH Tunnel

Now open Putty and Enter the hostname or IP of the machine you want to establish a remote connection to.  Next under Connection->SSH->Tunnels find the radio boxes under the Destination field and make sure Dynamic is selected.  Next under where it reads Add new forwarded port: enter a source port.  For this example lets use 1024, enter this in the source port field and click the Add button.  You should see a value in the Forworded ports: list that reads D1024.  That’s all there is to the Putty side of things.  Next go back to the session area and save the current configuration as a saved session if you’d like, then Open the SSH connection.

 

Configure Putty

Configure Putty

 

 

Configuring Firefox

Now, launch Firefox, select Tools->Options and click the Advanced tab. Within the Advanced tab, click on the Network tab and click the Settings button.

 

Network Options

Network Options

 

Within the Network Settings dialog, select the Manual proxy configuration radio button and enter the following for the SOCKS Host: and Port:

SOCKS Host: localhost

SOCKS Port: 1024

 

Connection Settings

Connection Settings

 

Click OK on the Settings dialog, then Click OK on the Options dialog. Now you should be good to go.  Enter a new URL in the Firefox address bar and you’ll be browsing from the remote end of the SSH connection.

Creating Virtual Network Adapters In CentOS

Forward

So here’s the scenario, let’s say for the sake of argument that you have a CentOS linux box running with a single NIC, but you want to have 2 IP addresses assigned to this box (for whatever reason). The following is a step by step guide that will walk you through the process of setting that up.

Getting Started

First, you’ll need to determine the interface name of the network device being used.  For instance, if you’re running a wired ethernet card with a single port, the name is more than likely going to be eth0, if you’re using a wireless card it might be something like wlan0.  First thing you want to do is determine the interface name of this device.  An easy way to do this is to run the following command:

user@computer:$ ifconfig

You should see something similar to the following:

user@computer:$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:3D:2B:AD
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe3d:2bad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2855541 errors:0 dropped:0 overruns:0 frame:0
TX packets:1205674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:412143447 (393.0 MiB) TX bytes:539870133 (514.8 MiB)
Interrupt:75 Base address:0x2024

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4968261 errors:0 dropped:0 overruns:0 frame:0
TX packets:4968261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2009641198 (1.8 GiB) TX bytes:2009641198 (1.8 GiB)

In this scenario, eth0 is the network interface name and lo is the loopback name.  Now that we know eth0 is the one we want we’ll need to create a virtual device for it (aka. alias).

Create An Network Interface Alias

First, let’s change directory to the network-scripts folder.

user@computer:$ cd /etc/sysconfig/network-scripts/

Next, we’ll copy the ifcfg-<interface_name> to the alias name.

user@computer:$ cp ifcfg-eth0 ifcfg-eth0:0

In this example we are creating a single alias :0 however, you may create as many as you like.  Simply continue to copy the ifcfg-<interface_name> to the desired alias name (ie. ifcfg-eth0:1, ifcfg-eth0:2, etc).

Configure The Alias

Lastly, we need to configure the alias.  This is the step where you physically configure the interface to be static or use DHCP and set the routing information.

For arguments sake let’s configure it to be static.  Open the ifcfg-<interface_name> in the editor of your choice (ie. vi ifcfg-eth0) and set the following.

DEVICE=eth0:0
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes

Modify each alias configuration file (ie. ifcfg-<interface_name> for each virtual adapter you add) making sure to change the DEVICE, IPADDR, NETMASK and GATEWAY to suit your network.

Once you’ve modified all of the alias configurations for all the aliases you are going to add, restart the network service and you’re good to go.

user@computer:$ service network restart

You can verify that the virtual interfaces are working by pinging each one individually of by running:

user@computer:$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:3D:2B:AD
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe3d:2bad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2855541 errors:0 dropped:0 overruns:0 frame:0
TX packets:1205674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:412143447 (393.0 MiB) TX bytes:539870133 (514.8 MiB)
Interrupt:75 Base address:0x2024

eth0:0 Link encap:Ethernet HWaddr 00:25:90:3B:BB:E4
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Memory:fb5e0000-fb600000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4968261 errors:0 dropped:0 overruns:0 frame:0
TX packets:4968261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2009641198 (1.8 GiB) TX bytes:2009641198 (1.8 GiB)