Category: Opensource

Install MariaDB 10.4 + Apache2(httpd) 2.4 + PHP 7.3 on CentOS 7.6

1. 准备 cat /etc/redhat-release # CentOS Linux release 7.6.1810 (Core) 2. 安装MariaDB 10.4 cat | sudo tee /etc/yum.repos.d/mariadb.repo <<EOF [mariadb] name = MariaDB baseurl = https://yum.mariadb.org/10.4/rhel7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF sudo yum install MariaDB-server MariaDB-client sudo systemctl start mariadb sudo systemctl enable mariadb #表名大小写不敏感 sudo sed -i ‘s/\[mysqld\]/[mysqld]\nlower_case_table_names=1/’ /etc/my.cnf sudo mysql_secure_installation Create database. Let’s take wordpress as an example: $ mysql -u root -p MariaDB [(none)]> CREATE DATABASE `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; MariaDB [(none)]> grant all on wordpress.*…

Read More »

Install CloudStack 4.11.1.0 on CentOS 7.5

1 Preparation 1.1 设置selinux sed -i s#’SELINUX=enforcing’#’SELINUX=permissive’#g /etc/selinux/config setenforce 0 1.2 安装NTP(时间同步) yum -y install ntp systemctl enable ntpd 1.3 安装cloudstack.repo cat <<EOF > /etc/yum.repos.d/cloudstack.repo [cloudstack] name=cloudstack baseurl=http://cloudstack.apt-get.eu/centos/7/4.11/ enabled=1 gpgcheck=0 EOF 1.4 设置防火墙 firewall-cmd –permanent –add-port=111/tcp firewall-cmd –permanent –add-port=111/udp firewall-cmd –permanent –add-port=2049/tcp firewall-cmd –permanent –add-port=32803/tcp firewall-cmd –permanent –add-port=32769/udp firewall-cmd –permanent –add-port=892/tcp firewall-cmd –permanent –add-port=892/udp firewall-cmd –permanent –add-port=875/tcp firewall-cmd –permanent –add-port=875/udp firewall-cmd –permanent –add-port=662/tcp firewall-cmd –permanent –add-port=662/udp firewall-cmd –permanent –add-port=8080/tcp firewall-cmd –reload firewall-cmd –list-all 2 Installation 2.1 安装cloudstack-management yum -y install…

Read More »

How to encrypt a large file in openssl using public key

See: https://stackoverflow.com/questions/7143514/how-to-encrypt-a-large-file-in-openssl-using-public-key Generate a symmetric key because you can encrypt large files with it openssl rand -base64 32 > key.bin Encrypt the large file using the symmetric key openssl enc -aes-256-cbc -salt -in myLargeFile.xml \ -out myLargeFile.xml.enc -pass file:./key.bin Encrypt the symmetric key so you can safely send it to the other person openssl rsautl -encrypt -inkey public.pem -pubin -in key.bin -out key.bin.enc Destroy the un-encrypted symmetric key so nobody finds it shred -u key.bin or: gshred -u key.bin At this…

Read More »

Filter and rename resources with Maven

Source: http://roufid.com/filter-and-rename-resources-with-maven/ 17 DEC, 2016 If you want to filter and copy your project resources to the output directory, the Apache Maven Resources Plugin is the best plugin to perform that. But sometimes you want to filter and renameresources with Maven and the last version of the Maven Resources Plugin (current 3.0.1) does not provide a direct way to do that. This tutorial will show a workaround to filter and rename resources with Maven. Project example Let’s consider a file file–to–rename.txt located under src/main/ which  we want to filter and rename to renamed–file.txt. Below the…

Read More »

Spring Boot SLF4J Logging example

By mkyong | January 4, 2017 | Updated : April 17, 2017 | Viewed : 0 times +-57,224 pv/w By default, the SLF4j Logging is included in the Spring Boot starter package. application.properties spring-boot-web-project$ mvn dependency:tree +… +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.2.RELEASE:compile [INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile [INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile [INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile [INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile [INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile +… Note Review this Spring Boot Logback XML template to understand the default logging pattern and configuration….

Read More »

git list remote branches

Sometimes you may need to figure out what branches exist on a remote repository so you can pull them down and check them out, merge them into your local branches, etc. If you’re using GitHub or gitweb to host your repository it’s usually easy to determine the branch names, but if you need to get them in general or for scripts it’s not exactly clear. UPDATE: The comments have enlightened me quite a bit…there seems to always be more than one way to skin a cat using…

Read More »

Gradle to maven conversion and vice versa

A N M Bazlur Bazlur RahmanJuly 20, 2014Java, Tips How to convert maven to gradle The first thing is, you have to install gradle. Its easy. I know you can do it.  Go to the installing guide: http://www.gradle.org/docs/current/userguide/installation.html Now the second step is to run ‘gradle init‘ in the directory containing the POM file. This will  convert the maven build to a gradle build generating a setting.gradle file and one or  ore more build.gradle files. Thats all. How to convert gradle to…

Read More »

Understand JMeter APDEX

1. Concept APDEX is explained here To compute it JMeter needs 2 values: Satisfied count Tolerating count Satisfied count is the Number of requests for which response time is lower than “Toleration threshold” Tolerating count is the Number of requests for which response time is higher than Toleration threshold but lower than “Frustration threshold” So JMeter let’s you customize those 2 values as it depends on your SLR/SLA. APDEX = (SatisfiedCount + ToleratingCount / 2) / TotalSamples 2. How to…

Read More »