Theory and Practice
About Archives Categories Tags Authors 中文 ไทย
  1. Categories
  2. Bash

adb push error: remote couldn't create file: Operation not permitted

January 02, 2022

adb push error caused by illegal character in file name on Android.

 read more »

Update Modification Time According to EXIF Data

December 31, 2021 (Updated: April 26, 2023)

Update modification time of photo/video according to EXIF data using command line.

 read more »

Find Image With Specific Dimension Using Command Line

December 19, 2021

Find images with specific dimension using Linux command line.

 read more »

Copy Files to Android While Preserving Timestamp

November 15, 2021

Copy files to Android smart phone without losing timestamps.

 read more »

[Pelican] Build Offline Copy of Website

January 01, 2019

Build an offline copy of a website made by Pelican static site generator.

 read more »

[Vim] Replace Using Regular Expression Group

December 01, 2018

Use regular expresion groups to replace texts in Vim.

 read more »

Pass Command-line Arguments to Makefile and Go Program

May 15, 2018

Pass command-line arguments to make and then pass then arguments to Go program in Makefile.

 read more »

[Bash] List Go Source Files Excluding Test Files

March 23, 2018

List .go source files excluding _test.go files via find and grep command in bash.

 read more »

[Bash] List Directory Size in Descending and Ascending Order

March 22, 2018

List folder size in descending and ascending order via du and sort command in bash.

 read more »

Merge Instagram Post Live Video and Audio in ffmpeg

March 07, 2018

Use ffmpeg to merge Instagram video and audio of live replay shared to stories.

 read more »

[Makefile] Check if Run on Travis CI

June 13, 2017

Check if Makefile runs on Travis CI or not.

 read more »

[Makefile] Rules for Linters of Golang Source Code

May 10, 2017

Example of Makefile rules for Go linters.

 read more »

[Makefile] Publish to GitHub Pages Automatically

March 31, 2017

Create gh-pages branch and publish your static website to GitHub Pages in Makefile.

 read more »

[Bash] Move Directories and Modify Path in Files

January 18, 2017

Replace specific pattern of strings in HTML files under directory via sed.

 read more »

[sed] Replace String in Directory

January 11, 2017

Replace specific pattern of strings in HTML files under directory via sed.

 read more »

[Makefile] Get Prefix or Suffix from String

December 29, 2016

Get prefix or suffix of a string in Makefile.

 read more »

[Makefile] Online Concatenate and Compress JavaScript Files

December 26, 2016

Concatenate and minify JavaScript files via Makefile, curl, and online Google Closure Compiler.

 read more »

[Bash] Online Concatenate and Compress JavaScript Files

December 25, 2016

Concatenate and minify JavaScript files via Bash script, curl, and online Google Closure Compiler.

 read more »

[Makefile] Publish Static Website to GitHub Project Pages

December 24, 2016

Publish your static website to GitHub project pages via ghp-import in Makefile.

 read more »

[Makefile] Check Installed Package Version on Ubuntu Linux

December 23, 2016

Given an installed package name on Ubuntu Linux, find its version in Makefile.

 read more »

[Bash] Copy Large Number of Files on Linux

December 20, 2016

Copy large number of files efficiently via Bash script on Linux.

 read more »

[Bash] Find Redundant Files Saved by Chrome

May 23, 2016

Find redundant files saved by Chrome browser via Bash script.

 read more »

[Bash] Find and Remove Files in One Line of Command

May 20, 2016

Use find command to find all files with specific name and delete them in one line of command.

 read more »

[Bash] find Command Exclude Sub-directory

May 19, 2016

Use find command to find all HTML files in a directory, but exclude the HTML files in some sub-directory.

 read more »

Run wkhtmltopdf With Chinese Font Support on Travis CI

May 18, 2016

Run wkhtmltopdf on Travis CI, which convert HTML files with chinese characters to PDF.

 read more »

