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:

..and:

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.

Introduction to cron

cron is a time-based job scheduler. This piece of software utility is used when you need to have a program run repeatedly at set time.

The daemon that runs in the background is named crond, while the file that contains the jobs themselves is named crontab.

You have three main directories:

  • /etc/crontab is the main system crontab file.
  • /var/spool/cron/ a directory for storing crontabs defined by users.
  • /etc/cron.d/ a directory for storing system crontabs.

Creating

Creating a crontab-file for your user is easy. Usage depends on what you need to do.

Edit

This command will allow you to edit the current user’s crontab. If a crontab doesn’t already exist, it will create a new one once you have saved your changes.

Edit another user’s crontab

You can also edit another user’s crontab, but only if you have the correct permissions in place to do so.

List

or

..to list another user’s crontab.

These are the most common usages of the command crontab. For a couple of more options, see man crontab.

Syntax

The syntax of a crontab-file looks like this:

Each asterisk represents a field. Starting from left to right, the fields are as follows:

  • Minute (0 – 59)
  • Hour (0 – 23)
  • Day of month (1 – 31)
  • Month (1 – 12)
  • Day of week (0 – 7, where 0 and 7 is Sunday)

On the fields Month and Day of the week, you can also use names instead of numeric values.

Operators

There are various operators that you can use with cron. Here’s the list:

Asterisk (*)

An asterisk (*) is used to indicate that every instance (i.e. every hour, every weekday, etc.) of the particular time period will be used. So if you use an asterisk in the field Hour, it means that it will run every hour.

Comma (,)

With this operator you can specify a list of values. If you use 1,5 in the field Day of week, this would mean Monday and Friday.

Dash (-)

While comma specifies a list of values, dash specifies a range. 1-5 in the field Day of week would mean Monday to Friday.

Forward slash (/)

Forward slash specifies a step value. If you’d like to execute a command every other hour, you could use 0-23/. You can also use steps after an asterisk, so if you want the command to run every two hours instead, use */2.

Examples

First

In this example the script backup.sh runs at 14:45, the first day of the month, every month.

Second

This line runs the command list_files.sh at 04:30 on the 1st and 15th of each month, plus every Friday.

Third

The line above runs the command wake_up.sh at 08:00, Monday to Friday.

Fourth

..and this line would run the program annoy_wife.sh every five minutes, every day.

As always, if you want to know more about cron, check out the command man cron.

Have fun!