Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MStrecke
MStrecke / TlsTest.kt
Created July 26, 2017 23:11
Helper to access hosts with self-signed certificates
package de.mstrecke.util
import java.net.HttpURLConnection
import java.net.URL
import java.security.KeyStore
import java.security.KeyStoreException
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.security.cert.CertificateException
import java.security.cert.CertificateFactory
@MStrecke
MStrecke / gist:aba362839673fec9298f
Created January 24, 2016 14:43
output of error demo
REPORT /owncloud/remote.php/caldav/calendars/mike/testcal1/ HTTP/1.1
Host: hermitest
Content-Length: 391
Accept: text/xml
User-Agent: Mozilla/5.0
Depth: 1
Content-Type: application/xml; charset="utf-8"
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXX
<?xml version='1.0' encoding='utf-8'?>
@MStrecke
MStrecke / errordemo.py
Created January 24, 2016 14:38
Raw communication with owncloud server
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import socket
import base64
import urlparse
# Data for accessing the calendar
CALURL = 'http://hermitest/owncloud/remote.php/caldav/calendars/mike/testcal1/'
USERNAME = 'mike'
@MStrecke
MStrecke / gist:8cd6dab12711b62f769d
Created August 3, 2014 22:56
Syncthing-android-crash 20140804
08-04 00:46:34.880 387 430 I ActivityManager: Displayed com.nutomic.syncthingandroid/.gui.MainActivity: +874ms (total +4m43s579ms)
08-04 00:46:35.020 4269 4284 W PostTask: Failed to call Rest API at http://127.0.0.1:8080/rest/shutdown
08-04 00:46:35.020 4269 4284 W PostTask: org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:8080 refused
08-04 00:46:35.020 4269 4284 W PostTask: at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183)
08-04 00:46:35.020 4269 4284 W PostTask: at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-04 00:46:35.020 4269 4284 W PostTask: at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-04 00:46:35.020 4269 4284 W PostTask: at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
08-04 00:46:35.020 4269 4284 W PostTask: at org.apache.http.impl.client.Abstract
06-14 19:33:15.945: I/ActivityManager(169): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.nutomic.syncthingandroid/.gui.MainActivity} from pid 444
06-14 19:33:16.025: I/ActivityManager(169): Start proc com.nutomic.syncthingandroid for activity com.nutomic.syncthingandroid/.gui.MainActivity: pid=2270 uid=10141 gids={1015, 3003}
...
06-14 19:33:16.515: I/SyncthingService(2270): Checking for needed config updates
06-14 19:33:16.535: D/dalvikvm(2270): GC_CONCURRENT freed 202K, 5% free 6766K/7047K, paused 3ms+5ms
06-14 19:33:16.605: I/SyncthingService(2270): Web GUI will be available at http://127.0.0.1:8080
06-14 19:33:16.685: D/libEGL(2270): loaded /system/lib/egl/libEGL_tegra.so
06-14 19:33:16.785: D/libEGL(2270): loaded /system/lib/egl/libGLESv1_CM_tegra.so
06-14 19:33:17.125: D/libEGL(2270): loaded /system/lib/egl/libGLESv2_tegra.so
06-14 19:33:17.205: W/PostTask(2270): Failed to call Rest API at http://127.0.0.1:8080/rest/shutdown
--- a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java
+++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java
@@ -128,10 +128,10 @@ public class SyncthingService extends Service {
process = Runtime.getRuntime().exec("sh");
dos = new DataOutputStream(process.getOutputStream());
// Set home directory to data folder for syncthing to use.
- dos.writeBytes("HOME=" + getApplicationInfo().dataDir + "\n");
+ dos.writeBytes("HOME=" + getFilesDir() + "\n");
// Call syncthing with -home (as it would otherwise use "~/.config/syncthing/".
dos.writeBytes(getApplicationInfo().dataDir + "/" + BINARY_NAME + " " +
@MStrecke
MStrecke / syncthingerror2.txt
Created May 31, 2014 13:45
logcat, Syncthing, not storing config
05-31 15:38:51.290 406-802/? I/ActivityManager﹕ START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.nutomic.syncthingandroid cmp=com.nutomic.syncthingandroid/.WebGuiActivity bnds=[270,437][399,593] u=0} from pid 722
05-31 15:38:51.310 406-426/? I/ActivityManager﹕ Start proc com.nutomic.syncthingandroid for activity com.nutomic.syncthingandroid/.WebGuiActivity: pid=3130 uid=10150 gids={1015, 3003, 1028}
05-31 15:38:51.330 406-450/? W/ApplicationContext﹕ Unable to create files directory /data/data/com.nutomic.syncthingandroid/files
05-31 15:38:51.970 406-450/? I/ActivityManager﹕ Displayed com.nutomic.syncthingandroid/.WebGuiActivity: +672ms (total +44s981ms)
05-31 15:40:37.630 3130-3155/? I/SyncthingService﹕ stdout: 13:38:52 INFO: Generating RSA certificate and key...
05-31 15:40:37.630 3130-3155/? I/SyncthingService﹕ stdout: 13:39:51 OK: Created RSA certificate file
05-31 15:40:37.630 3130-3155/? I/SyncthingService﹕ stdout: 13:39:51 O
@MStrecke
MStrecke / gist:7c8548f1f96c71438143
Created May 31, 2014 13:16
logcat, Syncthing-Android, Crash
05-31 15:04:38.070 1945-1945/? E/ActivityThread﹕ Activity com.android.settings.Settings$DevelopmentSettingsActivity has leaked IntentReceiver android.view.ViewRootImpl$1@4121aed0 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.android.settings.Settings$DevelopmentSettingsActivity has leaked IntentReceiver android.view.ViewRootImpl$1@4121aed0 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:763)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:567)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1043)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1030)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1024)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:341)