Tag Cloud
Currently Reading
Latest Book Reviews
- Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition Posted on January 11, 2025
- Rancher Deep Dive Posted on March 31, 2023
- Leveraging Kustomize for Kubernetes Manifests Posted on March 24, 2023
- Automating Workflows with GitHub Actions Posted on October 13, 2022
- Deep-Dive Terraform on Azure Posted on August 30, 2022 All Book Reviews
Latest Posts
- Logging mod_rewrite redirects Posted on December 22, 2011
- Resetting MySQL root password Posted on December 19, 2011
- Removing blank lines in a text file Posted on December 17, 2011
- Vim - Removing the last character of each line in a file Posted on December 16, 2011
- Identifying your version of GNU/Linux Posted on December 9, 2011
December 22, 2011
Logging mod_rewrite redirects
by Alpha01
Extremely useful for debugging mod_rewrite rules.
# Trace:
# (!) file gets big quickly, remove in prod environments:
RewriteLog "/web/logs/mywebsite.rewrite.log"
RewriteLogLevel 9
RewriteEngine On
apache
]
December 19, 2011
Resetting MySQL root password
by Alpha01
1). End current mysql process
2). Run MySQL safe daemon with skipping grant tables
mysqld_safe --skip-grant-tables &
3). Login to MySQL as root with no password:
mysql -u root mysql
4). Run UPDATE query to reset the root password. In MySQL command line prompt issue the following two commands:
UPDATE user SET password=PASSWORD("NEWPASSWD") WHERE user="root";
FLUSH PRIVILEGES;
mysql
]
December 17, 2011
Removing blank lines in a text file
by Alpha01
sed '/^$/d' example_file
bash
]
December 16, 2011
Vim - Removing the last character of each line in a file
by Alpha01
In command mode:
:%s/.$//g
vim
]
December 9, 2011
Identifying your version of GNU/Linux
by Alpha01
tony@debian01:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.3 (squeeze)
Release: 6.0.3
Codename: squeeze
centos
ubuntu
]