yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit
wget http://tsung.erlang-projects.org/dist/tsung-1.6.0.tar.gz
tar xfz tsung-1.6.0.tar.gz
cd tsung-1.6.0
./configure && make && make install
mkdir /root/.tsung
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deleting all keys in redis that match a regular expression | |
| # General | |
| redis-cli [options] KEYS "prefix:*" | xargs redis-cli [options] DEL | |
| # If authorization is needed | |
| redis-cli -a <AUTH> KEYS "prefix:*" | xargs redis-cli -a <AUTH> DEL | |
| # If no authorization is needed | |
| redis-cli KEYS "prefix:*" | xargs redis-cli DEL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| examples: | |
| 1). modify file using regular expression pattern single-line mode ( '.' and '\s' match '\n') | |
| perl -i -p0E 's|(<artifactId>api</artifactId>[^<]+<version>)(bbb)(</version>)|\1a\3|g' pom.xml | |
| 2). modify file using regular expression pattern multi-line mode | |
| perl -i -pE 's|(<artifactId>api</artifactId>[^<]+<version>)(bbb)(</version>)|\1a\3|g' pom.xml | |
| 3). do not modify file actually, just print the changed contents | |
| perl -p0E 's|(<artifactId>api</artifactId>[^<]+<version>)(bbb)(</version>)|\1a\3|g' pom.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/krb5.conf | |
| [logging] | |
| default = FILE:/var/log/krb5libs.log | |
| kdc = FILE:/var/log/krb5kdc.log | |
| admin_server = FILE:/var/log/kadmind.log | |
| [libdefaults] | |
| dns_lookup_realm = false | |
| ticket_lifetime = 24h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * install | |
| # yum install postgresql-server postgresql-contrib | |
| # postgresql-setup initdb | |
| * allow passowrd authentication & remote access | |
| # vi /var/lib/pgsql/data/pg_hba.conf | |
| host all all 127.0.0.1/32 ident | |
| host all all ::1/128 ident | |
| -> | |
| host all all 127.0.0.1/32 md5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done | |
| from | |
| http://wingloon.com/2013/05/07/how-to-detect-a-new-hard-disk-without-rebooting-vmware-linux-guest/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * install ntp | |
| yum install ntp | |
| * edit /etc/ntp.conf | |
| server 0.pool.ntp.org | |
| server 1.pool.ntp.org | |
| server 2.pool.ntp.org | |
| * enable ntp service | |
| centos 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://mathiasbynens.be/notes/mysql-utf8mb4 | |
| my.cnf | |
| ... | |
| [client] | |
| default-character-set = utf8mb4 | |
| [mysqld] | |
| character-set-server = utf8mb4 | |
| collation-server = utf8mb4_unicode_ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var objIdMin = ObjectId(Math.floor((new Date('1990/10/10'))/1000).toString(16) + "0000000000000000") | |
| var objIdMax = ObjectId(Math.floor((new Date('2011/10/10'))/1000).toString(16) + "0000000000000000") | |
| db.myCollection.find({_id:{$gt: objIdMin, $lt: objIdMax}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. MySQL5.7+ generates a temporary random password after installation and stored in /var/log/mysqld.log | |
| 2. get the temporay password to reset root password | |
| grep "A temporary password is generated for root" /var/log/mysqld.log | |
| 3. a. mysql> uninstall plugin validate_password; | |
| b. /etc/my.cnf | |
| validate_password_policy=LOW |
OlderNewer