Categories
How to

How to run WordPress Cron from CLI

I prefer to run cronjobs from the CLI instead of a web call.
This mostly due the memory and timeout limits that you can run into when you do use a web based cronjob.

To configure this you first have to disable the web cron within WordPress.

Then you can add the following cronjob to make it run every 10 minutes.

Optionally disable the output

Now you are sure that the job runs and finishes without it depending on how much visitors you have or timeouts that can occur.

Categories
3D Printing

Left Hand adapter to play piano without a full hand

I stumbled upon this wonderful 3D design which is actually printable.

It is an attachment to be clamped on the arm so you can play the piano.
It allows you to arpeggio one octave in the major and minor scales on all of the white and black keys!

A wonderful design if you’d ask me. I think a lot of people would like to have solutions like this.

Now, in case you are not able to print it your self. You can order prints on Thingyverse or if you live close near me (The Netherlands) I can print it for you for just the material and shipping cost.

Be sure to visit Mat Bowtell his Thingiverse page.

You can find the design and the arm attachment design in the links below.
Piano Attachment: https://www.thingiverse.com/thing:3595045
Arm Attachment: https://www.thingiverse.com/thing:2876195

Categories
3D Printing

PSU replacing Frame brace for Original Prusa i3 MK3, honeycomb

Download STL files here.

To keep the strength and use less plastic I changed the fill to honeycomb and added two bars near the edges to prevent bending.

Made this as part of my LACK modification for “Original Prusa i3 MK3 ENCLOSURE -Ikea Lack table – Prusa Research” https://www.thingiverse.com/thing:2864118

Categories
Projects

Wine and beer rack from pallet wood

Everybody likes a drink one in a while, but how nice would it be to have a place where to have your drinks including glasses stored and be able to see what you have in stock.

A nice way, a rack made out of pallet wood.

Requirements to create this:

  • Drill 3mm
  • Drilling and screwing machine
  • Screws
  • Time
  • Hammer
  • Two pallets (preferable euro pallets, EPAL)

First you have to get some pallets and remove the bottom side.

Then use the bottom side to create the shelves which will hold your bottles and glasses.

Cut out four holes for the bottles and eight U shape holes for the glasses.

In 45 degree, cut two of these holders, they are for the back of the pallet and for the wall.
This way of hanging your pallet will make it hang flat to the wall.

Screw one half to the pallet back at the top and use a bit of wood glue to make a more robust construction.

Drill holes in the wall and screw the opposite side to the wall and hang your pallet.

Top view of the pallet.

Now fill up your pallet with bottles and glasses, and light a candle to make it nice and cosy.

You are all set, now grab your self a wine or a beer from your own created pallet rack.

Categories
How to

How to train SpamAssassin to improve spam detection accuracy on DirectAdmin

Spam, one of the most irritating things when using mail.

In this article I will explain how to configure SpamAssassin to filter spam and to learn from messages you mark as Spam.
Based on assumption messages remaining in your INBOX will be learned as Ham (not spam).

When a message in your INBOX is Spam, you only have to move it to the Spam folder to let SpamAssassin learn it as spam.

SpamAssassin Setup

First of all, lets configure SpamAssassin correctly to start filtering Spam.

Go to the Spamassassin Setup page and configure the settings like shown in the below screenshot.

spamassassin-settings

Where do you want the spam to go?

Send the spam to the user’s spam folder.

What score threshold do you wish to use?

Low Threshold (5.0)

Would you like to delete high scoring spam?

Yes, block all spam scoring higher than: 10 (1-50, no decimals)

Do you wish to rewrite the subject of a spam email?

No, leave the subject unchanged.

How should the spam be delivered?

Don’t use attachments (dangerous).

Second is to install a script which will learn what is Spam or Ham to SpamAssassin.

This can be done on two ways, one script that runs as root and starts sa-learn for every mailbox under the user which owns the mailbox or a script that runs as an unprivileged user.

As extra feature it will remove spam messages from INBOX.spam who are older than one month.

Learn as unprivileged user

This will explain how to run the script as an unprivileged user, you have to place this script in ~/scripts/sa-learn.sh and create a cronjob to call it once in a while. The interval I choose is 5 minutes. I don’t have many mailboxes so this is fine for me.

Don’t forget to make the script executable:

Then add a cronjob to your account via the DirectAdmin control panel.

Optionally instead of mailing the output you can mute the output.

Or mute all output including errors

Learn as root user

This will explain how to run the script as root, you have to place this script in /root/scripts/sa-learn.sh and create a cronjob to call it once in a while. The interval I choose is 15 minutes. This is higher than the unprivileged-user script due you have to look through more mailboxes.

Don’t forget to make the script executable:

Then add a cronjob to your account via the DirectAdmin control panel.

Optionally instead of mailing the output you can mute the output.

Or mute all output including errors

Information

The following links were inspiring or helped me to get the right information how to use SpamAssassin Bayesian classifier.

Categories
FreeBSD How to

How to configure a automatically native IPv6 connection on FreeBSD

First you need to install a DHCP client

Setup config for dhcp6c

Add the following

Add the following to /etc/rc.conf

Run the IPv6 startup script.

Now startup the client

To test the connection you should be able to ping XS4ALL.

You also might want to check out these posts for some more information:
How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

How to configure a IPv6 gateway for XS4ALL on FreeBSD

Categories
FreeBSD How to

How to configure a manual native IPv6 connection on FreeBSD

Configuring a native IPv6 connection on FreeBSD with an already established connection on a router in the network is quite simple.

Add the following to /etc/rc.conf

Run the IPv6 startup script.

To test the connection you should be able to ping XS4ALL.

You also might want to check out these posts for some more information:
How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

How to configure a IPv6 gateway for XS4ALL on FreeBSD

