Skip to content

Instantly share code, notes, and snippets.

View AaronMT's full-sized avatar
👾
Hacking

Aaron Train AaronMT

👾
Hacking
View GitHub Profile
@AaronMT
AaronMT / css-parse.py
Created April 5, 2012 01:01
CSS-Parse
#!/usr/bin/env python
__author__ = 'aaron.train@gmail.com'
import cssutils
import sys, getopt
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "", ["url=", "file="])
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import time
import sys
import time
devices = os.popen('adb devices').read().strip().split('\n')[1:]
device1 = MonkeyRunner.waitForConnection( devices[0].split('\t')[0])
package = 'com.android.browser'
#!/bin/bash
# website history generator v 0.02
#
# Usage webhistgen <n> <appname>
# n: number of websites to visit
# appname: application name such as org.mozilla.fennec
#
n=$1;
appname=$2;
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
import time
class TestIMEI(GaiaTestCase):
# Dialer
from gaiatest import GaiaTestCase
import time
class TestIMEI(GaiaTestCase):
# Dialer
_keyboard_container_locator = ('id', 'keyboard-container')
_call_bar_locator = ('id', 'keypad-callbar-call-action')
_phone_number_view_locator = ('id', 'phone-number-view')
_attention_frame_locator = ('xpath', '//*[@id="attention-screen"]/iframe')
_homescreen_frame_locator = ('css selector', 'iframe.homescreen')
_homescreen_landing_locator = ('id', 'landing-page')
def _swipe_to_everything_me(self):
hs_frame = self.marionette.find_element(*self._homescreen_frame_locator)
self.marionette.switch_to_frame(hs_frame)
landing_element = self.marionette.find_element(*self._homescreen_landing_locator)
landing_element_x_centre = int(landing_element.size['width']/2)
I/Gecko ( 111): MARIONETTE LOG: INFO: TEST-END: /Users/AaronMT/Documents/Projects/gaia-ui-tests-mozilla/gaiatest/tests/test_radio.py:test_radio
E/GeckoConsole( 111): Content JS LOG at app://fm.gaiamobile.org/js/fm.js:142 in updatePowerUI: Power status: on
I/Gecko ( 111): 1354725555172 Marionette INFO sendToClient: {"from":"conn10.marionette1","value":null}, undefined, null
D/memalloc( 111): /dev/pmem: Freeing buffer base:0x4a41c000 size:614400 offset:1843200 fd:88
D/memalloc( 111): /dev/pmem: Freeing buffer base:0x4a2f0000 size:614400 offset:614400 fd:71
I/Gecko ( 111): 1354725555241 Marionette INFO sendToClient: {"from":"conn10.marionette1","ok":true}, undefined, null
I/Gecko ( 111): 1354725555305 Marionette INFO sendToClient: {"from":"conn10.marionette1","value":[["INFO","TEST-START: /Users/AaronMT/Documents/Projects/gaia-ui-tests-mozilla/gaiatest/tests/test_radio.py:test_radio","Wed Dec 05 2012 11:39:06 GMT-0500 (EST)"],["INFO","TEST-END: /Users/AaronMT/Documents/Projects/gaia-ui-tests-mozil
#!/bin/sh
# Script to change the B2G UA
# Based on Dave Hyland's script https://gist.github.com/2656232
# Options: default, fennec, android
LOCAL_PREFS_JS=C:\\prefs.js
PROFILE_DIR=$(adb shell echo -n "/data/b2g/mozilla/*.default")
REMOTE_PREFS_JS=${PROFILE_DIR}/prefs.js
rm -f ${LOCAL_PREFS_JS}
@AaronMT
AaronMT / sites.csv
Last active June 12, 2019 00:23
$> monkeyrunner sites.py sites.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"http://google.com"
"http://facebook.com"
"http://youtube.com"
"http://yahoo.com"
"http://baidu.com"
"http://wikipedia.org"
"http://live.com"
"http://qq.com"
"http://amazon.com"
"http://twitter.com"
@AaronMT
AaronMT / manifest-pull.py
Last active January 4, 2016 21:28
manifest pull and test
$ cat manifests | while read line ; do echo $line; curl -IL http://dapk.net/application.apk?manifestUrl=$line --connect-timeout 30; done