Resource User


title: “Resource User”
date: 2016-01-13T10:15:13
slug: resource-user


root@host1:/home/ubuntu# puppet resource user root
user { 'root':
 ensure => 'present',
 comment => 'root',
 gid => '0',
 home => '/root',
 password => '\*',
 password\_max\_age => '99999',
 password\_min\_age => '0',
 shell => '/bin/bash',
 uid => '0',
}

Modify Resource (/bin/bash to /bin/sh):

puppet resource user root > user.pp
vi user.pp

user { 'root':
 shell => '/bin/sh',
}
root@host1:/home/ubuntu# puppet apply user.pp
Notice: Compiled catalog for host1.nyc2.example.com in environment production in 0.05 seconds
Notice: /Stage[main]/Main/User[root]/shell: shell changed '/bin/bash' to '/bin/sh'
Notice: Finished catalog run in 0.13 seconds

Wenn eingehende Mails nicht mehr gescannt werden


title: “Wenn eingehende Mails nicht mehr gescannt werden”
date: 2015-08-22T10:43:17
slug: wenn-eingehende-mails-nicht-mehr-gescannt-werden


vi /var/lib/spamassassin/spamd.log

Bei solchen Einträgan:
Sat Aug 22 11:38:31 2015 [17318] warn: spamd: unauthorized connection from localhost [127.0.0.1] at port 48960 at /usr/sbin/spamd line 1274.

Checken welche IP Adresse an spamd schickt:

tcpdump -i any -n port 783

Diese dann in

/etc/default/spamassassin

eintragen (nach -A)

Bsp:

OPTIONS="-A 127.0.0.1 --create-prefs --max-children 5 --username debian-spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"

Alle Computer aus dem AD exportieren


title: “Alle Computer aus dem AD exportieren”
date: 2015-08-21T09:54:20
slug: alle-computer-aus-dem-ad-exportieren


Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap –Auto

Add AD Module to Woershell (2008R2)

addAD

Alle computer exportieren (W2003)
dsquery computer -limit 500 > computer.txt

Configure IP Adress on 3COM Switch


title: “Configure IP Adress on 3COM Switch”
date: 2015-08-19T09:55:28
slug: configure-ip-adress-on-3com-switch


There are serveral ways but, if you have a serial console cable you can set the IP using the following process:

Get a serial console cable. Note that I went through several of them before I found one that would let me SEND characters to the device; I could see the switches boot activity but nothing I typed would appear on the console window… so if you have this problem, get another cable!
Get a terminal program. Windows Vista and 7 removed HyperTerminal (which is quite annoying) but you can download a free, fully functional version for 30 days from hilgraeve.com/hyperterminal-trial .
Start your HyperTerminal using the following settings: connect using COM1 (or whatever port you are using) 19 200 bits/sec 8 data bits No parity 1 stop bit No flow control
Power up your 4200G (or similar aged 3Com switch)
In the Hyperterminal Window you will see something like, and you will have just a second or two press CONTROL+B to enter the book menu:
Starting……
***********************************************************
* * * Switch 4200G 24-Port BOOTROM, Version 1.00
* * * ***********************************************************
Copyright (c) 2004-2005
3Com Corporation and its licensors.
Creation date : Nov 20 2006, 17:02:48 C
PU type : BCM5836
CPU Clock Speed : 200MHz
BUS Clock Speed : 33MHz
Memory Size : 64MB
Mac Address : 0017e01f7a40
Press Ctrl-B to enter Boot Menu… 2
type:
system-view
interface vlan 1
ip address xxx.xxx.xxx.xxx mmm.mmm.mmm.mmm
save
type
quit

Getting ‘Technisat Combo HD CI’ working


title: “Getting ‘Technisat Combo HD CI’ working”
date: 2015-05-22T13:39:32
slug: getting-technisat-combo-hd-ci-working


Make the following changes to the kernel sources:

Code:
— a/linux/drivers/media/dvb-core/dvb-usb-ids.h 2013-05-11 16:19:28.000000000 +0200
+++ b/linux/drivers/media/dvb-core/dvb-usb-ids.h 2013-05-16 22:57:24.040221334 +0200
@@ -366,6 +366,7 @@

define USB_PID_TERRATEC_DVBS2CI_V2 0x10ac

define USB_PID_TECHNISAT_USB2_HDCI_V1 0x0001

define USB_PID_TECHNISAT_USB2_HDCI_V2 0x0002

+#define USB_PID_TECHNISAT_USB2_HDCI_V3 0x0003

define USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2 0x0004

define USB_PID_TECHNISAT_USB2_DVB_S2 0x0500

endif

— a/linux/drivers/media/usb/dvb-usb-v2/az6007.c 2013-05-11 16:19:28.000000000 +0200
+++ b/linux/drivers/media/usb/dvb-usb-v2/az6007.c 2013-05-16 22:54:43.145236251 +0200
@@ -875,6 +875,8 @@
&az6007_props, “Terratec H7”, RC_MAP_NEC_TERRATEC_CINERGY_XS)},
{DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7_2,
&az6007_props, “Terratec H7”, RC_MAP_NEC_TERRATEC_CINERGY_XS)},
+ {DVB_USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V3,
+ &az6007_props, “Technisat Combo HD CI”, RC_MAP_NEC_TERRATEC_CINERGY_XS)},
{0},
};