Categories
FreeBSD How to

How to add bots to your Urban Terror server via RCON

First of all you need to configure your server first! For more info about that check here.

Now you should have your server all up and running, next thing is having control over your bots.

bot configuration

First enable the use of bots

Next, lets add bots.

addbot arguments

type
Define the name of the bot type here, chose one from the list below.
level
Define a number from 1 to 5 here to set how good the bots will try to hunt you down!
team
Define the color name Red or Blue to set the team this bot belongs to.
ping
Define the average ping time the bot will have, if you define this to a low value the bots will respond fast, I recommend setting this to 40 on a local LAN and 75 on a WAN connection.
nick
Define the nickname of the bot, I usually give a simple name like Bot1, Bot2, Bot3, etc…

addbot examples

In case you want to get rid of one or all bots, simply kick them!

Here is a simple Bash example that you could use to add or remove bots:


Here is a list of the bots names, weapons and their accessories they are carrying.

Name: Boa
Primary: ZM LR300 ML
Secondary: H&K MP5K
Sidearm: .50 Desert Eagle
Grenades: HE Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Cheetah
Primary: Kalashnikov AK103
Secondary: Franchi SPAS-12
Sidearm: .50 Desert Eagle
Grenades: HE Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Chicken
Primary: H&K G36
Secondary: H&K MP5K
Sidearm: .50 Desert Eagle
Grenades: HE Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Cobra
Primary: ZM LR300 ML
Secondary: H&K MP5K
Sidearm: .50 Desert Eagle
Grenades: Smoke Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Cockroach
Primary: H&K UMP45
Secondary:
Sidearm: Beretta 92G
Grenades: Flash Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Cougar
Primary: H&K G36
Secondary:
Sidearm: Beretta 92G
Grenades: Flash Grenades
Item 1: Silencer
Item 2: Kevlar Vest
Item 3:
Name: Goose
Primary: H&K 69
Secondary: H&K UMP45
Sidearm: .50 Desert Eagle
Grenades:
Item 1: Extra Ammo
Item 2: Kevlar Vest
Item 3:
Name: Mantis
Primary: ZM LR300 ML
Secondary:
Sidearm: Beretta 92G
Grenades:
Item 1: Laser Sight
Item 2: Silencer
Item 3: Kevlar Vest
Name: Penguin
Primary: ZM LR300 ML
Secondary:
Sidearm: .50 Desert Eagle
Grenades:
Item 1: Laser Sight
Item 2: Silencer
Item 3: Kevlar Vest
Name: Puma
Primary: ZM LR300 ML
Secondary:
Sidearm: Beretta 92G
Grenades:
Item 1: Laser Sight
Item 2: Silencer
Item 3: Kevlar Vest
Name: Python
Primary: H&K G36
Secondary: Franchi SPAS-12
Sidearm: .50 Desert Eagle
Grenades: HE Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Raven
Primary: H&K PSG-1
Secondary: H&K MP5K
Sidearm: .50 Desert Eagle
Grenades:
Item 1: Kevlar Vest
Item 2: Silencer
Item 3:
Name: Scarab
Primary: H&K G36
Secondary: H&K MP5K
Sidearm: .50 Desert Eagle
Grenades:
Item 1: Kevlar Vest
Item 2: Silencer
Item 3:
Name: Scorpion
Primary: Remington SR8
Secondary: H&K MP5K
Sidearm: Beretta 92G
Grenades: HE Grenades
Item 1: Kevlar Vest
Item 2:
Item 3:
Name: Tiger
Primary: Kalashnikov AK103
Secondary:
Sidearm: Beretta 92G
Grenades: HE Grenades
Item 1: Medkit
Item 2: Kevlar Vest
Item 3:
Name: Widow
Primary: ZM LR300 ML
Secondary: H&K MP5K
Sidearm: Beretta 92G
Grenades:
Item 1: Kevlar Vest
Item 2: Laser Sight
Item 3:
Categories
How to

How to install an Urban Terror server with bots on FreeBSD

This will install an Urban Terror server running under the user urban with 4 bots enabled on the server.

First of all we install the binaries, I prefer installing them from the ports, in case you don’t have root access you might want to manually download from https://www.urbanterror.info/. The configuration is quite the same so you should be able to install on your own.

For the port install use:

Lets get some coffee, cause this installation might take a while… The installation requires downloading UrbanTerror411.zip from one of the mirrors which is around 1GB in size 🙂

After installing you need to add a user to run the server.

I don’t set a password for this account simply because I mostly su into it 😉 So…

First create the required directories

In this directory you need to add the configuration files: server.cfg / mapcycle.txt / bots.cfg

server.cfg

In case you want to change this configuration, check out: http://www.urbanterror.info/docs/180-/

mapcycle.txt

I limited the map list to the maps that work fine with bots.

bots.cfg

You can start the server by manual but I would advice you do run the server with this script in tmux or in GNU Screen.

start.sh

Run it by doing

In case you want this server to be reachable for the public, don’t forget to set dedicated to 2.

Good luck! If you have any questions, let me know!

Useful info:
Urban Terror Server Setup PDF

Categories
FreeBSD How to

How to configure a IPv6 gateway for XS4ALL on FreeBSD

You might first need these two manuals.

How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

Configuring your server as a router is quite simple.

First edit /etc/rc.conf and add the following

This configures IPv6 for your interface and tells it to function as a gateway.

Now setup the config for rtadvd so it will give out the right IP range. Edit /etc/rtadvd.conf

Now fire up a client connected to the LAN side on em0 and visit the following page to check if you are using IPv6:

https://www.xs4all.nl/klant/veiligheid/mijnip

Another useful page with information how to configure IPv6 on your server is in the FreeBSD handbook.