rubysecurity.org

Cloud Architect / DevOps Engineer / SRE / Developer | /root

Home About Books Blog Portfolio Archive

Tag Cloud


Currently Reading

Certified Kubernetes Administrator (CKA) Study Guide
Certified Kubernetes Administrator (CKA) Study Guide
38 / 155 Pages


Latest Book Reviews

Latest Posts


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
Tags: [ 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;
Tags: [ mysql ]
December 17, 2011

Removing blank lines in a text file

by Alpha01

sed '/^$/d' example_file
Tags: [ bash ]
December 16, 2011

Vim - Removing the last character of each line in a file

by Alpha01

In command mode:

:%s/.$//g
Tags: [ 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
Tags: [ centos ubuntu ]