Month: September 2015

[Q&A] how to use android annotations in gradle

build.gradle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
buildscript {
    repositories {
        mavenCentral()
    }
 
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}
 
repositories {
    mavenCentral()
    mavenLocal()
}
 
apply plugin: 'android-apt'
 
def AAVersion = '3.3.2'
 
apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
    }
}
 
dependencies {
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}
Tags : ,

[Q&A] How to solve java.lang.OutOfMemoryError: GC overhead limit exceeded error in android studio

in build.gradle

1
2
3
4
5
6
android {
...
   dexOptions {
      javaMaxHeapSize "2g"
   }
}
Tags :

[Q&A] How to enable silent notification in iOS

set content-available = 1

Provide this key with a value of 1 to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed,application:didReceiveRemoteNotification:fetchCompletionHandler: is called.

(Newsstand apps are guaranteed to be able to receive at least one push with this key per 24-hour window.)

Tags : ,

[Q&A]How to backup/restore MacOS Server.app / Wiki

reference
bender

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#######################################################
Please note that this does NOT bring over any users or groups.  You need to restore OD for your Open Directory users to log in properly.
 
On the Target Server
1.	Setup new Target Server with IP domain name etc.
2.	Start the wiki service - log in and check that it is running properly.
3.	Turn off the Wiki Service on your Target Server, and quit out of Server.app
 
 
On Source Server
1.	Copy the FileData from your source server to your target server
	a.	Copy FileData from your latest Bender Backup.
	b.	Copy directly from /Library/Server/Wiki/FileData
 
2.	Perform a dump of your collab database:
	a.	Copy the collab.pgdump /Backups folder if using Bender
	b.	Manually perform the pg dump:
		pg_dump -h "/Library/Server/Wiki/PostgresSocket" --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab
 
	**Note you can and should change the destination of the pgdump.**
 
On the Target Server
1.	Copy the FileData to the target system.
	/Library/Server/Wiki/FileData
 
2.	Set owners and permissions on the target.
	sudo chown -R _teamsserver:_teamsserver /Library/Server/Wiki/FileData
	sudo chmod -R +a "www allow search" /Library/Server/Wiki/FileData
 
3.	Prepare the Target for the pgdump.
	Connect to the psql service for the Wiki Service.  This will be done from within psql, so your prompt will change.
 
	sudo psql -h "/Library/Server/Wiki/PostgresSocket" -U collab template1
 
	Clear out PID so we can drop the database:
 
	SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'collab' AND pid <> pg_backend_pid();
 
	Drop the existing collab database:
 
	drop database "collab";
 
	Create a new collab database:
 
	create database "collab";
 
	Quit out of psql:
 
	\q
 
4.	Restore the Wiki by loading the pgdump from the Source Server:
	1.	Enable Wiki Service in Server.app
	2.	sudo pg_restore -h "/Library/Server/Wiki/PostgresSocket" -d collab -U collab --single-transaction "/Path/to/location/of/collab.pgdump"
 
5.	Clean up wiki permissions, searchindex and quicklooks.
	sudo wikiadmin fixPermissions
	sudo wikiadmin rebuildSearchIndex
	sudo wikiadmin resetQuicklooks
 
6.	Log in to your wiki's on the Target Server.
 
#######################################################
Tags : ,