Udgivet i

Bloker Eric Jones fra din WPForms kontakt

Der er en berygtet spammer, der går under pseudonymet “Eric Jones”.
De er i stand til at omgå Google captcha og sende hyppige beskeder til WordPress (og sandsynligvis andre) kontaktformularer.
Hvis du bruger WPForms som jeg gør, så kan du gøre brug af denne enkle, gratis løsning, der burde blokere Eric Jones spam.
Den er afhængig af en simpel kendsgerning, som nemt kan ændres til enhver tid: spammeren bruger altid den samme e-mail.
WPForms understøtter tilfældigvis sortlister til felter, så der er vores løsning!

1. Gå til din WPForms-administratorside.
2. Rediger din kontaktformular.
3. Klik på “Feltindstillinger” til venstre under felter, der allerede skulle være åbne.
4. Klik på dit e-mail-felt
5. Åbn fanen Avanceret til venstre
6. Under Tilladelsesliste / Afvisningsliste skal du vælge Afvisningsliste
7. Et nyt felt skal dukke op. Indsæt “eric.jones.z.mail@gmail.com” og seneste “ericjonesonline@outlook.com” i den.
8. Gem din formular

Det er det! Det er en måde, du kan blokere Eric Jones på.
Der er andre måder, men de fleste af dem koster penge eller er lidt smarte.

Udgivet i

perl: warning: Setting locale failed

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:


export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Udgivet i

Windows 7 – never Launch Startup Repair

Do this command:

bcdedit /set {current} bootstatuspolicy ignoreallfailures

Similar is

bcdedit /set {default} bootstatuspolicy ignoreallfailures

They can be the same if you are booted into the default load, so default would equal current.

For more information, the relevant Google search is “disable Windows Error Recovery” (minus the quotes).

Udgivet i

Swap area in OpenSUSE

First create an 1Gigabyte file.

opensuse:~# dd if=/dev/zero of=/swap   bs=1024 count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 28.7256 s, 35.6 MB/s

DD command to create the 1G file basically writing “0” into the file swap_1 in the “/” file system.

Create SWAP area

opensuse:~ # mkswap /swap
Setting up swapspace version 1, size = 999996 KiB
no label, UUID=4aada58e-d6f7-4053-adf1-8d4c79122d36

That sets up the file as a swap area.

Now, we’ll simply enable the swapfile, so that the system can start paging physical memory pages onto it.

opensuse:~ # swapon /swap

The system should now have an additional 1Gigabyte of swap area. Check it.

opensuse:~ # free -tom
total       used       free     shared    buffers     cached
Mem:           998        973         24          0         20        795
Swap:         1716          0       1716
Total:        2714        973       1741

We now have 1.7Gigabytes of swap area.

To confirm the swap areas we have

opensuse:~ # swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/system-swap                 partition       757752  0       -1
/swap                                      file            999992  0       -2

To make it permanent, we need to add an entry to the /etc/fstab file.:

/swap       swap                 swap       defaults              0 0

Where /swap is our new swap file and it instructs the system to mount it at system startup as a swap area.

Udgivet i

Secure AXIGEN against brute-force with Fail2Ban [Linux]

Fail2Ban (http://wikipedia.org/wiki/Fail2ban) protects your server against intruders who try brute force to guess passwords.
Enables you to monitor standard services such as SSH, Apache, etc..

Furthermore, AXIGEN can be secured against password attacks.

The following steps are necessary:
The steps may differ depending on your distribution.

Step 1: Install Fail2Ban
Step 2: Create a shell script:

# $1 - log file to be used
if [ -z "$1" ]
tail --retry --follow=name "$LOG_AXI" | while read l
 timestamp=$(date '+%d-%m-%Y %T')
 case "$l" in
 *"Authentication error"*|*"could not authenticate user"*|*"error authenticating user"*) sid=$(echo "$l" | awk '{print $6}')
 if [ -n "$sid" ]
 con_ip=$(grep -m 1 $sid "$LOG_AXI" | awk '{print $NF}' | sed 's/\[//g;s/:.*$//g')
 if [ -n "$con_ip" ]
 echo "$timestamp $l from $con_ip" >> "$LOG_SEC"

Step 3: Make sure that there script runs automatically, for example, /etc/inittab

If AXIGEN writes the log file to another location, please kindly adjust the path to the variable $ LOG_AXI.
For secure.txt file a log Rotate should be established
Test the script as follows:
Start the script
Check the contents of secure.txt
Run a false login with, this should be reported as follows

18-07-2014 14:35:42 07-28 14:35:42 +0300 02 localhost IMAP:000000CC: Authentication error for user ‘user1@localdomain’: Invalid password from

Step 4: Create a new module Fail2Ban to, for example, axigen.cfg under /etc/fail2ban/filter.d
With content:

# Fail2Ban configuration file
failregex = from <HOST>

Step 5: Configure Fail2Ban where you expand the jail.conf under /etc/fail2ban to block the following:

enabled = true
filter = axigen
port = all
logpath = /var/opt/axigen/log/secure.txt
bantime = 100
maxretry = 3
banaction = iptables-allports

The maximum number of failed attempts, spell-time and path please adjust accordingly.
Then please restart fail2ban.


From http://www.axigenmailgate.de/forum/archive/index.php/t-935.html

Udgivet i

Block or redirect using mod_geoip

Installing mod_geoip allows you to block or redirect traffic based on the geografical location of the client using the IP-address of the client. mod_geoip for CentOS is available at the EPEL repository. If you haven’t setup the EPEL repository follow the instructions explained on their website. I asume you allready installed Apache. Download and install mod_geoip, GeoIP and the related libraries:

