Skip to content

Instantly share code, notes, and snippets.

@filmaj
filmaj / directions.md
Last active August 23, 2019 13:36
putting together an lxc for appium on ubuntu

ubuntu lxc

NOTES:

  • p1 referred to below is simply the name given to the LXC. You can change this if you want, just remember to always refer to the same container name :P
  • Only for real devices: make sure that the vendor ID you enter into the android udev rules file matches the device you want to be visible
  1. first, set up vagrant VM to run on a "public network". My Vagrantfile's only network config is:

config.vm.network "public_network", :bridge => 'en0: Wi-Fi (AirPort)'

@filmaj
filmaj / host.log
Last active June 2, 2017 05:35
adb output w/ ADB_TRACE=all on an ubuntu host (where it works) compared to inside an LXC on the same host (where it doesn't work)
vagrant@precise64:~$ adb devices
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::adb_query():adb_query: host:devices
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/transport.c::writex():writex: fd=3 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=3 len=12: 686f73743a76657273696f6e host:version
system/core/adb/transport.c::readx():readx: fd=3 wanted=4
system/core/adb/transport.c::readx():readx: fd=3 wanted=4 got=4
4f4b4159 OKAY
system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 3
@filmaj
filmaj / index.html
Created July 31, 2013 23:04
Off the ground with cordova camera in no time
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="app">
@filmaj
filmaj / plugin.js
Created July 17, 2013 00:00
drawer plugin brainstorm
function Drawer() {
this.listeners = {
"close":[],
"open":[]
}
var self = this;
cordova.exec(function(evt) {
self.listeners[evt].forEach(function(l) {
l();
});
@filmaj
filmaj / gist:4210194
Created December 4, 2012 23:20
nodejitsu socket hang up
fil-MacBookAir:medic fil$ jitsu deploy
info: Welcome to Nodejitsu filmaj
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in dashboard.js
info: Checking app availability medic
info: Creating app medic
info: Creating snapshot 0.0.4-1
info: Updating app medic
info: Activating snapshot 0.0.4-1 for medic
@filmaj
filmaj / gist:3694793
Created September 10, 2012 23:30 — forked from timkim/gist:3694742
Cordova Android Git Url
git clone https://git-wip-us.apache.org/repos/asf/incubator-cordova-android
cd incubator-cordova-android/framework
android update project -p .
curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip
unzip commons-codec-1.6-bin.zip
cp commons-codec-1.6/commons-codec-1.6.jar libs/.
@filmaj
filmaj / error.log
Created July 18, 2012 18:32
backbutton index - cordova, phonegap
07-18 14:21:39.333: WARN/System.err(1256): java.net.SocketException: Permission denied
07-18 14:21:39.333: WARN/System.err(1256): at org.apache.harmony.luni.platform.OSNetworkSystem.createServerStreamSocketImpl(Native Method)
07-18 14:21:39.353: WARN/System.err(1256): at org.apache.harmony.luni.platform.OSNetworkSystem.createServerStreamSocket(OSNetworkSystem.java:170)
07-18 14:21:39.353: WARN/System.err(1256): at org.apache.harmony.luni.net.PlainServerSocketImpl.create(PlainServerSocketImpl.java:45)
07-18 14:21:39.363: WARN/System.err(1256): at java.net.ServerSocket.<init>(ServerSocket.java:135)
07-18 14:21:39.363: WARN/System.err(1256): at java.net.ServerSocket.<init>(ServerSocket.java:89)
07-18 14:21:39.363: WARN/System.err(1256): at org.apache.cordova.CallbackServer.run(CallbackServer.java:205)
07-18 14:21:39.363: WARN/System.err(1256): at java.lang.Thread.run(Thread.java:1096)
@filmaj
filmaj / gist:3031791
Created July 2, 2012 08:05
global scope hurray
<html>
<head>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="mysqliteplugin.js"></script>
<script type="text/javascript">
var db; // this is now globally-scoped
document.addEventListener('deviceready', function() {
db = new sqliteplugin(); // assigns to the db variable above
});
</script>
@filmaj
filmaj / index.html
Created June 26, 2012 15:52
cordova bench web assets
<!DOCTYPE html>
<html>
<head>
<meta name=viewport content=width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no>
</head>
<body>
<h1>Cordova how fast are you?</h1>
<script src="cordova-1.9.0rc1.js"></script>
@filmaj
filmaj / error.log
Created January 18, 2012 18:51
nodejitsu error log
Fil-Majs-MacBook-Pro:blazd filmaj$ jitsu apps deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command apps deploy
info: Authenticated as filmaj
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /Users/filmaj/src/blazd/package.json
data: