Skip to content

Instantly share code, notes, and snippets.

$ appium --log-timestamp
2020-07-02 18:19:03:552 - [Appium] Welcome to Appium v1.17.1
2020-07-02 18:19:03:555 - [Appium] Non-default server args:
2020-07-02 18:19:03:556 - [Appium] logTimestamp: true
2020-07-02 18:19:03:579 - [Appium] Appium REST http interface listener started on 0.0.0.0:4723
2020-07-02 18:19:10:795 - [HTTP] --> GET /wd/hub/sessions
2020-07-02 18:19:10:795 - [HTTP] {}
2020-07-02 18:19:10:797 - [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: []
2020-07-02 18:19:10:798 - [debug] [GENERIC] Responding to client with driver.getSessions() result: []
2020-07-02 18:19:10:802 - [HTTP] <-- GET /wd/hub/sessions 200 5 ms - 40
@davidlc9113
davidlc9113 / Apple_mobile_device_types.txt
Created April 20, 2020 13:25 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
#!/usr/bin/env bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python
pip3 install pyotp
chmod a+x "$1"
cp "$1" /usr/local/bin/
@davidlc9113
davidlc9113 / googleauth.py
Last active December 14, 2018 06:35
Get Google Authenticator code by secret key
#!/usr/bin/env python3
"""
Install dependencies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d
# Output the code
$ googleauth your_secret_key
# (Mac only) Copy the code
$ googleauth your_secret_key | pbcopy
@davidlc9113
davidlc9113 / airdrop.py
Last active December 19, 2018 02:15
Send Ether by web3.py
#!/usr/bin/env python
import csv, sys, time
from decimal import Decimal
from web3 import Web3, HTTPProvider
class Airdrop(object):
def __init__(self, network, file):
super(Airdrop, self).__init__()
self.network = network
@davidlc9113
davidlc9113 / trades_gas.py
Last active October 21, 2018 08:41
Sum of trades gas
# $ ./bin/console
from datetime import datetime
result = 0
admin = AdminAPI(env.config)
trades = admin.trades({ 'offset': 0, 'limit': 30})
timestamp = lambda e: int(datetime.strptime(e, '%Y.%m.%d %H:%M:%S').timestamp())
for e in trades.result():
if e['finished_at'] > timestamp('2018.10.21 15:00:00') and \
e['finished_at'] < timestamp('2018.10.21 16:00:00'):
@davidlc9113
davidlc9113 / tbbug
Last active September 7, 2018 03:47
Report bugs from teambition export spreadsheet
#!/usr/bin/env ruby
require 'roo'
require 'csv'
file = ARGV[0]
csv_file = File.join(
ENV['HOME'], 'Downloads', 'tbbug' + Time.now.strftime("%y%m%d") + '.csv')
start_time = Time.parse "#{Time.now.to_date - 7} 16:00"
end_time = Time.parse "#{Time.now.to_date} 16:00"
map = { user: '创建者',
#!/usr/bin/env ruby
GEM_SOURCE = ARGV[0]
class Mac
class << self
def install_dependencies
puts 'Resolving dependencies ...'
install_command_line_tools
install_brew
@davidlc9113
davidlc9113 / appium.log
Created February 14, 2017 07:06
Appium server log
Launching Appium with command: /usr/local/lib/node_modules/appium/build/lib/main.js --debug-log-spacing --automation-name "Appium" --platform-name "Android" --platform-version "7.1" --no-reset --app-pkg "com.tencent.mm" --app-activity ".ui.LauncherUI" --app-wait-package "com.tencent.mm" --app-wait-activity ".ui.LauncherUI" --device-name "00d5d10b8060c135"
[Appium] Welcome to Appium v1.6.4-beta
[Appium] Non-default server args:
[Appium] debugLogSpacing: true
[Appium] platformName: 'Android'
[Appium] platformVersion: '7.1'
[Appium] automationName: 'Appium'
@davidlc9113
davidlc9113 / rbenv.md
Created December 30, 2016 03:07
Install Ruby by rbenv

Install Ruby by rbenv

# Download rbenv and associated plugins
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/jf/rbenv-gemset.git ~/.rbenv/plugins/rbenv-gemset
git clone https://github.com/rbenv/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update