Cron entries removed after Synology DS213 reboot

Submitted by Jochus on Sat, 23/03/2013 - 13:45 | Posted in: Linux
Posted in

Yesterday, I came to the conclusion all my cron entries were removed (for the second time!) in my /etc/crontab file on my Synology DS213 NAS server.

I noticed the cron entries were removed after a system reboot. I figured out Synology has some problems with cron entries having columns separated with spaces (not tabs). All entries including spaces are removed on system startup.

Updating my crontab by putting tabs (\t) between the columns, fixed the problem.

Hiding "Spam" (or "Ongewenste e-mail") label in Gmail (automatically created by Outlook 2010)

Submitted by Jochus on Sat, 16/03/2013 - 18:48 | Posted in: Windows
Posted in

On my Windows laptop, I'm using Outlook 2010 to fetch my Gmail account (IMAP). Gmail has its own spam folder + spam filter, and I configured Outlook to use the Gmail spam filter.

Nevertheless, Outlook always creates a second spam folder (in Dutch called: Ongewenste e-mail), which makes it complicated on other clients (or webclient) to know which one is the correct label.
I just learned you can hide labels in your webclient and/or IMAP clients by logging in into Gmail webaccount > Settings > Labels . I also marked some other labels to be hidden as well.

Importing a large SQL file in Microsoft SQL server 2008

Submitted by Jochus on Wed, 13/03/2013 - 23:17 | Posted in: Database
Posted in

  • Go to: Start -> Run -> Type cmd and press enter
  • Once the command line is on screen tell SQLCMD to import your database by doing something like this:
    sqlcmd -S [server instance name] -d [database name] -i [filename you want to import]
  • If you're not sure about the server instance name; simply open up SQL Server Management Studio and on the login screen take a note of the Server Name textbox as this is the value you need to use as the server instance name.
  • If you are trying to enter a lot of INSERT statements, don't forget to flush while inserting using the GO command (for example, after each 100 rows).

How to cleanup InnoDB storage

Submitted by Jochus on Mon, 11/03/2013 - 21:33 | Posted in: Database
Posted in


After deleting some tables/databases on my MySQL server, I noticed the ibdata1 file is never shrinking. After almost a year, my MySQL ibdata1 file became really too large.
More information on this issue:


  • Dump (e.g., with mysqldump) all databases into a .sql text file
    $ mysqldump -u root -p --all-databases > bigdump.sql
  • Drop all databases (except for mysql and information_schema)
  • Login to mysql and run 'SET GLOBAL innodb_fast_shutdown = 0;' (This will completely flush all remaining transactional changes from ib_logfile0 and ib_logfile1)
  • Shutdown MySQL
  • Add the following lines to /etc/my.cnf:
  • Delete ibdata* and ib_logfile*
  • Start MySQL
  • Import databases
    $ mysql -u root -p < bigdump.sql

How to get the data directory of MySQL

Submitted by Jochus on Thu, 07/03/2013 - 19:30 | Posted in: Database
Posted in

I manually installed MySQL on my Macbook Pro, but I didn't know where MySQL stores its data by default (it's not defined in /etc/my.cnf). You can ask this to MySQL using the following query:


This will result in something like this:

| Variable_name | VALUE                |
| datadir       | /var/lib/mysql/DATA/ |
1 ROW IN SET (0.00 sec)

How good is my wifi signal?

Submitted by Jochus on Wed, 06/03/2013 - 20:30 | Posted in: Mac
Posted in

While holding down the ⌥ key when clicking on the wifi icon, you can learn more about the strength of the current wifi connection.


RSSI or Received Signal Strength Indication can go from 0 to -100. Generally the higher (closer to 0) the better, and the closer to -100 the worse. In telecommunications, RSSI is a measurement of the power present in a received radio signal (cf. Wikipedia).

Transmit Rate

The number to pay much more attention to is the Transmit Rate. This value is the rate of which information is processed by a transmission facility. The transmit rate will drop if you have too much noise or interference or if you are too far away from the base station.

For reference:

0   - No connection
6   - Half 802.11b
11  - 802.11b
54  - 802.11g
130 - 802.11n on 2.4 Ghz
300 - 802.11n on 5.0 Ghz

Toekomst van de elektronische factuur

