Now owner of a Synology DS413j NAS

I have just received my NAS, which is a Synology DS413j, together with 3 HDS724040ALE640 4 TB hard drives. After unpacking everything, the first task was to mount the disk. This was very easy, without any guide. Next I connected the Synology to my router and powered it up. Synology suggested too locate it with Though it was not able to find it on my network, so I used nmap, and few seconds later I new the IP address. 2 seconds later I was connected, and running the introductive guide. I choose to select a Synology Hybrid RAID, with 1 disk protection, giving me in all 7,15 TB. And the possibility to extend it later by a disk more if needed. While it creating the filesystem, and doing the parity consistency check, I started with this post, for planning the setup. I am thinking I will do the following task.

  • Run badblocks on the disks. Even though the disks are new, I prefer to test them before trusting them with data. As DSM is using a Linux, it should be possible to run badblocks on all the disks. So figure out how to do this.
  • Create personal user accounts. Right know I only need two.
  • Create minimum two shares, named Backup and Archive. Share them by CIFS (Windows) internal only.
  • Setup time machine from my mac. I will use the NAS for backup from my mac, so it means to set it up as a time machine. Destination would be be the backup share.
  • Setup SSH server to only allow keys, and connect to my router so I can access SSH from work. I will use sshfs off cause for accessing data.

Please do comments, if you have any Ideas for what I need to do with the NAS for getting the most out of it.

Restoring Windows environment variable

Sunday I had a problem after installing GHDL on my Windows 7 at work. Instead of appending to the PATH variable, it changed it to only contain GHDL. When I found out a couple of days later, I needed to figure out to get the PATH back. First I found out that the PATH is located in the registry under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\ and the registry data itself is located under %systemroot%\System32\Config\ in the SYSTEM file. So I needed a backup of the registration database file. I noticed that inside the Config folder there is a RegBack folder containing a backup of the registry from some days before. As I was working over remote desktop, and the file was locked, I needed a way for copying them. So by using ShadowCopy from Runtime, I made a copy of the system file, and by using regedit I loaded this file into a new key, and found my old path. Later I figured out that I might had been able to find the old path in the ControlSet00X instead of looking in CurrentControlSet, bud none the less I figured out a way to get it back.

Using vim for Perl development

I am doing some Perl development at the moment, so decided to improve my Perl setup. After some work the result ended as shown below:

I use a couple of plugins to achive this setup.

  • NERD tree is the tree browser to the left. It helps with fast moving around in the files. It works either by mouse, or using the arrow keys.
  • tabbar is for showing the open buffers in the main section. I know it is old, but it does the job.
  • desert theme for the look. It is just a classic dark theme.
  • perl-support for all the perl related things. Makes it possible to check syntax, run scripts, starts debugger from the script.

As shown on the picture, it is combined with a clever tab for auto completions. All in all I am pretty happy with this solution for now.

Keyboard layout, when you are using remote desktop

I experience many situations where I need to connect to Windows over remote desktop. Until now I have just used tsclient, with a basic setup. Today I was too annoyed by the fact that AltGr and other keys don’t work on the Windows side in this basis setup.
Tsclient uses rdesktop behind the GUI, and rdesktop has a keymap parameter. This option is though not available from the Tsclient GUI. A small research later, the solution is calling rdesktop from command-line.

rdesktop -u "USER" -p - -g 1500x1096 -k da -T "TITLE" "HOST"

Here I have chosen the da keymap, equaling danish, and now all the characters is working.

Using KVM from commandline without vnc

As part of a major server upgrade, I have changed my old Compaq DL360G1, with a single pentium III to a Dell 2U 2950 with 2 Xeon E5420.

As part of the upgrade I have changed my setup from 32 bit to 64 bit, from ext3 to ext4 and from XEN virtualization to KVM.

Usually when working with KVM you use vnc. This have its pros and cons. Though, as the host server itself of cause is headless and the clients I use for administration not all have a vnc client, I was looking for a cleaner solution. The result was a way with uses screen and ncurses, so I just need a ssh access to the server for controlling everything.

# Script for using kvm virtualization from a console
# Using the easyMAC script for a xen mac
/usr/bin/screen -A -m -d -S "kvm_${NAME}" -t "${NAME}" \
/usr/bin/qemu-system-x86_64 \
--enable-kvm \
-m ${MEMORY} \
-name ${NAME} \
-smp ${CPUS} \
-drive file=${VM_GROUP}${NAME}_root,if=scsi,boot=on \
-drive file=${VM_GROUP}${NAME}_swap,if=scsi \
-net nic,macaddr=${MAC_ADDRESS} \
-net tap,script=${BRIDGE_SCRIPT} \
-k da \
-monitor unix:/var/run/kvm/monitors/${NAME},server,nowait \
-pidfile /var/run/kvm/pids/${NAME} \
-nographic \
-curses #\
#    -cdrom /root/ISO/install-amd64-minimal-20110421.iso \
#    -boot d

This is a crude example for how it is used. But should give some ideas for how it is used. Notice the two commented lines. This is for booting from a iso image.
The result is shown in the following figure: