Is encfs available in an Android phone? You may try Encdroid a piece of free software released under the GNU General Public License. It is an Android application. It can access EncFS volumes on cloud storage or internal/USB storage devices. Google Play Store Link: https://play.google.com/store/apps/details?id=org.mrpdaemon.android.encdroid&hl=en Source code: https://github.com/mrpdaemon/encdroid
Category: QA
Questions and answers.
How to estimate the memory usage of HDFS NameNode for a HDFS cluster?
Posted onHDFS 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 split a gzip file to several small ones on Linux?
Posted onI have a very large (e.g. 100GB) .gz file and would like to split it into smaller files like 8GB/each for storage/copying. How to split a gzip file to several small ones on Linux? You may use the tool split to split a file by sizes. An example to split a large.tgz to at most
Read more
How to embed a Map image from Google Map in a website?
Posted onGoogle 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 get the mtime of a file on Linux?
Posted onHow 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
Is Samba sync or async for writes?
Posted onBeing 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
How to check last boot’s systemd journal log in CentOS 7 Linux?
Posted onThe command to check last boot’s journal log shows nothing on CentOS 7: # 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 CentOS 7 is that CentOS 7 by default does not enable the persistent
Read more
How to compare date in SQL?
Posted onHow 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 print a line to STDERR and STDOUT in C++?
Posted onIn 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 OCaml?
Posted onIn 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 Perl?
Posted onIn 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 C?
Posted onIn 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 PHP?
Posted onIn 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 Java?
Posted onIn 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 Bash?
Posted onIn 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
Printing a Line to STDERR and STDOUT in Python
Posted onIn 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
How to print a line to STDERR and STDOUT in Go?
Posted onIn 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 get the running process’ parent process’ ID in Python?
Posted onHow to get the running process’ parent process’ ID in Python? In Python, you can get the parent process’ pid by calling os.getppid(): import os ppid = os.getppid() One example: The shell’s pid: $ echo $$ 21779 Start a python REPL and get its parent pid (the shell’s): $ python Python 2.7.5 (default, Nov 6
Read more
How to get the running process’ parent process’ ID in Go?
Posted onHow to get the running process’ parent process’ ID in Go? In Go, you may call the os.Getppid() func from the os package to get the parent process’ pid. func Getppid() int Getppid returns the process id of the caller’s parent. One example is as follows. $ gore gore version 0.2.6 :help for help gore>
Read more
How to get the running process’ parent process’ ID in C / C++?
Posted onHow 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