Ard Ray

Read this first

Persistent IPtables on Raspberry Pi (Raspbian)

This article is not about building proper iptable rules but on how to make iptable configurations to load on every reboot.

I have been trying to find a consistent and easy solution to implement iptables on Raspberry Pi (Raspbian-wheezy), the way Debian and Raspbian works does not provide a way to load iptables on every boot, it needs to be added manually as a script to load on start-up. There are ways to make Raspbian work without the instructions below, although the following - I think - are very simple and elegant.

There are some steps to take before we begin, I am going to assume you have a Rasbian Pi up and running with the following commands executed:

# rpi-update

# apt-get dist-upgrade

# apt-get update

Step 1: Install iptables-persistent package with apt-get command.

# apt-get install iptables-persistent

On the menu, select Yes on the rule.v4 file. The second choice is

Continue reading →

Unity2d - Moving platforms without character falling off. [C#]

While there are many guides about how to make moving platforms in Unity2d, most are confusing on how to make characters and objects on them to move along.

My implementation includes two empty game objects which will point the start and end point of the moving platform and the actual platform sprite. The platform we want to move horizontally, vertically and diagonally.


The public variables are the following shown above, which are self-explanatory.

using UnityEngine;
using System.Collections;

public class MovingPlatform : MonoBehaviour {
    [SerializeField]float movingSpeedx;
    [SerializeField]float movingSpeedy;
    public GameObject platform; //The actual sprite
    public GameObject start;
    public GameObject end;
    private bool orientation; //Where the platform is facing.
    private GameObject player;
    private bool horiz_movement; 
    private bool verti_movement;

Continue reading →

Unity2d - Fix the 2D basic character asset to avoid getting stuck on walls [C#]

The ability of the basic 2D character Robot from Sample Asset collection to get stuck onto walls, can be really annoying.

One option would be to increase the friction of the objects, it interacts with but that is not an optimal solution since it can create more problems in the future.

Was trying to fix the problem and this is how I got it to work properly. Added a boolean variable which will turn true if there is a collision other than the ground and will go false when the collision cease to exist. Then will allow the character to move only when the variable is false or touches the ground. This solution is alright but generates some extra problems which are based on the design of the 2D character and its collision areas, such as it can get stuck on edges while jumping.

In order to fix that, I check the direction the character faces at the moment and push it slightly, to get it

Continue reading →

SSH version statistics in March 2013

Another interesting fact that came up with the processing of SSH banners which were captured in March 2013, is the amount of hosts using deprecated versions of SSH.

Out of 1900734 IPs, we have the following results:

SSH Version Number of Hosts
2.0 1678331
1.99 172907
1.5 21281
1.4 6
1.3 2
modified version 13
Diversity: 1.44

Modified versions included heavy alterations of the SSH banner, such as “SSH Secret” and “SSH 4.00”. Since the data are one years old, the amount of hosts using SSH version below 1.99 should be even lower; we can claim that 1.5 SSH version or worse, still exists.

Continue reading →

FTP and the idea of Diversity

Wouldn’t be nice, if we had a single number that represents the uniformity of a network? A number that shows if multiple hosts are using the same services or they try to be as diverse as possible from the norm.

The idea is based on the following paper.

So, what that actually means? Lets say we have a number of hosts using a specific operating system, then the diversity of that system is very low, instead if the same number of hosts tend to use different operating systems it increases and will continue to do so, until everyone is using a different operating system with different version. That, of course is not limited to operating systems which is rather trivial to calculate (if you have access of the network from the inside, at least).

What we try to do is find servers on the Internet which are happy to talk to us and share information. Using ZMap and banner grabbing techniques, we

Continue reading →

Setting up Go-lang-plugin on IntelliJ IDE (Windows)

While there are many guides about setting up go-lang-plugin on Linux and Mac Os X wasn’t able to find one for Windows and it took me a while to figure it out.

Bypassing the very basic steps, you should have Go SDK (Download) and IntelliJ IDE (Download) installed.

Open the directory which you installed Go -> bin and execute go.exe.

Now open IntelliJ and go Run -> Edit Configurations and on the menu Go Application should have the name of the project you created. Click on it and check the Environment variables on the right. Add GOROOT=“directory of Go folder” (E.g. GOROOT=C:/Go).

Although I still get an error: GOPATH environment variable is empty or could not be detected properly., have tried compiling different projects and no problem so far.

Continue reading →