I just excute one script like below
cp.sh file
and copy finished
#!/usr/bin/expect -f set filename [lindex $argv 0]; spawn scp -v /temp/$filename root@192.168.1.1:/tmp/root/ expect "Enter passphrase" send "\r" ...
cp.sh file
#!/usr/bin/expect -f set filename [lindex $argv 0]; spawn scp -v /temp/$filename root@192.168.1.1:/tmp/root/ expect "Enter passphrase" send "\r" ...
mysql>use mysql
mysql> select host, user from user;
----------------------------+
host user
----------------------------+
% dmitry
host : % means all (It is security breach)
host side should be ip address of web server
or
ip address of admin pc.
example)
-- Replace unlimited access rule to only allow 192.168.0.5 host rule
mysql>update user set host='192.168.0.5' where host = '%' and user in ('dmitry');
mysql>commit;
mysql>flush privileges;
Query OK, 0 rows affected (0.01 sec)
-- Remove unlimited access rule
mysql> delete from user where host = '%';
mysql> commit;
mysql> flush privileges;
{
"country": [
{
"name": "germany",
"code": "DE",
"continent": "Europe",
"eat": "sausage"
},
{
"name": "france",
"code": "FR",
"continent": "Europe",
"eat": "croissant"
},
{
"name": "korea",
"code": "KR",
"continent": "ASIA",
"eat": "rice"
},
{
"name": "japan",
"code": "JP",
"continent": "ASIA",
"eat": "fish"
}
]
}
private List<Country> getCountryList() throws Exception {
File dirSDCard = Environment.getExternalStorageDirectory();
File yourFile = new File(dirSDCard, "country.json");
InputStream jsonStream = new FileInputStream(yourFile);
JSONObject jsonObject = new JSONObject(InputStreamToString(jsonStream));
JSONArray jsonArray = jsonObject.getJSONArray("country");
List<Country> countryList = new ArrayList<Country>();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonCountry = jsonArray.getJSONObject(i);
Country country = new Country();
country.setName(jsoncountry.getString("name"));
country.setCode(jsoncountry.getString("code"));
country.setContinent(jsoncountry.getString("continent"));
country.setEat(jsoncountry.getString("eat"));
countryList.add(country);
}
return countryList;
}
private String InputStreamToString(InputStream is) {
BufferedReader r = new BufferedReader(new InputStreamReader(is));
StringBuilder total = new StringBuilder();
String line;
try {
while ((line = r.readLine()) != null) {
total.append(line);
}
} catch (IOException e) {
e.printStackTrace();
}
return total.toString();
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
<!-- JNDI datasource -->
<!--
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/oraclePool" />
<property name="resourceRef" value="true" />
</bean>
-->
<!-- Hsql datasource -->
<!--
<jdbc:embedded-database id="dataSource">
<jdbc:script location="classpath:hsql/schema.sql" />
<jdbc:script location="classpath:hsql/data.sql" />
</jdbc:embedded-database>
-->
<!-- Oracle JDBC datasource -->
<!--
<bean id="dataSource"
class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="oracle.jdbc.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@HOST:1111:ORA" />
<property name="username" value="ID" />
<property name="password" value="PASSWORD" />
</bean>
-->
<!-- mysql JDBC datasource -->
<!--
<bean id="dataSource"
class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/mydata" />
<property name="username" value="user123" />
<property name="password" value="12345678" />
</bean>
-->
<!-- sqlite JDBC datasource -->
<!--
<bean id="dataSource"
class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.sqlite.JDBC" />
<property name="url" value="jdbc:sqlite:C:/yourdb.sqlite" />
</bean>
-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.devtrigger.model" />
<property name="mapperLocations" value="classpath*:dao/**/*.xml" />
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<!-- scan for mapper interface files and let them be autowired -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.devtrigger.dao" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
$svn export --force file:///home/svn/myrepos ./myrepos
$cat /home/svn/myrepos/conf/authz $cat /home/svn/myrepos/conf/passwd $cat /home/svn/myrepos/conf/svnserve.conf
$svnadmin create myrepos --pre-1.6-compatible
$svnadmin dump /home/svn/myrepos > /home/backup/svn/myrepos.dump
- SVN incremental Backup $ svnadmin dump myrepos --revision 0:1000 > dumpfile1 $ svnadmin dump myrepos --revision 1001:2000 --incremental > dumpfile2 $ svnadmin dump myrepos --revision 2001:3000 --incremental > dumpfile3 $ svnadmin dump <repos> -r 58:HEAD --deltify > <file2>
$ cd /home/svn $ svnadmin load --bypass-prop-validation myrepos < /home/backup/svn/myrepos.dump
- SVN recovery * incremental : $ svnadmin load < ~/repos-0-1000.svn_dump $ svnadmin load < ~/repos-1000-2000.svn_dump $ svnadmin load < ~/repos-2000-3000.svn_dump
$ pkill -KILL svnserve
$ svnserve -d -r /home/svn/
- SVN revision pack per 1000 revision $ svnadmin pack /home/svn/sfc