“Restart computer” failed when installing SQL Server 2012
cd sql server folder
run
setup.exe /SkipRules=RebootRequiredCheck /ACTION=install
"Restart computer" failed when installing SQL Server 2012
“Restart computer” failed when installing SQL Server 2012
cd sql server folder
run
setup.exe /SkipRules=RebootRequiredCheck /ACTION=install
How to setting “Custom Naming Strategy” in grails project
By default Grails uses Hibernate’s ImprovedNamingStrategy to convert domain class Class and field names to SQL table and column names by converting from camel-cased Strings to ones that use underscores as word separators. You can customize these on a per-class basis in the mapping closure but if there’s a consistent pattern you can specify a different NamingStrategy class to use.
Configure the class name to be used in grails-app/conf/DataSource.groovy in the hibernate section, e.g.
hibernate
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
naming_strategy = com.a5go.CustomNamingStrategy
You can use an existing class or write your own, for example one that prefixes table names and column names:
package com.a5go
import org.hibernate.cfg.ImprovedNamingStrategy
import org.hibernate.util.StringHelper
class CustomNamingStrategy extends ImprovedNamingStrategy
String classToTableName(String className)
"T_" + StringHelper.unqualify(className)
package ping
import java.io.*
import java.util.*
class PingController
def index()
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = 'ping 127.0.0.1'.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout err> $serr"
def ping()
StringBuffer buf = new StringBuffer();
String s = "";
Process process;
try
process = Runtime.getRuntime().exec( "cmd /c " + "ping 8.8.8.8" );
BufferedReader br = new BufferedReader( new InputStreamReader(
process.getInputStream() ) );
while ( ( s = br.readLine() ) != null )
buf.append( s + "\r\n" );
process.waitFor();
System.out.println( buf );
catch ( Exception ex )
ex.printStackTrace();
root@debian:/var/www# svn update
svn: Can’t open file ‘.svn/text-base/details.html.svn-base': No such file or directory
How to solve:
TortoiseSVN -> Repo-Browser -> select file details.html -> Delete -> Commit
Re check-in details.html to svn
Enabling Server Side Includes (SSI) on Apache and Debian/Ubuntu
Enable the Include module
a2enmod include
or
ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled
Edit the config file
vim /etc/apache2/sites-available/default
add
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
and
Options Indexes FollowSymLinks MultiViews +Includes
the complete file like below:
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
#Order allow,deny
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Options Indexes FollowSymLinks MultiViews +Includes
</Directory>
Restart Apache
service apache2 restart
Test,create shtml file
<html>
<head>
<title>SSI Test Page</title>
</head>
<body>
<!--#config timefmt="%A %B %d, %Y" -->
Today is <!--#echo var="DATE_LOCAL" -->
</body>
</html>
How to remove BOM from UTF-8 using sed?
fetch BOM files
grep -rIlo $’^\xEF\xBB\xBF’ ./
remove BOM files
grep -rIlo $’^\xEF\xBB\xBF’ . | xargs sed –in-place -e ‘s/\xef\xbb\xbf//’
exclude .svn dir
grep -rIlo –exclude-dir=”.svn” $’^\xEF\xBB\xBF’ . | xargs sed –in-place -e ‘s/\xef\xbb\xbf//’
How to find More than 1 GB files of the Bash command line for Linux
find / -type f -size +10000000k;
find / -size +1000M -exec ls -l \;