Debian - Confusing architecture naming convention

I just bought a new laptop. It has a 64-bit 2 GHz Intel dual-core processor. I want to install a 64-bit Debian on that laptop. Therefore, I headed to this download page. It showed the following available architectures: alpha, amd64, arm, armel, hppa, i386, ia64, mips, mipsel, powerpc, sparc, s390, source and multi-arch. I'm stocked and confused as I don't know which architecture to download. By deduction, I only have 3 choices: amd64, i386 and ia64. I wasted an hour reading the how-to of the 3 architectures to no avail.

Debian - SciTE

What is SciTE?

SciTE is a lightweight code editor. I mainly used to:

  • Do search and replace text with regular expression.
  • Write simple and small scripts.
  • Open huge file.



Debian - Show directory structure and all files in text format

  1. Run the following to install.
    aptitude -y install tree
     
  2. Here is an example of what it will show for /root/.java directory:
    # tree /root/.java/
    /root/.java/
    `-- deployment
        |-- cache
        |   |-- javapi
        |   |   `-- v1.0
        |   |       |-- ext
        |   |       |-- file
        |   |       |   |-- ADT_homepage4.gif-1731c063-7adea2e8.idx
        |   |       |   |-- LiveCounter.class-10be6239-7b0308a3.class
        |   |       |   |-- LiveCounter.class-10be6239-7b0308a3.idx

DOS - Create an empty file

type NUL > emptyFile.txt

Debian - How to increase command line history size?

  1. To see how many commands does it remember in the command history, run
      echo $HISTSIZE
     
  2. To change that value, open ~/.bashrc and then change the value of HISTSIZE or add the following if it doesn't exist.

Debian - Run some script at startup

  1. Copy your script(e.g myscript.sh) into the directory /etc/init.d/.
  2. Run
        update-rc.d myscript.sh defaults
     
  3. That is it! Everytime Debian started, it will run myscript.sh.

Bash - Who Is Running The Script

#!/bin/bash
 
# Description: Who is running this script.
# Author: Xuan Ngo
#############################################
 
# Who Is Running The Script.

Bash - Useful commands

ping -c 1 -w 1 -q
-c <x>: Stop sending after <x> packets.
-w <x>: Time to wait for a response, in seconds.
-q: Display summary line.

Bash - String Manipulation

Length of string

#!/bin/bash
str="What is the length of this string?"
echo "The length is ${#str}"
# Output:
# The length is 34


Search and Replace string

#!/bin/bash
str="1st dog. 2nd dog. 3r dog"
 
#Replace the 1st occurrence: ${string/find/replace}
str=${str/dog/cat}
echo "${str}"
# Output:
# 1st cat. 2nd dog. 3r dog
 
#Replace all occurrences: ${string//find/replace}
str=${str//dog/cat}
echo "${str}"
# Output:
# 1st cat. 2nd cat. 3r cat
#http://www.arachnoid.com/linux/shell_programming.html

Bash - Generate MD5 hash of all files under the provided path and all its subdirectories

#!/bin/bash
 
# Description: Generate MD5 hash of all files under the provided path and all its subdirectories.
# Author: Xuan Ngo
# Usage: thisScriptName.sh [path]
#        thisScriptName.sh .
#        thisScriptName.sh /some/absolute/path
#        thisScriptName.sh some/relative/path
# Output: YYYY-MM-DD HH:MM:SS | MD5 hash | Size in bytes | Filename
#############################################################################################
 
ProcessingPath="$1"
 
find $ProcessingPath -type f | while read filename ; do

Pages

Subscribe to OpenWritings.net RSS