yum install GeoIP GeoIP-devel GeoIP-data zlib-devel mod_geoip

As MaxMind regularly update their database files you might choose to download the file manually using by a cronjob. Create a bash script which download and install the GeoLite databases. This example is base on the GeoLite version, if you have a subscription your change the according lines to download the appropiate database files:

#Download Maxmind GeoIP databases
cd /var/lib/GeoIP
mv GeoIP.dat GeoIP.dat.old
/usr/bin/wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
/usr/bin/wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoLiteCity.dat.gz

Make this script executable:


and edit your crontab to run this script every 3rd day of the month:

crontab -e

Edit the configuration file /etc/httpd/conf.d/mod_geoip.confand activate the module and change the path of the database. (GeoLiteCity.dat also returns the CityNames and the geographic locations):

LoadModule geoip_module modules/mod_geoip.so
<IfModule mod_geoip.c>
  GeoIPEnable On
  GeoIPDBFile /var/lib/GeoIP.dat

and restart Apache:

/ect/init.d/apache restart

Now create a .htaccess file. For example if you want to block clients from Russia and China:

Deny from env=BlockCountry

If you want to redirect based on the country using mod_rewrite in combination with mod_geoip, your .htaccess file could look like this:

RewriteEngine on
RewriteRule ^(.*)$ http://www.mydomain.com/nl/$1 [L]

For more example take a look at he website of MaxMind

Copy from http://www.linux-faqs.info/apache/block-or-redirect-using-mod-geoip

Udgivet i Skriv en kommentar

Set the PATH in Win 7 to NPM, GIT, Cordova and Android





%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%ANDROID_HOME%\tools\;%ANDROID_HOME%\platform-tools\;%JAVA_HOME%\bin\;%ANT_HOME%\bin\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd;C:\Users\User\AppData\Roaming\npm

Udgivet i Skriv en kommentar

Android WakeLock + Cordova 3.*

Google Developer PowerManager

I Manifestet brug:

 <uses-permission android:name="android.permission.WAKE_LOCK" />

I activity*.java læg til det med tykt markeret. 

import android.os.Bundle;
import org.apache.cordova.*;
import android.view.WindowManager;
public class Tutix extends CordovaActivity
 public void onCreate(Bundle savedInstanceState)
 // Set by <content src="index.html" /> in config.xml

Under layout:


That’s it.

Udgivet i

Find bad sectors

You can find the bad sector by running a smart long test;

# smartctl -t long /dev/sda

You can then check the status of the long test to see if its finished, and the LBA of the first error it encountered;

# smartctl -l selftest /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.7.0-1-amd64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     17711         12345
# 2  Short offline       Completed without error       00%     17709         -
# 3  Short captive       Interrupted (host reset)      10%       450         -
# 4  Short captive       Interrupted (host reset)      10%       228         -

You can then overwrite the bad sector using dd;

# dd if=/dev/zero of=/dev/sda seek=12345 count=1
Udgivet i

Sådan tilføjer eller sletter du en samba-bruger under Linux

For at tilføje en ny bruger for at få adgang til en samba-share skal du først oprette en serverbrugerkonto ved hjælp af kommandoen “useradd” og derefter bruge den samme konto til at tilføje samba-brugeren. Følg trinene nedenfor for at tilføje brugeren john og give ham adgang til en samba-share.

Tilføjelse af en Linux-brugerkonto

En måde for en bruger at gennemse en Samba-share er at have en UNIX-konto på Samba-serveren. Dette gøres via kommandoerne ‘useradd [brugernavn]’ og ‘passwd [brugernavn]’. Hvis du allerede har oprettet brugerkontoen på systemet, skal du springe delen nedenfor over og fortsætte med at tilføje samba-bruger direkte.

# useradd john

Indstil adgangskoden til den nye oprettede bruger.

# passwd john

Tilføjelse af Samba-bruger

Når først brugeren har en lokal konto, kan deres tilsvarende Samba samba-bruger tilføjes ved hjælp af smbpasswd -a kommando. Kommandoen smbpasswd, når den bruges med -a-indstillingen tilføjer den nye samba-bruger og giver dig også mulighed for at indstille adgangskoden til den nye samba-bruger. For eksempel for brugeren john, brug kommandoen nedenfor:

# smbpasswd -a john
New SMB password:
Retype new SMB password:

-a- tilføjer john til Samba-adgangskodelisten.

For at ændre en eksisterende Samba-brugers Samba-adgangskode (ved at bruge eksemplet john-bruger igen):

# smbpasswd john
New SMB password:
Retype new SMB password:

Giver brugeren adgang til samba share
Konfigurer Samba-delingen i /etc/samba/smb.conf-konfigurationsfilen for at tillade den nye bruger at gennemse delingen:

# vi /etc/samba/smb.conf
   comment = A Shared Directory
   path = /var/tmp/sharedir
   valid users = anthony john
   public = no
   writable = yes

Brug testparm til at vise din opdaterede andel. Genindlæs smb.conf-konfigurationsfilen med kommandoen nedenfor.
Til RHEL/CentOS 6

# service smb reload

For RHEL/CentOS 7

# systemctl reload smb

Sletning af Samba-brugeren

Brug nedenstående trin for at slette samba-brugeren. sørg for, at du også sletter den tilsvarende UNIX-bruger fra serveren, hvis det er nødvendigt.

1. slet samba-bruger(john) ved hjælp af smbpasswd-kommandoen med -x option.

# smbpasswd -x john
delete unix user(john) by userdel

2. Du kan nu slette UNIX OS-brugeren john sammen med alle de filer, der er knyttet til brugerens hjemmemappe ved at bruge kommandoen ‘userdel -r’.

# userdel -r john