Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Command



  Use rsync to delete mass files quickly in Linux

Yesterday I encountered an issue to delete many log files in my Linux workstation, there were around 100,000 files to be deleted. These are log files and they grow very fast, and we need to delete them frequently. Usually we would use rm -rf * to delete these files, but we may need to wait for a relative long time if there are too many files. So we must adopt some unusual way. Fortunately, we can use rsync to delete mass files in one shot. 1. Install rsync yum install rsync 2. Create a new empty...

   rsync,delete file, demo     2012-11-13 10:44:50

  Data as code

What is a good command line parser API? A good command line parser should consider below 5 aspects: Support convenient help information generation Support sub commands, for example, git has push,pull,commit sub commands. Support single character option, word option, flag option and option with parameter. Support default option, for example, if no -port is set, set it as 5037 Support usage model, for example, tar's -c and -x is mutually exclusive, they belong to different usage models. Here are...

   Command line,API     2013-08-08 22:40:36

  Find files by size in Linux

In Linux systems, you may encounter a situation where there is no enough space on the system while you are trying to install some new packages or writing some data. In this case, you may want to clear some unneeded files. A frequent need will be find the largest files in the system so that they can be deleted first and disk space can be released quickly. In this post, we will show a simple command to find files by size so that we know what files are taking the specified space on the system, This...

   LINUX,FILESIZE,FIND     2020-04-25 08:02:45

  Latest PHP patch cannot fix the bug

On Wednesday(2012-05-02), a remote code execution vulnerability in PHP was accidentally exposed to the Web, prompting fears that it may be used to target vulnerable websites on a massive scale. The bug itself was traced back to 2004, and came to light during a recent CTF competition.A CERT advisory on the flaw explains: “When PHP is used in a CGI-based setup (such as Apache's mod_cgid), the php-cgi receives a processed query string parameter as command line arguments which allows com...

   PHP,bug,patch,bypassed     2012-05-08 11:20:56

  A simple example of git bisect command

git bisect is a very powerful command for finding out which commit is a bad commit when bug occurs.  The rationale behind this command is that it pin locates the bad commit by divide and conquer. It divides the commit history into two equal parts, then determines whether the bad commit is at the first half or at the other half. This process will continue until the bad commit is located. Here is a really good example created by bradleyboy, this is a simple git repository which demonstr...

   GITHUB,GIT,GIT BISECT     2019-07-12 10:31:51

  Maintain multiple versions of Go in one single environment

In a development environment, there might be multiple projects going on at the same time and they may require different development environments with different versions of build tool. In many programming languages, it is possible to have multiple versions of different build tool or development tool on a single environment. For example, there can be multiple JDKs, multiple versions of Ruby using RVM. For GoLang, there is a similar tool called GVM which can also be used to maintain multiple versio...

   GOLANG,GVM,GVM PKGSET,RVM     2019-11-10 00:43:47

  JShell -- The command line tool to run Java code in Java 9

Java 9 is currently a work-in-progress and is planned to be GAed in March 2017. Quite a few new features will be introduced in the new release. The coolest feature is project Jigsaw which is to modularize the Java packages so that a customized JDK can be built and shipped with only the necessary modules to fulfill their project requirement. Apart from this feature, another big new feature is project Kulla -- JShell. In simple, JShell is a command line tool which can be used to run...

   JAVA 9,JSHELL,KULLA     2016-04-01 21:46:48

  Common usage of ls command in Linux

In Linux, ls might be one of the most frequently used commands. It is used to list files in a specific directory. In most cases, we may just use ls -l to list the files under a directory. But have you explored other usages of this command. In this post, we will summarise some other common usages of ls command Assuming we have below directory structure in our system, let's see them using tree command. List details of the files If we want to list the details of the files in /home/alvin/test_...

   LINUX,SHELL,LS     2018-12-16 03:00:42

  Command Line Arguments

Our Hello program still isn’t very general. We can’t change the name we say hello to without editing and recompiling the source code. This may be fine for the programmers, but what if the secretaries want their computers to say Hello to them? (I know. This is a little far-fetched but bear with me. I’m making a point.)What we need is a way to change the name at runtime rather than at compile time. (Runtime is when we type java HelloRusty. Compile time is when w...

   Java,Command line arguments,First elemen     2011-09-30 11:31:54

  Install and setup vsftpd on AWS server

When developing websites, frequently we may need to upload source codes to the remote server. To ease of thew work, many website developers set up FTPs to upload the files. This post is a tutorial on how to install and setup vsftpd on a server. vsftpd is a very popular FTP service on Unix-like systems. Open command terminal, then install the vftpd by issuing command yum install vsftpd or sudo apt-get install vsftpd After installing the vsftpd, the config file needs to be updated based on the ope...

   FTP,vsftpd,AWS,Passive,Active     2015-02-02 02:20:27