We ever discussed How To Install R and RStudio Desktop in Ubuntu Linux 20.04. In this post, we introduce how to install R and RSTudio Desktop on macOS. Install R environment Install R environment as follows using Homebrew. $ brew install R Then verify that the R environment is installed and ready, by running in
Read more
Author: David Yang
How to Migrate RSS Feed Readling List from Feedly to Follow.it
Posted onHaving a reading list from RSS feeds is a convenient way to organize and aggregate various information source from the Web. After Google Reader was retired, many different readers services are available. Feedly and Follow.it are two good choices among those RSS feed readers. Different readers have different features. Follow.it provides features like keyword filtering
Read more
Installing R and RStudio Desktop in Ubuntu Linux
Posted onWe ever discussed How To Install R and RStudio Server in Ubuntu Linux 20.04. If the purpose is to install a local RStudio IDE instead of a remote RStudio Server, we can install RStudio Desktop. In this post, we introduce how to install R and RStudio Desktop on Ubuntu Linux 20.04. For other Ubuntu version,
Read more
Installing R and RStudio Server in Ubuntu Linux
Posted onR is a language and environment for statistical computing and graphics, providing a wide variety of statistical and graphical techniques. The R environment is open source software under GPL. R has rich software packages and is widely used for statistical analysis. RStudio Server is an R integrated development environment (IDE) that provides many useful features
Read more
Git Deleting Remote Tags from the Git Server
Posted onGit’s tags are convenient use to name some specific commits by tagging them for releasing or book keeping purposes. For example, GitHub allows repository managers to make releases using git tags. However, it may happen by mistake that a git tag is pushed to the remote git server while the tag has been made to
Read more
How to Count the Number of Words in a File in PHP?
Posted onCounting the number of words in a file is useful in many programs. In this post, we will discuss how to count the number of words in a file in a PHP script. In PHP standard library, we have function str_word_count($str) which returns the number of words from a string $str. On the other hand,
Read more
How to Make DNF and YUM Save Downloaded RPM Packages
Posted onDNF/YUM can automatically download the RPM packages and install them. Under some situations, we may prefer to make a copy of the RPM files for offline usage so that no need to have network connections to install the software packages. For such purposes, we need to make a copy of the RPM packages. It is
Read more
Compress PNG Images on Linux
Posted onPNG images already use DEFLATE data compression algorithm involving a combination of LZ77 and Huffman coding. But the PNG images can be further compressed by removing non-important metadata or using lossy compression to save storage space and/or data transfer bandwidth. In this post, we introduce 2 compression ways with tools available on Linux. Lossless compression
Read more
Change Another Process’ Environment Variables in Linux
Posted onEach process has its environment variables in Linux. But is it possible to change another process’ environment variable from another process in Linux? If it is possible to do so, how to do it? There is a trick which can work for some scenarios. First, find out the process ID, then start gdb and attach
Read more
Redirect Feed Links to follow.it using .htaccess
Posted onFeedburner used to a powerful tool for RSS feeds publishing and subscriber management. However, feedburner will unlikely leave its maintenance mode because there has been no new features yet less features for quite some years. But RSS feed is still an important part of the Web supported by many software such as WordPress. follow.it is
Read more
Make Grub2 Boot Older Kernel Version in Ubuntu 20.04
Posted onIn a Linux system, we may have multiple kernels installed. Usually, it is the latest kernel configured to be the default one the system boot loader will use during automatic boot if there is no manual kernel choosing. In many cases, such as there is no driver ready yet for some devices in newer kernels,
Read more
How to list and start VirtualBox VMs in command line in Linux?
Posted onVirtualBox is a nice open source virtual machine software. It works nicely on Linux and is supported by many Linux distros like Ubuntu in their official package repositories, so it is quite easy to set it up on Linux. The VMs can also be managed in command line using the vboxmanage command line tool provided
Read more
A StoneWall Solution in C++
Posted onStoneWall is an interesting problem that requires some brain cycles yet not too complex. It is good software engineer interview question. Here is a C++ solution whose complexity is O(N). #include <stack> int solution(std::vector<int> &H) { int stones = 0; std::stack<int> heights; for (auto h: H) { while (!heights.empty() && h < heights.top()) { heights.pop();
Read more
Adding Gmail SMTP in Thunderbird
Posted onGmail’s authentication is secured by rejecting access from less secure apps. By default, adding Gmail SMTP in Thunderbird with your Google account password as SMTP authentication password will not work. And Google is beginning to shut off Google Account access to less secure apps. To solve this, the method is to use OAuth2 authentication instead
Read more
How to synchronize OneDrive and OneDrive for Business files in Linux using Insync
Posted onOneDrive is one of the good cloud storage services available and there is a business version called OneDrive for Business. Microsoft’s Office 365 plan is widely used including Exchange Email service and OneDrive for Business. However, there is no official client released yet for Linux users. Insync is a third party cloud storage syncing software
Read more
How to list all commits in a git repository
Posted on`git log` only list all the commits in the current working branch. For some cases, we may want to list all the commits in a git repository. The `git log` command does not do this. But there are other supports in `git` that can do so. The command to list all commits is git rev-list
Read more
How to iterate all dirs and files in a dir in C++?
Posted onHow to iterate all dirs and files in a dir in C++? To open a dir, we can use opendir() to open a directory stream. DIR *opendir(const char *name); Then we can use readdir() to iterate the directory stream. struct dirent *readdir(DIR *dirp); Here is an example C++ program using these 2 library functions. #include
Read more
How to cat a single file’s content from a tar without unpacking it on Linux?
Posted onHow to cat a single file’s content from a tar without unpacking it on Linux? For example, I know there is a file README.txt in a tar tools.tar.gz . How to cat the content of README.txt out? You can do this by using a combination of tar‘s options and arguments. -O, –to-stdout Extract files to
Read more
How to get the value of a default value if the key does not exist in `dict()` in Python?
Posted onHow to get the value of a default value if the key does not exist in dict() in Python? We can use the get() function to assign default value if the key does not exist in the dict yet. dict.get(key[, default]) Example as follows. msges = {“msg”: “Hello, World!”} msg = msges.get(“msg”, “”) print(msg) #
Read more
Killing Running Bash Script Process Itself and All Child Processes In Linux
Posted onIn Linux, how to kill a process and all its child processes? For example, a Bash script A starts B, B starts C and C calls rsync. I would like to kill A and all its child processes all together. How to do this? There are possibly many answers to this question. One of the
Read more