[Bash] HTML to PDF via wkhtmltopdf

May 17, 2016

Convert HTML files in directory to PDF recursively via wkhtmltopdf and Bash script.

 read more »

[Bash] Remove Execute Permission of Files in Directory Recursively

May 09, 2016

Remove execute(x) permission of files in directory recursively via chmod command and Bash script.

 read more »

rsync over SSH with Key

May 03, 2016

Example of copy local files to remote machine which allows only SSH key login via rsync command.

 read more »

[Bash] Move Large Number of Files via tar Command

April 29, 2016

Move large number of files via tar command under Bash. This is much quicker than mv command if there are a lot of small files.

 read more »

[Bash] Process HTML Files Format in Volumn

April 26, 2016

Convert the format (Big5 encoding to UTF-8, remove DOS newline in file, replace string big5 with UTF-8, and append UNIX newline to end of file) of HTML files in directory via Bash script.

 read more »

[Bash] Rename Files in Directory to Lowercase

April 25, 2016

Convert the name of files in directory to lowercase via Bash script.

 read more »

[Bash] Encoding Conversion, Newline Manipulation, String Replacement of File

April 20, 2016

Convert encoding of file from Big5 to UTF-8, remove DOS newline in file, replace string big5 with UTF-8, and append UNIX newline to end of file.

 read more »

[Makefile] String Replacement Example

April 08, 2016

Example for how to replace a string in a variable in Makefile.

 read more »

[sed] Replace reStructuredText Link by Regular Expression

March 30, 2016

Make reStructuredText links of the same name anonymous via regular expression by sed stream editor.

 read more »

[sed] Replace Footnote by Regular Expression

March 29, 2016

Replace footnote in reStructuredText format via regular expression by sed stream editor.

 read more »

[Vim] Replace Footnote by Regular Expression

March 28, 2016

Replace footnote in reStructuredText format via regular expression in Vim editor.

 read more »

Makefile notdir = Python basename / Golang path.Base

March 21, 2016

Makefile's notdir = Python basename / Go path.Base.

 read more »

[sed] Insert Line After First Pattern Match

March 20, 2016

Insert a line after first pattern match via sed stream editor.

 read more »

[Bash] Convert Files in Directory From Big5 to UTF-8

March 18, 2016

Convert all files in a directory recursively (i.e., including subdirectories of the directory) from Big5 encoding to UTF-8 via iconv command.

 read more »

[sed] Append Text at the Beginning of Each Line

March 15, 2016

Append text at the beginning of each line via sed stream editor.

 read more »

[Makefile] Convert Traditional Chinese PO file to Simplified Chinese via OpenCC

March 12, 2016

Convert Traditional Chinese PO file to Simplified Chinese via OpenCC and sed in Makefile.

 read more »

[Makefile] Concetenate and Minify CSS via sed and tr Command

March 11, 2016

Concatenate and Minify CSS via sed and tr command in Makefile.

 read more »

[Makefile] Create Symbolic Link If Not Exist

March 04, 2016

Makefile - Create symbolic link if it does not exist. Otherwise do nothing.

 read more »

[Bash] Convert wav to mp3 via ffmpeg

February 22, 2016

Write a bash script to convert wav to mp3 via ffmpeg on Ubuntu Linux 15.10.

 read more »

[Makefile] Echo Color Output

February 18, 2016

echo colorful output in Makefile.

 read more »

[Makefile] Create Directory If Not Exist

January 30, 2016

Makefile - Create a directory if it does not exist. Otherwise do nothing.

 read more »

[Bash] Use wget to Fetch Webpages

January 02, 2016

Write a bash script to use wget to fetch webpages.

 read more »

[Bash] List All Files in Directory Recursively and Rename

February 02, 2015

List all files in a directory recursively (i.e., including subdirectories of the directory), and use sed to rename the files.

 read more »
Powered by Github Pages, Pelican, pyScss.