Category Archives: Uncategorized

Bitlocker

Encrypt

manage-bde status, Provides information about all drives on the computer; whether or not they are BitLocker-protected.
manage-bde protectors, Manages the protection methods used for the BitLocker encryption key.
Kommandozeilenbefehle für Bitlocker
BitLocker-Wiederherstellungsschlüssel aus ActiveDirectory auslesen

Boot

How to use Windows Vista’s Boot Manager to boot Linux
OpenHiddenSystemDrive
How to Open Windows 7 Hidden System Reserved Partition
BCDEdit (Befehlszeilenoptionen)
Mit bcdedit das Boot-Menü von Windows 7 konfigurieren

1. Create /boot Partition with EXT4, ex. /dev/sda9
2. Extract boot sector
   $ dd if=/dev/sda9 of=/tmp/linux_boot.bin bs=512 count=1
3. Copy 'linux_boot.bin' to USB-Stick
4. Boot Windows with F8-Key pressed
5. Go to the command-line
   bootrec.exe /fixboot
   bootrec.exe /fixmbr
6. Boot Windows normally
7. Find file 'bootmgr' in root directory of 'System Reserved' partition (OpenHiddenSystemDrive64.exe)
8. Copy 'linux_boot.bin' from USB-Stick to root directory beside 'bootmgr'
9. Start BCDEdit (An example of {LinuxID} is {81ed7925-47ee-11db-bd26-cbb4e160eb27})
   bcdedit /create /d “GRUB” /application BOOTSECTOR
   bcdedit /set {LinuxID} device boot
   bcdedit /set {LinuxID}  PATH \linux_boot.bin
   bcdedit /displayorder {LinuxID} /addlast
   bcdedit /timeout 10

Finish!

Building a dual boot system with Windows Vista BitLocker protection with TPM support
How to Multiboot with Bitlocker, TPM, and a Non-Windows OS
BitLocker dual boot – Windows 7 and Fedora
Windows 7 Dual Boot Revisited with Bitlocker

GRUB 2 – Installation
GRUB – Sonderformen der Installation
Boot-Partition
Create Boot-Partition after Install

Die UUID der neuen Partition ermittelt man mittels folgendem Kommando:

$ ls -l /dev/disk/by-uuid