S960C DVB/S2 Receiver an odroid-c1


title: “S960C DVB/S2 Receiver an odroid-c1”
date: 2015-04-17T14:44:36
slug: s960c-dvbs2-receiver-an-odroid-c1


Firmware Downloaden und installieren (Entpacken und script ‘copy-firmware.sh’ starten)

Kernel Update auf 3.10

git clone https://github.com/hardkernel/linux.git -b odroidc-3.10.y
cd linux
make odroidc_defconfig

DVB Kernel Patch laden und anwenden:
kernel-3.12.5-dvbsky.patch.tar
Oder hier downloaden:
wget http://www.dvbsky.net/download/linux/kernel-3.12.5-dvbsky.patch.tar.gz
tar -xzvf kernel-3.12.5-dvbsky.patch.tar.gz
patch -p1 < kernel-3.12.5-dvbsky.patch

make menuconfig
Und DVBS2 TReiber als Modul wählen:

Device Drivers —>
Multimedia support —>
Media USB Adapters —>
(M) DVBSky USB2.0 support

apt-get install lzop
make -j 4 uImage modules
make dtbs
sudo make modules_install
sudo cp arch/arm/boot/uImage /media/boot
sudo cp arch/arm/boot/dts/meson8b_odroidc.dtb /media/boot
sudo init 6

Kanäle scannen (Hotbird)
w_scan -fs -s S13E0 -c DE -X > channels.conf

Bei Problemen mit DISEQC (Nicht alle Satelliten funktionieren) das Timeout in der Datei szap-s2.c erhöhen (eine 0 anhängen)
`void diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
{
if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1)
perror(“FE_SET_TONE failed”);
if (ioctl(fd, FE_SET_VOLTAGE, v) == -1)
perror(“FE_SET_VOLTAGE failed”);
usleep(15 * 10000);
if (ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) == -1)
perror(“FE_DISEQC_SEND_MASTER_CMD failed”);
usleep(cmd->wait * 10000);
usleep(15 * 1000);
if (ioctl(fd, FE_DISEQC_SEND_BURST, b) == -1)
perror(“FE_DISEQC_SEND_BURST failed”);
usleep(15 * 10000);
if (ioctl(fd, FE_SET_TONE, t) == -1)
perror(“FE_SET_TONE failed”);

}
`

ffmpeg starten
ffmpeg -i udp://@239.100.0.9:1234 http://192.168.0.11/almajd01.ffm

dvbstream -f 11623 -p v -s 27500 -v 232 -a 252

dd if=/dev/dvb/adapter0/dvr0 conv=noerror | ffmpeg -i pipe:0 http://xxa.biz:8090/sadfjds2344kjflkasdflkj.ffm

Security / Sicherheit


title: “Security / Sicherheit”
date: 2015-04-06T20:19:50
slug: security-sicherheit


Hardening init

vi /etc/inittab

and add the line:
ss:S:respawn:/bin/sulogin

Hardening GRUB (Debian 7)
1 – Type the command: grub-mkpasswd-pbkdf2
2 – Enter the desired password

It will generate a long password encrypted like this: grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5

3 – Copy the complete generated code.
4 – Edit the file: /etc/grub.d/40_custom
5 – At the end of the file add the following commands:

set superusers=”username”
password_pbkdf2 username password

Obviously you should replace the words “username” with your desired user name, and the word password for the encrypted password generated in the previous step.
For example, if your desired username is John, and the password is grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5 your full code will look like this:

set superusers=”John”
password_pbkdf2 John grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5

6 – Save the file and exit.
7 – Finally, type the command: update-grub

DNS Konfiguration (client)


title: “DNS Konfiguration (client)”
date: 2015-04-06T20:05:36
slug: dns-konfiguration-client


/etc/nsswitch.conf

Beispielzeile:
hosts: dns [NOTFOUND=return] files

Zuerst Abrage des DNS Servers. Wenn der DNS Server angefragt werden kann, aber die Zone nicht auflösen kann,
gibt die Abfrage einen Fehler zurück. Das local file (/etc/hosts) wird nur abgefragt wenn der DNS Server nicht erreichbar ist.

Sample /etc/resolv.conf
search example.com
nameserver 192.168.1.254
nameserver 24.215.7.126
options timeout:2

netstat


title: “netstat”
date: 2015-04-06T19:42:13
slug: netstat


Zeigt Ports an auf denen ein Dienst läuft

netstat -ant

Interface mit Statistik anzeigen (RX-OK RX-ERR RX-DRP RX-OVR,…)

netstat -i

Aktive Ethernetverbindungen anzeigen (State: ESTABLISHED):

netstat -t

Aktive UDP Endpunkte anzeigen

netstat -u