mustafa cantürk blog

mustafa cantürk blog -

Linux Quota Inconsistency Problems

In our system, we use linux quota to limit users file usage. However, quota database has inconsistencies with file usage of users. Sometimes user has no data, however quota database shows 4KB of usage.

On this problem, quotacheck is recommended. However, quotacheck fully checks the disk. If there are too many files and users, also user files frequently changing; online mode of quotacheck can’t fix inconsistencies.


Continue reading

Named Data Networking

In Computer Communications course, we have been wanted to present a SIGCOMM paper and write a report about it. We choose this paper, Named Data Networking. The paper was a summary of all works done related to Named Data Networking.

This is our report. We had limited time to write this paper, I can consider it incomplete. It may have better. It can give more information and give sophisticated point of views about NDN. Regardless, it was a good work about NDN.

Continue reading

Bilişim Dünyasına Yön Verebilecek Bir Parça: Memristör


Bu dönem Metin Hüner hocamız EDT dersinde memristör üzerine bir araştırma ödevi vermişti. Ödevi zevk alarak araştırdım. Ödevde 250-300 kelime istenmesine rağmen, 4 sayfa kağıt doldurdum 🙂 Ödev yerine koymadan yazdım. Hoşuma gittiği için sizlerle paylaşmak istedim 🙂


İnternet üzerinde memristör üzerine Türkçe bir kaç yazı mevcut. Ama sanırım bunu bir bilgisayarcının gözünden ilk defa okuyor olacaksınız.


Continue reading

Foldername.exe Virus Cleanup Tool

I wrote a program for deleting Foldername.exe virus.

  • Must be executed in the virus directory.
  • There must not be exe file on the folder.
  • Open notepad, copy the code into it and save something.bat.
:: Written by Mustafa CANTURK
:: Licensed under GPL
@echo off
for /f "tokens=*" %%a in ('dir /a /b') do (
	attrib -S -H "%%a"
del *.exe
del autorun.inf

QT and Linking Other Libraries

I started QT and trying to write some small programs. In one program, I wanted to send mail. Found a code how to send mail in C++ (uses winsock library, not QT’s) and integrated it to my program. But how, I gives some bunch of errors. They were linking errors.

... /mailer.cpp:17: undefined reference to `WSAStartup@8'

Then a little research helped to me: This link.

Open your project file (<projectname>.pro):

and add the line:


If your library is located in [QTDIR]\mingw\lib directory, you can just add the name of it (without its filename extension: .a):

LIBS += libwsock32

If you are developing in linux, the default library directory(or one of the library directories) might be /usr/lib.

Linux Process Invisibility

Hello again, we have given a project in System Programming course. It was expected you to alter the kernel code for process invisibility, when you ps, process can not be seen in the output, if process invisibility flag is “1”.

The project was modifying the linux kernel for process invisibility, writing a system call for setting the invisibility flag and writing a user-space program.

Project was developed at Xubuntu 9.10 guest on Windows 7 host. Eclipse (with CDT and Remote System Explorer plugins) was the development IDE. Putty SSH client was also used for executing commands and “command copy/paste” availability. VirtualBox was the virtual machine supervisor.

ATTENTION: This code is experimental. If you try, it will be your own responsibility.
Continue reading

SHA512 hashing on Java

Hello! For my school project, I had been tought of crypting passwords of users. Due to the fact that, SHA1 algorithm has security problems (link) , I have decided using a SHA2. SHA2 has 3 variants: SHA256, SHA384 and SHA512. While I was searching how to implement SHA2 on Java,  I have found this link.

For SHA512 that code works:


public class cryptotest {
    public static void main(String[] args) throws NoSuchAlgorithmException {
        MessageDigest md;
        String message = "password";
        try {
            md= MessageDigest.getInstance("SHA-512");

            byte[] mb = md.digest();
            String out = "";
            for (int i = 0; i < mb.length; i++) {
                byte temp = mb[i];
                String s = Integer.toHexString(new Byte(temp));
                while (s.length() < 2) {
                    s = "0" + s;
                s = s.substring(s.length() - 2);
                out += s;
            System.out.println("CRYPTO: " + out);

        } catch (NoSuchAlgorithmException e) {
            System.out.println("ERROR: " + e.getMessage());

If you want to hash password with SHA256, you can change the line:

md= MessageDigest.getInstance("SHA-512");


md= MessageDigest.getInstance("SHA-256");

For others:

md= MessageDigest.getInstance("MD5");
md= MessageDigest.getInstance("SHA");
md= MessageDigest.getInstance("SHA-1");
md= MessageDigest.getInstance("SHA-384");