Archiv für den Monat: Januar 2015

postfix: Reject some recipient adresses while using catchall on a domain

If you have a catchall on a domain – like anginf.de – you will probably get spam on some adresses which you would like to exclude from the general catchall. This can be achieved by doing some simple steps.

First you have to create a file /etc/postfix/recipient_block with all those email adresses you want rejected:

spam@anginf.de REJECT
morespam@anginf.de REJECT

To be useable for postfix, you have to postmap this file.

root@host:~# postmap /etc/postfix/recipient_block

In your /etc/postfx/main.cf, add a new line to your smtpd_recipient_restrictions:

hash:/etc/postfix/recipient_block

Now you only have to reload postfix and all mails to those mentioned in /etc/postfix/recipient_block will be rejected:

root@host:~# service postfix reload

Configure IR Remote for ODROID C1

  1. sed -i 's/debug_enable\ =\ 0/debug_enable\ =\ 1/' /etc/odroid_remote.conf
  2. odroid_remote /etc/odroid_remote.conf
  3. tail -f /var/log/kern.log
  4. Now press the buttons on your IR remote. You will get an error code which changes in the first letters. The last four letters are the factory code.
  5. Replace the ZZZZ in the following with the four letters command and execute the command.
    sed -i 's/factory_code.*/factory_code\ =\ 0xZZZZ0001/' /etc/odroid_remote.conf
  6. odroid_remote /etc/odroid_remote.conf
  7. tail -f /var/log/kern.log
  8. The custom error code will be replaced by „scancode is ...., invalid key is 0x....
  9. The LAST two letters of the „scancode“ are the needed keycodes. Enter it under key_begin and repeat_key_begin in your /etc/odroid_remote.conf
  10. odroid_remote /etc/odroid_remote.conf
  11. If you’re satisfied with the result, disable the debug_enable flag again:
  12. sed -i 's/debug_enable\ =\ 1/debug_enable\ =\ 0/' /etc/odroid_remote.conf
  13. And one final last time, run the odroid_remote-program:
  14. odroid_remote /etc/odroid_remote.conf

Here’s my sample /etc/odroid_remote.conf, I configured it using a YAMAHA RV520 remote control:

factory_code = 0x1f000001
work_mode = 0
repeat_enable = 1
repeat_delay = 40
repeat_peroid = 39
release_delay = 121
debug_enable = 1
 
key_begin
        0x45 2   # Key "1"
        0x41 3   # Key "2"
        0x5e 4   # Key "3"
        0x49 5   # Key "4"
        0x4d 6   # Key "5"
        0x51 7   # Key "6"
        0x58 8   # Key "7"
        0x5c 9   # Key "8"
        0x5d 10  # Key "9"
#       0x00 11  # Key "0"
        0x1f 25  # Remote ">" (Play), Kodi "Play", Key "P"
        0x13 33  # Remote ">>" (FFWD), Kodi "Fast Forward", Key "F"
        0x15 19  # Remote "<<" (RWND), Kodi "Rewind", Key "R"
#       0x00 57  # Remote "||" (Pause), Kodi "Pause/play", Key "<SPACEBAR>"
        0x14 14  # Remote STOP, Kodi STOP, Key "X"
        0x1c 105  # Remote Left, Kodi Left, Key Left
        0x1d 106  # Remote Right, Kodi Right, Key Right
        0x1e 103  # Remote Up, Kodi Up, Key Up
        0x1a 108  # Remote Down, Kodi Down, Key Down
        0x4a 28  # Remote Select, Kodi Select, Key "<ENTER>"
        0x1b 14  # Remote Return, Kodi Back, Key "<BACKSPACE>"
        0x1b 1   # Remote Exit, Kodi Previous Menu/Home Screen, Key "<ESC>"
        0x40 71  # Remote Home, Kodi Top Menu, Key "<HOME>"
key_end
 
repeat_key_begin
        0x45 2   # Key "1"
        0x41 3   # Key "2"
        0x5e 4   # Key "3"
        0x49 5   # Key "4"
        0x4d 6   # Key "5"
        0x51 7   # Key "6"
        0x58 8   # Key "7"
        0x5c 9   # Key "8"
        0x5d 10  # Key "9"
#       0x00 11  # Key "0"
        0x1f 25  # Remote ">" (Play), Kodi "Play", Key "P"
        0x13 33  # Remote ">>" (FFWD), Kodi "Fast Forward", Key "F"
        0x15 19  # Remote "<<" (RWND), Kodi "Rewind", Key "R"
#       0x00 57  # Remote "||" (Pause), Kodi "Pause/play", Key "<SPACEBAR>"
        0x14 14  # Remote STOP, Kodi STOP, Key "X"
        0x1c 105  # Remote Left, Kodi Left, Key Left
        0x1d 106  # Remote Right, Kodi Right, Key Right
        0x1e 103  # Remote Up, Kodi Up, Key Up
        0x1a 108  # Remote Down, Kodi Down, Key Down
        0x4a 28  # Remote Select, Kodi Select, Key "<ENTER>"
        0x1b 14  # Remote Return, Kodi Back, Key "<BACKSPACE>"
        0x1b 1   # Remote Exit, Kodi Previous Menu/Home Screen, Key "<ESC>"
        0x40 71  # Remote Home, Kodi Top Menu, Key "<HOME>"
repeat_key_end

And here are the keycodes you’ll need for each key:

Key keycodes
ESC 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
0 11
12
= 13
BS 14
TAB 15
Q 16
W 17
E 18
R 19
T 20
Y 21
U 22
I 23
O 24
P 25
[ 26
] 27
ENTER 28
L CTRL 29
A 30
S 31
D 32
F 33
G 34
H 35
J 36
K 37
L 38
; 39
40
` 41
L SHIFT 42
\ 43
Z 44
X 45
C 46
V 47
B 48
N 49
M 50
, 51
. 52
/ 53
R SHIFT 54
* 55
L ALT 56
SPACE 57
CAPS LOCK 58
F1 59
F2 60
F3 61
F4 62
F5 63
F6 64
F7 65
F8 66
F9 67
F10 68
NUM LOCK 69
SCROLL LOCK 70
HOME 7 71
UP 8 72
PGUP 9 73
74
LEFT 4 75
5 76
RT ARROW 6 77
+ 78
END 1 79
DOWN 2 80
PGDN 3 81
INS 82
DEL 84
F11 87
F12 88
R ENTER 96
R CTRL 97
/ 98
PRT SCR 99
R ALT 100
Home 102
Up 103
PgUp 104
Left 105
Right 106
End 107
Down 108
PgDn 109
Insert 110
Del 111
Pause 119

Helpful links for this article: