Enable JavaScript to use search. / 検索を使用するには JavaScript を有効にしてください。
Posts with #linux
Tue, November 1, 2011
3 min read
Installing Apache from Source Code on CentOS
End-to-end steps for installing Apache 2.2.21 from source on CentOS 5.7.
read more →
Thu, September 6, 2012
1 min read
[Apache][PHP] libphp4.so: cannot open shared object file: No such file or directory
Fixing the libphp4.so missing error on Apache by correcting the LoadModule path in httpd.conf.
Thu, March 21, 2019
Command to Convert Line Endings from CR+LF (Windows) to LF (Linux) [Linux, macOS Edition]
Batch convert CR+LF line endings to LF on Linux/macOS with a one-liner using the tr command.
Fri, July 15, 2016
2 min read
Use the -c option to exclude invalid characters that iconv cannot convert
Use iconv's -c option to skip invalid characters and finish a UTF-8 to Shift JIS conversion.
Sun, November 11, 2012
[iptables] Applying firewall rules: iptables-restore v1.4.7: no command specified Error occurred at line: 6
The `no command specified` error on iptables restart was caused by whitespace on a blank line.
Sat, September 24, 2011
error while loading shared libraries: /lib/libc.so.6: file too short Kernel panic: Attempted to kill init!
A CentOS-on-VMware kernel panic caused by libc.so.6 that I recovered from via backup.
Mon, September 5, 2011
[Linux] How to Auto-execute Commands or Programs at Login
Configuring .bash_profile on CentOS to run proxy setup and ntpdate at login.
Sat, September 21, 2013
[Linux] How to Change Hostname
Changing a CentOS server hostname via /etc/hosts and /etc/sysconfig/network.
Mon, February 26, 2018
[Linux] Commands to check CPU core count
How to check CPU core count and processor details on Linux with nproc, getconf, and /proc/cpuinfo.
Wed, June 27, 2012
[Linux] Command to Check Number of Files Under Specified Directory
A quick note on counting files under a directory recursively with find and wc -l on Linux.
Sat, January 25, 2014
[Linux] Copy Directory with cp -a Command
Use cp -a to copy a directory recursively while preserving its structure on Linux.
Tue, November 12, 2019
[Linux] Command to Check Directories with High Disk Usage
Combine du and sort to find the top directories eating disk space on Linux when hit with a disk full warning.
Mon, April 15, 2013
[Linux] Commands to Get File Hash Values
Compute file hashes on Linux with openssl sha1 for SHA-1 and md5sum -b for MD5.
Thu, November 14, 2019
[Linux] Command to Delete Old Files by Specifying Date and Time
Use find with -mtime / -atime and xargs rm to bulk delete old files on Linux when freeing up disk space.
Mon, October 31, 2011
[Linux] How to Configure Character Encoding (UTF-8, EUC, SJIS)
How to set LANG on Linux for Japanese EUC, UTF-8, and SJIS character encodings.
Tue, October 29, 2019
[Linux/macOS] Batch Compress Files to .gz with gzip Command
Use gzip * to batch compress log files and free up disk space when hit with a sudden disk full incident.
Mon, December 24, 2012
[Linux] About Memory Management
A quick reference note on Linux memory management and memory leak detection.
Thu, November 2, 2017
[Linux] Using mktemp Command is Safe for Creating tmp Files
Use mktemp with mv or ln to safely create temporary files on Linux, and gmktemp on macOS for the same behavior.
Sun, May 26, 2013
[Linux] Check Domain TXT Records with nslookup -q=txt Command
Use nslookup -q=txt to look up a domain's TXT records, including SPF.
[Linux] How to Auto-Execute Commands or Programs at Startup
Edit /etc/rc.d/rc.local to auto-run commands at CentOS startup, such as proxy setup and ntpdate time sync.
Thu, September 29, 2011
[Linux] Batch Change File Name Endings with rename Command
Use the Linux rename command with a regex to batch change file name endings.
Mon, October 10, 2011
Article That Clearly Explains the Differences and Usage Between rpm and yum
External references explaining the differences and usage between rpm and yum for Linux package management.
Wed, March 6, 2013
[Linux] List of Directories That Should Be Backed Up
The minimum set of directories to back up on a Linux server: /home, /var, /usr, and /etc.
Thu, July 12, 2012
[Linux] Remove Duplicate Lines by Piping sort and uniq
Pipe sort into uniq to strip duplicate lines from a text file in one line.
Tue, April 8, 2014
[Linux] Command to split CSV, text files, etc. by specified number of lines
Use split to break a CSV into 100-line chunks, then restore the .csv extension with a short for loop.
Sat, July 22, 2017
[Linux] Learning Sites for Understanding Swap (Japanese & English)
Red Hat documentation on Linux swap space in Japanese and English, useful for bilingual engineer training.
Fri, March 11, 2016
[Linux] For deleting tab characters and spaces, tr command with -d option is simple and recommended
Use tr -d to strip tabs and spaces on Linux or macOS, plus a quick reference for tr's main options.
Mon, October 16, 2017
[Linux] who Command to Display Currently Logged-in Users
Use who --heading --users to inspect logged-in users, and cross-check stale ssh sessions with the w command.
Mon, October 1, 2012
[Linux] How to Create Password-Protected ZIP Compressed Files
Use zip -er to build a password-protected archive from the command line on Linux or macOS.
Fri, December 29, 2017
Configuration to include log files in subdirectories with logrotate
Add a nested glob pattern to your logrotate config so logs under subdirectories get rotated too.
Changed logrotate generation count to delete old log files
Reduce logrotate's rotate count and manually remove the leftover old logs to reclaim server disk space.
Thu, November 8, 2012
Memo on Installing Ruby1.9.3 from Source Code on CentOS6.3
Notes on building Ruby 1.9.3 from source on CentOS 6.3, from libyaml through RubyGems.
Thu, March 7, 2013
[Ruby] How to Uninstall Ruby 1.9.3 Installed from Source Code
Uninstalling a source-built Ruby 1.9.3 by feeding .installed.list to xargs rm.
Sun, June 1, 2014
Common Patterns for Using screen
Common screen command patterns for running long batch jobs over SSH — start, detach, re-attach.
Tue, September 6, 2016
How to overwrite and save files with sed command
Two ways to overwrite a file in place with the sed command — the -i option and a redirect + cp pattern.
Tue, June 19, 2012
[Sublime Text2] Installation Steps for Ubuntu
Installing Sublime Text 2 on Ubuntu — /usr/lib placement, sublime symlink, and a launcher .desktop entry.
Thu, February 2, 2012
[Ubuntu] How to Install aptitude [11.10]
Installing aptitude on Ubuntu 11.10 via sudo apt-get -y install aptitude.
[Ubuntu] How to Launch Terminal [11.10]
Three ways to launch the terminal on Ubuntu 11.10, including the Ctrl + Alt + T shortcut.
[Ubuntu] Things to Do Right After Installing 11.10 (Settings and Software to Add)
A memo of things to do right after installing Ubuntu 11.10 Oneiric Ocelot, with a reference walkthrough.
Sun, July 16, 2017
[Ubuntu] Solution for 'sudo: add-apt-repository: command not found' Error
Fixing 'add-apt-repository: command not found' on Ubuntu by installing software-properties-common.
[Ubuntu] Installing Vim-gnome
Installing vim-gnome via aptitude on Ubuntu and clearing gvim's Gtk-WARNING with gtk2-engines-pixbuf.
Sun, April 9, 2017
[Ubuntu] How to handle messages saying packages can be updated or updates are security updates
How to handle the 'packages can be updated' message on Ubuntu with apt-get update and upgrade.
[Ubuntu] How to Configure US (English) Keyboard
Steps to add a US English keyboard layout on Ubuntu 12.04 and switch layouts with Ctrl+Space.
Wed, December 16, 2015
Understanding Load Average
Notes on reference articles for understanding load average on multi-core Linux systems.
Thu, June 7, 2018
Upgrading Nginx Version with yum ~ CentOS 6
Steps to upgrade Nginx to a newer version with yum on CentOS 6.
Tue, March 26, 2019
Commands to Check, Add, and Remove UTF-8 BOM <U+FEFF> [Linux, macOS Edition]
Using the file and nkf commands to check, add, and remove the UTF-8 BOM on Linux and macOS.
Sun, September 4, 2011
[yum] How to Configure Not to Use fastestpath
Disable yum's fastestmirror plugin so it stops selecting ftp-only mirrors in proxy environments where ftp is blocked.
[yum] Solution for 'Another app is currently holding the yum lock'
Fix yum's `Another app is currently holding the yum lock` error by killing the background yum process holding the lock.
Sat, June 9, 2018
yum upgrade from CentOS 6.6 to 6.9
Upgrading a server from CentOS 6.6 to 6.9 via yum, with before/after PHP and MySQL versions.