“warning: File system `ext2′ doesn’t support embedding.” but my system isn’t embedded either, why is grub trying?
I need step by step guidence to recover grub [duplicate]

$ mount /dev/sda5 /mnt 
$ mount /dev/sda9 /mnt/boot 
$ mount -o bind /dev /mnt/dev 
$ mount -o bind /sys /mnt/sys 
$ mount -t proc /proc /mnt/proc 
$ chroot /mnt /bin/bash

# grub-install --force /dev/sda9
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.

$ dd if=/dev/sda9 of=/tmp/linux_boot.bin bs=512 count=1

You are getting the warning because you are installing grub to a partition instead of the MBR. This means grub can not be embedded in the unused space between the MBR and the first partition.

BoehmGC: Garbage Collector for C and C++

  • Boehm-Demers-Weiser Conservative GC
  • BoehmGC
  • BDWGC

A garbage collector for C and C++
github: Boehm-Demers-Weiser Garbage Collector v7.5
gitub: Ivan Maidanski
IvMaiSoft by Ivan Maidanski

Garbage collection tuning
Investigation of Boehm’s GC as GCC GC
User: Laurynas Biveinis

Questions on boehm-gc, fragmentation, and low memory resources
Boehm gc in embedded scheme application
Denkwürdige Merkmale der Sprache C: dynamische Speicherreservierung einmal anders
TinyGC
Writing a Simple Garbage Collector in C
Garbage Collection in C Programs, LISP and Java programmers take garbage collection for granted. With the Boehm-Demers-Weiser library, you easily can use it in C and C++ projects, too.

Is there any embeddable lisp or scheme?
ECL – Common Lisp language (look at the GC part!)

Stack-based:
alloca(): Automatic Storage with Variable Size

No, that would not be possible. The fundamental design choice for the BDW
GC is that it is "conservative": it does not know exactly which registers
and local variables contain pointers, so if it were to decide to move heap
objects around, it would have no way to safely patch up all pointers to the
moved objects. (Some of the words that look like pointers to a moved object
might actually be non-pointer data).

In general a collector that moves objects demands either deep integration
with the compiler's code generator (such that every stack frame is marked
up with exact where-are-the-pointers information), or very tight discipline
in the source code of the client program such that moveable pointers are never
stored in local variables across points calls the collector might run. The
latter is probably compatible with programmer sanity only for generated code
and/or when implementing a virtual machine.

FreeBSD as a Bridge

FreeBSD Handbuch: LAN-Kopplung mit einer Bridge

# ifconfig bridge create
bridge0

# ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 96:3d:4b:f1:79:7a
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0

# ifconfig bridge0 addm fxp0 addm fxp1 up
# ifconfig fxp0 up
# ifconfig fxp1 up

# ifconfig bridge0 deletem fxp0
# ifconfig bridge0 destroy

Remove IPv4 10.16.4.200 from Interface re2
# ifconfig re2 inet 10.16.4.200 -alias
cloned_interfaces="bridge0"
ifconfig_bridge0="addm fxp0 addm fxp1 up"
ifconfig_fxp0="up"
ifconfig_fxp1="up"

Port Mirroring / Span Ports

FreeBSD Network Tap
What is port mirroring?
OpenBSD Network Tap

           ------------------
       re1 |     FreeBSD    | re2
     ------|  (Network Tap) |------
           ------------------
                   | vr0
                   |
                --------  
                |      |
                |  PC  |
                |      |
                --------
           (Traffic Collector)

# ifconfig bridge0 create
# ifconfig bridge0 addm rl0 addm rl1 up
# ifconfig bridge0 span vr0 

nmap – Network exploration tool and security / port scanner

How to find live hosts on my network?

# nmap --iflist

Starting Nmap 6.47 ( http://nmap.org ) at 2015-01-07 11:12 CET
************************INTERFACES************************
DEV     (SHORT)   IP/MASK                       TYPE     UP   MTU   MAC
re0     (re0)     172.21.5.109/21               ethernet up   1500  00:0D:B9:35:88:B4
re1     (re1)     192.168.1.1/24                ethernet up   1500  00:0D:B9:35:88:B5
re1     (re1)     fe80:2::20d:b9ff:fe35:88b5/64 ethernet up   1500  00:0D:B9:35:88:B5
re2     (re2)     10.0.0.1/16                   ethernet up   1500  00:0D:B9:35:88:B6
re2     (re2)     fe80:3::20d:b9ff:fe35:88b6/64 ethernet up   1500  00:0D:B9:35:88:B6
ath0    (ath0)    (none)/0                      ethernet down 2290  04:F0:21:0C:2B:A6
pflog0  (pflog0)  (none)/0                      other    up   33160
pfsync0 (pfsync0) (none)/0                      other    down 1500
lo0     (lo0)     127.0.0.1/8                   loopback up   16384
lo0     (lo0)     ::1/128                       loopback up   16384
lo0     (lo0)     fe80:7::1/64                  loopback up   16384
bridge0 (bridge0) (none)/0                      ethernet up   1500  02:A6:4D:75:47:00

**************************ROUTES**************************
DST/MASK                     DEV METRIC GATEWAY
10.0.0.1/32                  lo0 0
127.0.0.1/32                 lo0 0
172.21.5.109/32              lo0 0
192.168.1.1/32               lo0 0
192.168.1.0/24               re1 0
172.21.0.0/21                re0 0
10.0.0.0/16                  re2 0
0.0.0.0/0                    re0 0      172.21.0.1
fe80::1/128                  lo0 0
::1/128                      lo0 0
fe80::20d:b9ff:fe35:88b6/128 lo0 0
fe80::20d:b9ff:fe35:88b5/128 lo0 0
fe80::/32                    re1 0
ff01::/32                    re2 0      fe80::20d:b9ff:fe35:88b6
fe80::/32                    re2 0
::ffff:0.0.0.0/32            lo0 0      ::1
fe80::/32                    lo0 0
::/32                        lo0 0      ::1
ff01::/32                    re1 0      fe80::20d:b9ff:fe35:88b5
fe80::/32                    lo0 0      ::1
ff01::/32                    lo0 0      ::1
ff02::/32                    lo0 0      ::1
ff02::/32                    re1 0      fe80::20d:b9ff:fe35:88b5
ff02::/32                    re2 0      fe80::20d:b9ff:fe35:88b6
ff02::/32                    lo0 0      ::1
  • -e re2: Only use interface re2
  • -sn: No port scan. Only host discovery.
  • -PS161: TCP SYN Ping to port 161 (SNMP)
# nmap -e re2 -sP -PS161 172.21.6.0/24
Starting Nmap 6.47 ( http://nmap.org ) at 2015-01-07 11:05 CET
Nmap scan report for 172.21.6.29
Host is up (-0.21s latency).
MAC Address: 00:03:F4:04:C7:C7 (NetBurner)
Nmap scan report for 172.21.6.32
Host is up (-0.21s latency).
MAC Address: 00:14:2D:22:F2:74 (Toradex AG)
Nmap scan report for 172.21.6.33
Host is up (-0.21s latency).

ISC DHCP Server 4.2

Dynamic DNS (DDNS)

Dynamic DNS and DHCP – Easy to do, and you’ll thank yourself later
BIND permission errors
setting up bind to work with nsupdate (SERVFAIL)
DNS – DDNS with DHCPv4 and DHCPv6
DDNS

$ nsupdate
> server 127.0.0.1
> key DHCP_UPDATER uFj0b3YjnGGVOxpjvmpVqQ==
> zone intra.fablabwinti.ch
> update add test123.intra.fablabwinti.ch. 600 IN A 192.168.1.12
> send
update failed: SERVFAIL
$ cat zone.update
server 127.0.0.1
zone intra.fablabwinti.ch
update add test123.intra.fablabwinti.ch. 600 IN A 192.168.1.12
send

$ nsupdate -k ddns.key -v zone.update 
update failed: SERVFAIL
$ sudo /usr/sbin/named -u bind -fg
[...]
$ mv /etc/bind/db.192.168.1 /var/lib/bind
27-Dec-2014 17:30:43.649 client 127.0.0.1#44438/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 17:30:43.649 client 127.0.0.1#44438/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 17:30:43.650 /etc/bind/db.intra.fablabwinti.ch.jnl: create: permission denied
27-Dec-2014 17:30:43.650 client 127.0.0.1#44438/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': error: journal open failed: unexpected error
[...]
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 17:35:34.307 /etc/bind/db.intra.fablabwinti.ch.jnl: open: permission denied
27-Dec-2014 17:35:34.307 client 127.0.0.1#44604/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': error: journal open failed: unexpected error
$ cat /etc/apparmor.d/usr.sbin.named 
/usr/sbin/named {
  [...]

  # /etc/bind should be read-only for bind
  # /var/lib/bind is for dynamically updated zone (and journal) files.
  # /var/cache/bind is for slave/stub data, since we're not the origin of it.
  # See /usr/share/doc/bind9/README.Debian.gz
  /etc/bind/** r,
  /var/lib/bind/** rw,
  /var/lib/bind/ rw,
  /var/cache/bind/** lrw,
  /var/cache/bind/ rw,

  [...]
}
$ mv /etc/bind/db.intra.fablabwinti.ch /var/lib/bind
$ mv /etc/bind/db.192.168.1 /var/lib/bind

$ sudo /usr/sbin/named -u bind -fg
[...]
27-Dec-2014 18:04:05.276 client 127.0.0.1#51007/key dhcp_updater: signer "dhcp_updater" approved
27-Dec-2014 18:04:05.276 client 127.0.0.1#51007/key dhcp_updater: updating zone 'intra.fablabwinti.ch/IN': adding an RR at 'test123.intra.fablabwinti.ch' A
27-Dec-2014 18:04:05.281 zone intra.fablabwinti.ch/IN: sending notifies (serial 2014060402)

FAQ

DHCP Server doesn’t start

$ service isc-dhcp-server start
start: Job failed to start
$ dhcpd -t -cf /etc/dhcp/dhcpd.conf
Internet Systems Consortium DHCP Server 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
/etc/dhcp/dhcpd.conf line 8: semicolon expected.
default-lease-time 
 ^
/etc/dhcp/dhcpd.conf line 8: expecting a parameter or declaration
default-lease-time      600;
                            ^
Configuration file errors encountered -- exiting

Brother MFC-9420CN

Brother Handbücher

ubuntuusers.de: Brother Scanner Wiki

VueScan Brother MFC-9420CN Scanner Driver
Brother MFC-7420(Printer/Scanner/Multifunction) – Linux Mint Community
HOWTO: Ubuntu All Brother Printer & Scanner Driver Installation for Newbies!

$ sudo dpkg -i brscan2-0.2.5-1.amd64.deb
$ sudo brsaneconfig2 -a name=MFC-9420CN model=MFC-9420CN ip=192.168.1.12
$ sudo vi /etc/ld.so.conf.d/brother.conf 
$ sudo ldconfig
/usr/lib64
/usr/lib64/sane