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

 OPERATING SYSTEM


  /dev/null and /dev/tty in Linux

In Linux, there are two special files /dev/null and /dev/tty. /dev/null will drop all the data written to it, i.e, when program writes data to this file, it means the program has completed the data write operation. But in  fact it does nothing, if you just want the status of a command but not the output of a command, this feature will be very useful. See below shell codes:    /> vi test_dev_null.sh        #!/bin/bash    if grep hello TestFile > /dev/null    then        echo "Foun...

16,010 0       LINUX /DEV/NULL /DEV/TTY


  Guide for installing Ubuntu in VirtualBox on Windows

Have you ever tried to have two OSs installed on your PC? Do you want to try out the new Ubuntu system? If you do want to use Ubuntu when at the same time you are using Windows, you may want to install your Ubuntu in an VirtualBox. In this post, we will show you how to install Ubuntu in VirtualBox on Windows.Pre-requisitesVirtualBox -- You can download it from Oracle.Ubuntu -- You can download it from here. Please note it should be an ISO fileThe Ubuntu used in this post is Ubuntu 12.04 LTS.InstallationStep 1. Install the VirtualBox, it is like any other application installation on WindowsStep...

15,905 0       WINDOWS VIRTUALBOX UBUNTU


  Origin of Windows blue screen

Many of you from old ages might see the classical blue Windows blue screen before.Do you still remember the most famous Windows blue screen incident during a presentation of a Windows 98 beta by Bill Gates at COMDEX on April 20 1998. But do you know the history of blue screen? John Vert, an ex-Windoes NT kernel guy, shared the story on Quora. Back in 1991 John Vert wrote the original code for Windows NT 3.1 that put the video screen back into text mode and the routines to put text on it (and a truly gnarly bit of code it was!). He used the white on blue colors for two reasons.The MIPS wor...

14,795 1       HISTORY WINDOWS BLUE SCREEN


  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 rsyncyum install rsync2. Create a new empty foldermkdir /tmp/test3. Use rsync to delete target folderrsync --delete-before -a -H -v --progress --s...

14,209 0       DEMO RSYNC DELETE FILE


  Why do people hate Windows?

Windows brought us into PC era, it becomes the most widely used OS in the past 20 or so years. But unfortunately there are still many people hate Windows. Is it because we may encounter the notorious blue screen issue now and then? People hate Microsoft Windows for the same reason they hate Comcast, United Airlines, or Paypal.Once Microsoft gained a dominant market position, it completely and utterly took its customers for granted. It became arrogant and complacent, causing customers to feel unappreciated and victimized.This is nothing surprising. Once a company is assured of its market p...

14,094 6       WINDOWS HATE


  Using msmtp to replace sendmail

sendmail is a mail client in Linux with many vulnerabilities and tedius configuration steps, many system administrators have disabled using it. Then how do we know what happens if a crontab script executes with error?Actually there are some replacements for sendmail, one is ssmtp, but this application is no longer maintained, we even cannot find its source code on Google. Fortunately, we can use msmtp to replace sendmail. The address : http://msmtp.sourceforge.net/1. InstallationAfter downloading and decompressedm we run./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etcmakemake in...

13,547 0       SENDMAIL MSMTP REPLACEMENT


  SSH Security and You - /bin/false is *not* security

Backstory While at RIT around 2004 or 2005, I discovered that a few important machines at the datacenter allowed all students, faculty, and staff to authenticate against them via ssh. Everyone's shells appear to be set to /bin/false (or some derivative) on said machines, so the only thing you'll see after you authenticate is the login banner and your connection will close. I thought to myself, "Fine, no shell for me. I wonder if port forwarding works?" Seems reasonable, right? Whatever sysadmin was tasked with securing these machines forgot some...

12,957 0       SECURITY LINUX SSH /BIN/FALSE


  Understand diff in Unix

diff is an important tool program in Unix. It is used to compare differences of two files, it is the foundation for code version control. If you type :$ diff <file_before_change> <file_after_change>diff will tell you what's the difference between these two files. The result may not be so easy to understand, so now I will show you how to understand diff.1. 3 formats of diffdiff has 3 formats due to historic reasons.normal diffcontext diffunified diff2. Demo filesFor easy demonstration, we create 2 demo files.The first one is f1, it has 7 lines of a in it.aaaaaaaThe second file is f2...

12,261 0       UNIX DIFF VERSION CONTROL GIT