Submitted by Jochus on Thu, 28/02/2013 - 23:01 | Posted in: Onea
Posted in

Nu ik bijna een jaar voor Onea werk, ben ik meer en meer into eInvoicing aan het geraken. Een van de vragen die ik me onlangs stelde, was welke gegevens er verplicht aanwezig moeten zijn op een factuur. Deze gegevens liggen namelijk vast volgens art. 5 van het koninklijk besluit. Dit besluit is hier online te raadplegen.

Belangrijkste factuur gegevens:
  • Datum uitreiking van de factuur
  • Een opeenvolgend nummer dat wordt toegekend volgens één of meer reeksen
  • Het BTW-nummer van de leverancier of dienstverrichter
  • De naam of maatschappelijke benaming van de leverancier of dienstverrichter
  • Het adres van de administratieve of maatschappelijke zetel van de leverancier of dienstverrichter
  • De naam, het adres en het BTW-nummer van de cliënt
  • De datum waarop het belastbaar feit van de levering van de goederen of de dienstverrichting heeft plaatsgevonden of de datum van de incassering van de prijs of een deel ervan, voorzover die datum vastgesteld is en verschilt van de uitreikingsdatum van de factuur
  • De omschrijving van de goederen en of diensten alsmede hun eventuele hoeveelheid, dit dient de overheid toe te laten om het tarief van de verschuldigde belasting vast te stellen
  • De maatstaf van heffing, de eenheidsprijs, evenals eventuele betalingskortingen die niet begrepen zijn in de eenheidsprijs
  • De vermelding van de tarieven van de verschuldigde belasting en het totaalbedrag van de verschuldigde belasting uitgedrukt in de nationale munt van de lidstaat waar de goederen worden geleverd of de diensten worden verricht
  • Indien er een vrijstelling van BTW wordt aangevraagd, dient men duidelijk het artikel van de richtlijn ofwel het artikel uit de nationale wetgeving op te geven waarop men zich baseert om de vrijstelling te vragen of de belasting niet in rekening te brengen
Bevestiging, authenticiteit en integriteit

Verder legt de overheid ons 2 zaken op qua eInvoicing:

  • de cliënt dient akkoord te zijn met het ontvangen van een elektronische factuur
  • de authenticiteit van de herkomst en de integriteit van de inhoud van de elektronische factuur moet gegarandeerd zijn

Bij Onea hebben wij een product ontwikkeld dat aan deze voorwaarden voldoet. Ons product biedt nog een grote waaier aan mogelijkheden aan: central & legal archive, importing paper invoices & e-invoices, exporting invoices, expense handling & approving, straight through processing, workflow and matching.
Meer informatie is te vinden op

Difference between NAS, SAN & DAS

Submitted by Jochus on Thu, 28/02/2013 - 08:02 | Posted in: Linux
Posted in

I'm always confused when people talk about NAS, SAN or DAS. I just found this interesting comment on

First it is best to define the difference between a block device and filesystem. This is easier grasped if you are familiar with UNIX because it makes an objective distinction between the two things. Still the same applies to Windows.

  • A block device is a handle to the raw disk.
    • Such as /dev/sda for a disk or /dev/sda1 for a partition on that disk.
  • A filesystem is layered on top of the block device in order to store data. You can then mount this.
    • Such as mount /dev/sda1 /mnt/somepath.

With those terms in mind it's then easier to see the distinction between the following.

  • DAS is a block device from a disk which is physically [directly] attached to the host machine.
    • You must place a filesystem upon it before it can be used.
    • Technologies to do this include IDE, SCSI, SATA, etc.
  • SAN is a block device which is delivered over the network.
    • Like DAS you must still place a filesystem upon it before it can used.
    • Technologies to do this include FibreChannel, iSCSI, FoE, etc.
  • NAS is a filesystem delivered over the network.
    • It is ready to mount and use.
    • Technologies to do this include NFS, CIFS, AFS, etc.

Excel: automatic sheets wrapper (VBScript)

Submitted by Jochus on Tue, 26/02/2013 - 22:13 | Posted in: Windows
Posted in

