C/C++ Create Directory

We can type “mkdir dirname” command at konsole to create dirname directory. If we can create a directory from C/C++ we can use command mkdir(path, mode) to create directory. Example : #include <sys/stat.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> main() { if(mkdir("pathname",0777)==-1)//creating a directory { printf("error create directory\n"); exit(1); } else printf("success create directory\n"); }

QDialog with Maximize and Minimize Button

Window output from QDialog dont have Maximize and Minimize button at left top window form. We can add Maximize and Minimize at QDialog with code : int main(int argc, char *argv) { QApplication a(argc, argv); Dialog w; w.setWindowFlags(Qt::Window); // add this. w.show(); return a.exec(); } Source : http://www.qtcentre.org/threads/17593-QDialog-with-Close-Maximize-and-Context-Help-Buttons

konsole/bash remove history

When we write command at konsole, linux would write history from our command at bash user history. This file located at /home/username/.bash_history. If we want remove all history from our konsole, we can remove this file or open this file and remove specifics our command history. Source : http://ubuntuforums.org/showthread.php?t=991359

Linux Setting Firewall

Untuk melakukan setting firewall dilinux dapat kita lakukan dengan perintah ufw dari terminal. untuk melakukan pengecekan firewall di linux dapat kita lakukan dengan perintah : iptables –list Jika output yang kita terima selain keterangan ACCEPT, artinya firewall kita tertutup. Untuk membuka firewall dapat dilakukan dengan perintah : ufw enable sedangkan untuk menutup firewall dapat kita