Skip to content

SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search
SysTutorials

  • QA

    How to estimate the memory usage of HDFS NameNode for a HDFS cluster?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    HDFS stores the metadata of files and blocks in the memory of the NameNode. How to estimate the memory usage of HDFS NameNode for a HDFS cluster? Each file and each block has around 150 bytes of metadata on NameNode. So you may do the calculation based on this. For examples, assume block size is…

    Read More How to estimate the memory usage of HDFS NameNode for a HDFS cluster?Continue

  • QA

    Is Samba sync or async for writes?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Being sync or async for data writing of a file system or a network file system affects the data integrity. Is Samba sync or async for writes? In summary, Samba writes are async by default. But the behavior is configurable. Here is a great summary by Eric Roseme. Samba defaults to asynchronous writes. smbd writes…

    Read More Is Samba sync or async for writes?Continue

  • QA

    How to get the mtime of a file on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to get the mtime of a file on Linux from the file’s path? You can use stat to get the file status including the mtime: %y time of last modification, human-readable %Y time of last modification, seconds since Epoch As an example, $ stat -c %y ./file 2017-06-26 13:33:06.764042064 +0800 $ stat -c %Y…

    Read More How to get the mtime of a file on Linux?Continue

  • QA

    How to embed a Map image from Google Map in a website?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Google Map has APIs. But the requirement is that the Map image should be static and uploaded to the website only. No request or dependency on Google’s website should be needed so that the website can run without Internet. Is it possible or allowed (like a screenshot of the Google Map)? If not, any suggestions…

    Read More How to embed a Map image from Google Map in a website?Continue

  • QA

    How to check last boot’s systemd journal log in CentOS 7 Linux?

    ByDavid Yang Mar 24, 2018Mar 30, 2026

    The command to check last boot’s journal log shows nothing on Rocky Linux 9: # journalctl -b -1 Failed to look up boot -1: No such boot ID in journal Is the log stored and where it is? The reason this happens on Rocky Linux 9 is that Rocky Linux 9 by default does not…

    Read More How to check last boot’s systemd journal log in CentOS 7 Linux?Continue

  • Tutorial

    How to force systemd to refresh or reloaded a changed fstab on Linux?

    ByDavid Yang Mar 24, 2018Aug 1, 2020

    On Linux, how to force systemd to refresh or reloaded a changed /etc/fstab file? To force systemd to reload the changed /etc/fstab file content, run $ sudo systemctl daemon-reload To, further, make systemd auto remount any new entries, do $ sudo systemctl restart remote-fs.target local-fs.target

    Read More How to force systemd to refresh or reloaded a changed fstab on Linux?Continue

  • Tutorial

    How to find the hostname of an IP using /etc/hosts if it has the mapping on Linux?

    ByDavid Yang Mar 24, 2018Aug 1, 2020

    Common DNS queries like ping will first get the IP of a hostname if it exists in /etc/hosts. How to find the hostname of an IP using /etc/hosts if it has the mapping on Linux? Multiple tools on Linux can do the “reverse” checking using /etc/hosts file. For example, if we have a line 192.0.2.1…

    Read More How to find the hostname of an IP using /etc/hosts if it has the mapping on Linux?Continue

  • Which filesystem operations in HDFS is atomic?

    ByQ A Mar 24, 2018Nov 25, 2019

    Atomicity is a very important and fundamental property aspect of filesystems. Applications semantics and many functions depend on and only be available based on the atomicity models of the underlying filesystem. Which filesystem operations in HDFS is atomic? So that locks can be implemented on top of it. In a reasonably widely usable filesystem, some…

    Read More Which filesystem operations in HDFS is atomic?Continue

  • QA | Tutorial

    How to compare date in SQL?

    ByQ A Mar 24, 2018Nov 21, 2019

    How to compare date in SQL? For example, the ‘users’ table has a column ‘loggin’ which is the date and time. How to find out the ‘users’ whose ‘loggin’ date is later than Jan 10, 2017? In SQL, dates can be compared using ‘’, ‘=‘. For the example described, the SQL statement could be: SELECT…

    Read More How to compare date in SQL?Continue

  • Tutorial

    How to show N entries in result of a select SQL query to MySQL?

    ByDavid Yang Mar 24, 2018Aug 1, 2020

    How to show only N entries in the result of a select SQL query to MySQL? The select SQL query is: select * from qa_users; To limit the N entries (say N = 10), we can use the limit clause as follows. SELECT * FROM qa_users LIMIT 10; Note that it is for MySQL. For…

    Read More How to show N entries in result of a select SQL query to MySQL?Continue

  • QA

    How to print a line to STDERR and STDOUT in Perl?

    ByQ A Mar 24, 2018

    In Perl, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Perl, to nicely print a new line to STDOUT, you can use the “say” feature which “Just like print, but implicitly appends a newline”:…

    Read More How to print a line to STDERR and STDOUT in Perl?Continue

  • QA

    How to print a line to STDERR and STDOUT in OCaml?

    ByQ A Mar 24, 2018

    In OCaml, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In OCaml, you may print a string with the end line character to STDOUT using the function in the Pervasives module: val print_endline : string…

    Read More How to print a line to STDERR and STDOUT in OCaml?Continue

  • QA

    How to print a line to STDERR and STDOUT in C++?

    ByQ A Mar 24, 2018

    In C++, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In C++, you may print the string and then ‘n’ or std::endl to STDOUT by operating on the std::cout stream: std::cout << your_string << std::endl;…

    Read More How to print a line to STDERR and STDOUT in C++?Continue

  • QA

    How to print a line to STDERR and STDOUT in PHP?

    ByQ A Mar 24, 2018

    In PHP, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In PHP, you may print a line to STDOUT using echo by appending the PHP_EOL to the string: echo $your_msg . PHP_EOL; For example, $…

    Read More How to print a line to STDERR and STDOUT in PHP?Continue

  • QA

    How to print a line to STDERR and STDOUT in C?

    ByQ A Mar 24, 2018

    In C, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In C, to print to STDOUT, you may do this: printf(“%sn”, your_str); For example, $ cat t.c #include <stdio.h> void main() { printf(“%sn”, “hello world!”);…

    Read More How to print a line to STDERR and STDOUT in C?Continue

  • QA

    How to print a line to STDERR and STDOUT in Java?

    ByQ A Mar 24, 2018

    In Java, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Java, you can print string in a new line by ‘System.out.println()’ to STDOUT: System.out.println(“my msg here”); In Java, print a string str to STDERR…

    Read More How to print a line to STDERR and STDOUT in Java?Continue

  • QA

    How to print a line to STDERR and STDOUT in Go?

    ByQ A Mar 24, 2018

    In Go, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Go, you can use the ‘Println()’ func from the ‘fmt’ package to print a line to STDOUT: import(“fmt”) fmt.Println(“my msg here”) In Go, os.Stderr…

    Read More How to print a line to STDERR and STDOUT in Go?Continue

  • QA

    Printing a Line to STDERR and STDOUT in Python

    ByEric Ma Mar 24, 2018Mar 30, 2026

    In Python, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Python, to print a string str with a new line to STDOUT: print str In Python to print a line to STDERR: import sys…

    Read More Printing a Line to STDERR and STDOUT in PythonContinue

  • QA

    How to print a line to STDERR and STDOUT in Bash?

    ByQ A Mar 24, 2018

    In Bash, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Bash, you can simply use the echo command: echo “your message here” or echo your message here Examples: $ echo the message here the…

    Read More How to print a line to STDERR and STDOUT in Bash?Continue

  • QA

    How to get the running process’ parent process’ ID in C / C++?

    ByQ A Mar 24, 2018

    How to get the running process’ parent process’ ID in C / C++? In C and C++, you can call the getppid() library function which is a function from the POSIX library. #include <sys/types.h> #include <unistd.h> pid_t getppid(void); getppid() returns the process ID of the parent of the calling process. Example usage: getppid.c #include <stdio.h>…

    Read More How to get the running process’ parent process’ ID in C / C++?Continue

Page navigation

Previous PagePrevious 1 … 12 13 14 15 16 … 70 Next PageNext

© 2026 SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search