Author Archives: paranoids

Migrate Windows 10 from HDD to smaller SSD with clonezilla


Here the Howto as always
You might need some advanced knowledge with parted and clonezilla.

Create a Backup of the working system. Just in case 🙂

Shrink your HDD via windows disk management to fit to your SSD size.

If windows won’t let it shrink to the preferred size you have to disable hibernate, pagefile, and system protection temporary.
You might also want to remove the windows update backups with windows disk clean utility.

Make with clonezilla a full disk backup.

I like to disconnect the old HDD when backup with clonezilla has finished. Just in case 🙂

When clonezilla livecd has started, open an new terminal and create a new partition table with parted according to you old partition table on the HDD (GPT, MSDOS, Boot Partition, Windows Partition and Windows recovery Partition) on your fresh SSD.
The new partitions must fit at least the size of your partitions from backup. You shrunk them down before. Bigger no problem.
In case of MSDOS don’t forget to set the boot flag.

Start clonezilla and choose partition backup. Restore full disk won’t work, in most cases the SSD is smaller than your HDD.

In case of MSDOS partition table write MBR to the new SSD:
Write MBR with Windows Recovery from install media or ms-sys

Windows Recovery Disk:

bootrec /fixmbr
bootrec /rebuildbcd
bootrec /fixboot


ms-sys -7 /dev/sdx
ms-sys -n /dev/sdx1

If you have issues with bootrec

bcdboot sourcedriveletter:\windows /s destrinationdriveletter:

Have fun!

nut upsd usbhid-ups segfault error 4 in APC Back-UPS RS 500 ubuntu 16.04


Following error when I tried to start upsd

kernel: [588428.295337] usbhid-ups[15008]: segfault at 0 ip 00007f7fcad3f7d4 sp 00007ffd824c5178 error 4 in[7f7fcabf0000+1bf000]

The driver seems to start fine with (with root privileges):

upsdrvctl -u root start

I’ve not further investigated. Just edit the Initscript:

vim /etc/init.d/nut-server

UPSD_OPTIONS="-u root"

line 79

! $upsdrvctl -u root start >/dev/null 2>&1 && \

Have fun!

28W Dimmable LED Desktop Light DIY

Hi there,

Here some impressions of my DIY 28W dimmable LED desktop light

Here the datasheets of the used LED-Converter and LED’s

LED: JU1215_12V-7W_eng_tds
LED-Converter: LCM-40-SPEC

Have fun!

Raspbian Jessie f2fs Raspberry PI 3


Short howto:

* install f2fs utils

pacman -S f2fs-tools

* create working directory

mkdir /root/raspbian
cd /root/raspbian

*Download and unzip your raspbian image

dd if=2017-04-10-raspbian-jessie-lite.img of=/dev/sdX bs=512k status=progress

* Put your SD-Card into your PI
* Let it setup everything

* install on your pi f2fs-tools

apt-get install f2fs-tools

* Shutdown your PI
* Insert your SD-Card to you PC
* Create directories

mkdir mnt
mkdir mnt/boot
mkdir mnt/root
mkdir boot
mkdir root

* mount raspbian SD-Card

mount /dev/sdX1 mnt/boot
mount /dev/sdX2 mnt/root

* make backup

rsync -av --numeric-ids mnt/boot/* boot/
rsync -av --numeric-ids mnt/root/* root/

* unmount raspbian SD-Card

umount mnt/boot
umount mnt/root

* recreate filesystems

mkfs.vfat /dev/sdX1
mkfs.f2fs /dev/sdX2

* mount raspbian SD-Card again

mount /dev/sdX1 mnt/boot
mount /dev/sdX2 mnt/root

* copy files to SD-Card

rsync -av --numeric-ids boot/* mnt/boot/
rsync -av --numeric-ids root/* mnt/root/

* edit cmdline.txt

sed -i 's/rootfstype=ext4/rootfstype=f2fs/' mnt/boot/cmdline.txt

* edit etc/fstab

sed -i 's/ext4/f2fs/' mnt/root/etc/fstab

* umount filesystemc

umount mnt/boot
umount mnt/root

Youre Done 🙂

Have fun!

Mikrotik RouterOS 6.38 IKEv2 Strongswan RSA Auth howto

Hi there,

a) setup clock of your routerboard

/system ntp client set primary-ntp=
/system clock set time-zone-name=Europe/Vienna

b) generate certificates

/certificate add common-name=" Root CA" name=ca     
/certificate sign ca ca-crl-host=
/certificate add key-usage=tls-server name=server1
/certificate sign server1 ca=ca
/certificate add key-usage=tls-client name=client1
/certificate sign client1 ca=ca

c) configure your server

/export compact                                                      
# jan/06/2017 12:21:49 by RouterOS 6.38
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc pfs-group=modp2048
/ip pool
add name=pool1 ranges=
/ip ipsec mode-config
add address-pool=pool1 address-prefix-length=32 name=test
/ip address
add address= interface=ether2 network=
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dns static
add address= name=test
/ip ipsec peer
add address= auth-method=rsa-signature certificate=server1 dh-group=modp2048 enc-algorithm=aes-256 exchange-mode=ike2 generate-policy=port-strict hash-algorithm=sha256 \
    mode-config=test passive=yes
/ip ipsec policy
set 0 dst-address= src-address=

d) export client certificates

/certificate export-certificate ca
/certificate export-certificate client1 export-passphrase=1234567890

e) import client certificates to strongswan (file ending is important)

 scp admin@ .
 scp admin@ .
 scp admin@ .
 mv cert_export_ca.crt /etc/ipsec.d/cacerts/cert_export_ca.pem
 mv cert_export_client1.crt /etc/ipsec.d/certs/cert_export_client1.pem
 mv cert_export_client1.key /etc/ipsec.d/private/cert_export_client1.pem

f) configure strongswan properly


conn test
 ikelifetime = 24h
 lifetime = 30m
 dpddelay = 120s


: RSA cert_export_client1.pem "1234567890"

g) fire up your vpn

:~# systemctl restart strongswan
:~# ipsec up test


For strongswan under Debian Jessie you have to remove the passphrase from the private key!
For Android set Server-Identity:!

Have fun!