This file contains 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 | |
CentOS6: | |
$ yum install wget | |
$ wget dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -ivh epel-release-6-8.noarch.rpm | |
$ yum install optipng | |
Mageia: | |
through install manager |
This file contains 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
scp -r root@192.168.0.2:/home2/ /home/ | |
scp root@192.168.0.1:/home/file1.zip root@192.168.0.2:/home2/ | |
-r -- recursive | |
-P port -- non-standart port (22) |
This file contains 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
RECOMMEND TO SAVE ALSO ALL NATIVE FILES FROM DATABASE | |
-- backup | |
mysqldump -u USER -pPASSWORD DATABASE > /path/to/file/dump.sql | |
-- structure database | |
mysqldump --no-data - u USER -pPASSWORD DATABASE > /path/to/file/schema.sql | |
-- dump of one or else tables | |
mysqldump -u USER -pPASSWORD DATABASE TABLE1 TABLE2 TABLE3 > /path/to/file/dump_table.sql | |
-- backup and archive | |
mysqldump -u USER -pPASSWORD DATABASE | gzip > /path/to/outputfile.sql.gz |
This file contains 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
#!/bin/bash | |
MUSER="$1" | |
MPASS="$2" | |
MDB="$3" | |
# Detect paths | |
MYSQL=$(which mysql) | |
AWK=$(which awk) | |
GREP=$(which grep) | |
This file contains 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
@Configuration | |
@EnableJpaRepositories(value = "ru.mrchebik.repository", entityManagerFactoryRef = "entityManagerFactoryBean", transactionManagerRef = "transactionManager") | |
@EnableTransactionManagement | |
public class PersistenceJPAConfig { | |
@Bean | |
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() { | |
Properties properties = new Properties(); | |
properties.put("hibernate.hbm2ddl.auto", "update"); | |
properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect"); | |
properties.put("hibernate.connection.charSet", "UTF-8"); |
NewerOlder