I just found an old VBScript I wrote once for a friend who needed to merge different sheets from Excel into 1 big sheet. I can't remember all functional specifications, but the original XLS file was coming from a software package which was used to calculate sizes, measurements, ... in certain constructions of buildings. This software package was generating an XLS file with 50 sheets. But for statistical reasons, it would have been better to put it in 1 sheet. I just tested the script, and it's still working :-)

Option Explicit

' header
WScript.Echo "*******************************************"
WScript.Echo "* Automatic sheets merger *"
WScript.Echo "* *"
WScript.Echo "* Copyrighted: Jochen Hebrecht *"
WScript.Echo "*******************************************"

' configuration
Dim pagesize
pagesize = 700

' init: original XLS
Dim excel_orig, book_orig, sheet_orig
Set excel_orig=CreateObject("Excel.Application")

' init: new XLS
Dim book_new, excel_new, sheet_new
Set excel_new=CreateObject("Excel.Application")
set book_new=excel_new.Workbooks.add
set sheet_new=book_new.WorkSheets(1)

' get current dir
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

' start script
if ( WScript.Arguments.Count <> 2 ) Then
WScript.StdOut.writeline " Use: cscript automaticsheetmerger.vbs
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
Dim filespec

' delete old output if needed
filespec = WshShell.CurrentDirectory & "\" & WScript.Arguments(1)
If (fso.FileExists(filespec)) Then
End if

' create new file
filespec = WshShell.CurrentDirectory & "\" & WScript.Arguments(0)
If (fso.FileExists(filespec)) Then
Set book_orig=excel_orig.Workbooks.Open(filespec)

Dim start, einde, left, first_hit
start = 1
einde = 1
left = 0
first_hit = 0

' loop sheets
For each sheet_orig in book_orig.Worksheets
Wscript.Echo "Reading: " & sheet_orig.Name

' copy data

' measure size
Dim x_s, y_s
y_s = sheet_orig.UsedRange.Rows.Count
x_s = sheet_orig.UsedRange.Columns.Count

Dim current_size
current_size = 0
For each r in sheet_orig.UsedRange.Rows
current_size = current_size + r.RowHeight
WScript.Echo "current_size: " & current_size

' paste

' if no more space, put pagebreak
if first_hit = 1 And current_size > left Then
end if

WScript.Echo "start:" & start
Wscript.Echo "Range: A" & start & ":" & ConvertColumnNumberToLetter(x_s) & (start + y_s - 1 )
sheet_new.Range("A" & start & ":" & ConvertColumnNumberToLetter(x_s) & (start + y_s - 1)).Select

' calculate new space left
Dim r, i, sum
i = 1
sum = 0
For each r in sheet_orig.UsedRange.Rows
sheet_new.UsedRange.Rows(i + start - 1).Rowheight = sheet_orig.UsedRange.Rows(i).RowHeight
sum = sum + sheet_orig.UsedRange.Rows(i).RowHeight
i = i + 1

if current_size > left Then
left = sum mod pagesize
left = pagesize - left
left = left - sum
end if
WScript.Echo "left: " & left

' new start place
start = start + y_s + 1


first_hit = 1

' save & close
book_new.saveas(WshShell.CurrentDirectory & "/" & WScript.Arguments(1))
WScript.Echo " File: " & WScript.Arguments(0) & " does not exist!"
End If
End if

' converts the number of a column to the letter of the number
Function ConvertColumnNumberToLetter(ColumnNumber)
Dim IntegerResult, FractionalResult, Remainder, FirstLetter, SecondLetter
IntegerResult = ColumnNumber \ 26
FractionalResult = (ColumnNumber / 26) - IntegerResult
Remainder = ColumnNumber Mod 26
If IntegerResult = 0 Then
FirstLetter = ""
ElseIf IntegerResult = 1 And FractionalResult = 0 Then
FirstLetter = ""
ConvertColumnNumberToLetter = "Z"
Exit Function
ElseIf IntegerResult > 1 And FractionalResult = 0 Then
FirstLetter = Chr(64 + (IntegerResult - 1))
ConvertColumnNumberToLetter = FirstLetter & "Z"
Exit Function
FirstLetter = Chr(64 + IntegerResult)
End If
SecondLetter = Chr(64 + Remainder)
ConvertColumnNumberToLetter = FirstLetter & SecondLetter
End Function