San Jasinto hiking

imageIt’s my first time to hike up San Jasinto. We started from trail head close to Idllywild. The sign shows 5.25mile but actually it was 13miles for the whole route, according to the GPS.
San Jasinto is the second highest peak in south California, therefore on the list of many hikers who are interested in challenging higher and more difficult peaks.
I loved the beautiful forest we walked through. At a point we meet hikers who came up from the tram. That’s another way to hike up San Jasinto peak.

The peak was full of people. Some people were so enthusiastic in taking photos there, we left the peak shortly to avoid the congestion.
The elevation gain was 4400 feet, the highest one I ever did this year. I will be back!

Setup SSL for MySQL replication

MySQL replication is setup already. Now I need to add SSL so the communication between server and client will be secure.

1. generate CA certificate and server key/cert on Master

CA certificate
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 1000 -key ca-key.pem -out ca-cert.pem

Server Key/Cert
openssl req -newkey rsa:2048 -days 1000 -nodes -keyout server-key.pem -out server-req.pem
openssl x509 -req -in server-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem

2. enable SSL on master
add the following to both [client] and [mysqld]

ssl-ca=/var/lib/mysql/ssl/ca-cert.pem
ssl-cert=/var/lib/mysql/ssl/client-cert.pem
ssl-key=/var/lib/mysql/ssl/client-key.pem

3. generate client key/cert on Slave

openssl req -newkey rsa:2048 -days 1000 -nodes -keyout client-key.pem -out client-req.pem
openssl x509 -req -in client-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem

4. enable SSL on slave
repeat 2, but on slave server and using keys/cert of slave, restart db with skip-slave-start

5. start slave

mysql>change master to master_host=’masterdb’, master_user=’repliuser’, master_password=’pass’,master_log_file=’db1-bin.xxxxx’, master_log_pos=98, MASTER_SSL=1, MASTER_SSL_CA=’ssl/ca-cert.pem’;
start slave

6. setup User permission to use SSL only
User “GRANT” to setup user allow SSL connection only

Check if SSL is on in mysqld

mysql> show variables like ‘%have_ssl%’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| have_ssl | YES |
+—————+——-+

Check if Client is using SSL:

>mysql
SHOW STATUS LIKE ‘Ssl_cipher’;

Rattle snake peak

Rattle Snake peak

I have to admit, this trail name made me though I would see some rattle snake on it when the first time I heard about it, however that’s not the reason why it’s named like so. But now it triggers the memory of struggling up to the peak and the exhausting feeling at the end, together with the horror from the sting of yucca full grown along the trail. I have to say, the name matches the trail!
The trail head was close to “bridge to no where”. It was a hot day, many cars went to the river side. It has 8 miles totally, with 4000 feet escalation gain.
The first one and half mile was flat. then it got steep for the rest 2.5miles! Steep, slippery and yucca plants, this combination makes it one of the most difficult trail in San Gabriel mountains.

Wild flower at Rattle Snake Peak trail

But there was also some rewards. Spanish Broom was decorating the area with bright yellow and patches of purple Lupin and ping Prickly Phlox were seen and there. What was most amazing I found here was a type of lizard living here, I think they are called “horned toad”. They have some great camouflage that I couldn’t be able to tell them from the sandy ground if they were not moving. They looks like from some other planet!

 

manipulating strings

1. cut

Ex. #echo “192.168.1.10:8080″| cut -d: -f1
192.168.1.10

Ex. User with uniq & sort

Ex. #netstat -nap|less|grep ‘192.168’| awk ‘{print $5}’|uniq -c|sort -nr -k 1

2. sed

match a string and replace it

echo “I love poem”|sed ‘s/peom/music/’