CentOS 6.5 change time zone on server
To change time zone on server run commands: First command backups currently selected timezone file. Second is setting desired time zone (America/Los_Angeles in this example).
web development and system administration of Linux
To change time zone on server run commands: First command backups currently selected timezone file. Second is setting desired time zone (America/Los_Angeles in this example).
To archive master branch of git repository into zip file the following commands can be used: To view list of archived files use command: I have described viewing zip files in my post List files and folders inside Java jar archive.
To decode SSL certificate the following command can be used: Example command output: Certificate: Data: Version: 3 (0x2) Serial Number: 2b:2e:6e:ea:d9:75:36:6c:14:8a:6e:db:a3:7c:8c:07 Signature Algorithm: sha384WithRSAEncryption Issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Certification Authority Validity Not Before: Feb 12 00:00:00 2014 GMT Not After : Feb 11 23:59:59 2029 GMT Subject: C=GB, ST=Greater … Continue reading OpenSSL how to decode SSL certificate file
To connect to remote MySQL server via SSH tunnel run commands: Where 3307 local port, 1.2.3.4 remote MySQL server IP, 3306 remote MySQL port, taras – valid SSH user name. To check if tunnel connection has been set up: Connect to remove MySQL server using local SSH tunnel:
To decode CSR the following command can be used:
To set up persistent IPTables rules on Debian GNU/Linux 7 (wheezy) install package using command: Save current IPTables rules using command: Edit /etc/iptables/rules.v4 file for IPv4 and /etc/iptables/rules.v6 for IPv6 rules. To apply new rules run command: Loading iptables rules… IPv4… IPv6…done. To view current IPTables rules:
To edit remote origin URL in Git configuration file can be edited: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote “origin”] url = ssh://git@bitbucket.org/podlom/example.git fetch = +refs/heads/*:refs/remotes/origin/* Where url = ssh://git@bitbucket.org/podlom/example.git new example path. To check new settings use command: origin ssh://git@bitbucket.org/podlom/example.git (fetch) origin ssh://git@bitbucket.org/podlom/example.git (push)
To create second MySQL database and give privileges to the same user the following commands can be used: SHOW CREATE DATABASE `database_name`; will show first MySQL create database DDL SQL query. CREATE DATABASE `database_name2` /*!40100 DEFAULT CHARACTER SET utf8 */; will create second MySQL database. SHOW GRANTS FOR database_user; is used to view current user … Continue reading Create second MySQL database and give privileges to one user
To connect to remote server via ssh proxy use can use the following sequence of commands: If TCP port 2222 is free you will not see any output. So you can use it for SSH proxied connection. proxy_user – SSH user on SSH proxy server proxy_host. destination_host – IP or host name of remote server … Continue reading Connect to remote host via ssh proxy
To view possible options of apachectl – web server Apache server control interface run command: To view full version information run: To view list of compiled-in modules execute: To check web server Apache syntax run: To restart web server Apache gracefully run command: