Split a file into a number of equal parts

As an example, we have a file named primary_data_file.txt that contains 616 lines of data. We want to split this into 4 files, with the equal amount of lines in each.

The following command should do the trick:

The option -da generates the suffixes of length 1, as well as using numeric suffixes instead of alphabetical.

The results after running the command are the following files:

Making the PS3 controller work in Windows 10

I recently began playing Rocket League on my PC, but didn’t find it satisfying that I had to use my keyboard and mouse. Luckily I already have a PS3, and with the USB-connection that comes along with the controllers, I was able to use them to play.

So, on to making it work.

  1. First download the software Motion Joy DS3 from http://jorge.fbarr.net/files/motioninjoy-0-7-1001-en-win.zip. When it finishes downloading, install it.
  2. Plug in your PS3 controller through the USB connection.
  3. Set the date on your system back to the year 2014
  4. Go to Driver Manager and check the box next to Port.. under Hardware Location, and click Install all.
  5. Click on Profiles and select the fifth option – Xinput-default Xbox 360 controller emulator.
  6. Set the date back to what it was.
  7. Finally, click Enable.

Whenever you want to play a game and use your PS3 controller, connect your controller with a USB cable, fire up the program DS3 Tool and click Enable. Then start your game, and the controller should work!

Test if a port on a remote system is reachable

With telnet:

With bash:

Replace tcp with udp, depending on what you want.

With netcat:

If the port is open, you will get an output of 0. If it’s closed, it’s a 1.

Compare the output of two commands

..without creating a temporary file:

The -y is just to show a side-by-side comparison. Very handy! And the result?

Thanks to my colleague Ingvar for showing me this!

No Wi-Fi device found

I just reinstalled one of my machines with Fedora 21. The install went great, but when the machine was done rebooting, and I was trying to set up my access to a wireless network with nmcli (NetworkManager), I got the following error-message:


Spending a lot of time finding what the problem was, I finally found the solution.  It seems that Wi-Fi support in NetworkManager has been separated to a plugin. The package NetworkManager-wifi was missing. So install it, reboot your machine and give it a whirl again. It should (hopefully) be working.