Skip to content

Instantly share code, notes, and snippets.

View viktorbenei's full-sized avatar

Viktor Benei viktorbenei

  • Bitrise Ltd (CTO & Cofounder)
  • Hungary
View GitHub Profile
@viktorbenei
viktorbenei / README.md
Last active November 2, 2018 16:32
bitrise flank config

Bitrise Flank config

See the bitrise.yml for an example setup, using https://github.com/TestArmada/flank on https://www.bitrise.io/

The config requires the following variables to be set as Secrets:

  • SERVICE_ACCOUNT_KEY_JSON : the Google (Firebase) Service Account JSON
  • GOOGLE_CLOUD_PROJECT : the Firebase google project name/id

Note: if you'd get an error like Test run failed to complete. Expected 786 tests, received 660 that can mean that the test app is not orchestrator compatible. If that's the case simply change the use-orchestrator: true to use-orchestrator: false in the Flank config (flank.yml) and it'll work.

@viktorbenei
viktorbenei / howto-recover-google-authenticator-keys.txt
Created April 12, 2018 18:58 — forked from jbinto/howto-recover-google-authenticator-keys.txt
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
@viktorbenei
viktorbenei / gist:cca967e09bf701aa9cb5
Last active March 19, 2018 09:39
Bash script to generate secure passwords
#
# requires 'pwgen', can be installed with brew
#
# add this to your .bash_profile, .profile or .bashrc for quick terminal access
# input: the length of the password
# usage example: gensecpsw 16
# example result: XjQ%uWQ.&7-T4@`(
#
gensecpsw() {
printf '%s' $(pwgen -B -c -s -n -y $1 1) |pbcopy; echo "Has been copied to clipboard"
@viktorbenei
viktorbenei / step.sh
Created December 4, 2015 14:41
Offset the Bitrise.io $BITRISE_BUILD_NUMBER
#!/bin/bash
set -e
if [ -z "$BITRISE_BUILD_NUMBER" ] ; then
echo " [!] BITRISE_BUILD_NUMBER not provided"
exit 1
fi
echo "=> Original BITRISE_BUILD_NUMBER: $BITRISE_BUILD_NUMBER"
set -x
@viktorbenei
viktorbenei / bitrise.fish
Created November 24, 2017 14:28
Bitrise CLI base fish shell completion for "run" and "version" commands
# ~/.config/fish/completions/bitrise.fish
# Run
complete -f -c bitrise -n '__fish_use_subcommand' -a run -d 'run specified workflow'
complete -f -c bitrise -n '__fish_seen_subcommand_from run' -a (bitrise workflows --id-only)
# Version
complete -f -c bitrise -n '__fish_use_subcommand' -a version -d 'cli version'
complete -f -c bitrise -n '__fish_seen_subcommand_from version' -s 'f' -l 'full' -d 'print full version'
complete -f -c bitrise -n '__fish_seen_subcommand_from version' -l 'format' -a 'raw json yml' -d 'format of print'
@viktorbenei
viktorbenei / android-emulator-google-api.md
Created March 7, 2016 21:20
Android Emulator with Google APIs

Creating an AVD image with Google APIs is a bit more complex than just having the packages available (which we do).

We just tested with a new project and this should work - delete the Create Android Emulator step and replace it with a Script step:

#!/bin/bash
set -e
set -x

echo y | android update sdk --no-ui --all --filter addon-google_apis-google-22
@viktorbenei
viktorbenei / start_android_studio.sh
Last active October 28, 2017 21:04
Start Android Studio on OS X with latest JVM
#!/bin/bash
#
# Env export required for JDK newer than 1.6 or 1.7
# see: http://stackoverflow.com/questions/20925253/android-studio-failed-to-load-jvm-on-mac-osx-mavericks/27647165#27647165
# OR use:
# $ launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
#
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
@viktorbenei
viktorbenei / gist:11367575
Created April 28, 2014 10:10
Auto increment build number of Xcode project
#
# Paste this into a new "Run Script" Build Phase (as described here: http://stackoverflow.com/a/15483906/974381)
#
# Tip: drag-and-drop your new Run Script to run before the "Compile Sources" Phase!
#
# Source: http://stackoverflow.com/a/15483906/974381
#
# How to get version numbers in code?
# NSString *buildString = infoDictionary[(NSString*)kCFBundleVersionKey];
# NSString *versionString = infoDictionary[@"CFBundleShortVersionString"];
@viktorbenei
viktorbenei / timestamp.sh
Created July 21, 2014 18:24
Example: Generate Unix timestamp in bash script on OS X
#!/bin/bash
function getCurrentUnixTimestamp {
printf %s $(date +%s)
}
echo " (i) Generating current timestamp..."
current_unix_timestamp=$(getCurrentUnixTimestamp)
echo " Timestamp: $current_unix_timestamp"
echo " (i) Done"
@viktorbenei
viktorbenei / gist:08bbe5c4278e33b8cc05
Created March 22, 2016 18:58
diff system_reports/osx-xcode-7.2.log system_reports/osx-xcode-7.3.log
8c8
< * BITRISE_OSX_STACK_REV_ID: 2016_01_28_1
---
> * BITRISE_OSX_STACK_REV_ID: 2016_03_17_1
13c13
< * Go: go version go1.5.3 darwin/amd64
---
> * Go: go version go1.6 darwin/amd64
15a16,19
> java version "1.8.0_74"