User:DBrant (WMF)/Goodies

From MediaWiki.org
Jump to navigation Jump to search

Uncle Dmitry's bag of goodies. You're welcome.

Apps team pages[edit]

Plans and goals[edit]

Phabricator boards[edit]

Deprecated[edit]

Android[edit]

$ brew install jd-gui
$ brew install dex2jar
$ d2j-dex2jar <input.dex> -o <output.jar>
$ adb tcpip 5555
$ adb connect <ip-address>:5555
  • To switch back to ADB over USB:
$ adb -s <ip-address>:5555 usb
  • To get the IP address of the device:
$ adb shell
$ netcfg
  • To simulate a BOOT_COMPLETED event:
$ adb shell
$ am broadcast -a android.intent.action.BOOT_COMPLETED

The above may actually cause your device to reboot, in which case you'll get the event when the device finished booting! ;)

  • To simulate an INSTALL_REFERRER event:
$ adb shell
$ am broadcast -a com.android.vending.INSTALL_REFERRER -n org.wikipedia/org.wikipedia.analytics.InstallReceiver --es "referrer" "referrer_url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWombat&campaign_id=foo&install_id=bar"

In the above, make sure you set the package name ("org.wikipedia") to the correct flavor that you're testing, and optionally change the "referrer_url" to something else.

MySQL[edit]

  • Linux/Windows/Mac: MySQL Workbench
    • (Windows only) Establish an ssh tunnel to stat1006: $ ssh -L 222:localhost:22 stat1006.eqiad.wmnet (note the port number "222", so that it doesn't conflict with any local SSH server that might be running)
    • SSH Hostname: localhost, SSH Username: dbrant, MySQL Hostname: analytics-slave.eqiad.wmnet, Username: research
    • Get the password for the "research" user from stat1006/etc/mysql/conf.d/research-client.cnf.
    • Note, when installing on Windows, and you find that Workbench fails to connect to Wikimedia's stat1006 over the Bastion tunnel, try using this fork of paramiko.
    • Also, to make text fields appear properly, go to Edit -> Preferences, SQL Editor -> SQL Execution, and check the box "Treat BINARY/VARBINARY as nonbinary character string."
  • Mac only: Sequel Pro
    • MySQL Host: analytics-slave.eqiad.wmnet, Username: research, SSH Host: stat1006.eqiad.wmnet
    • Get the password for the "research" user from stat1006/etc/mysql/conf.d/research-client.cnf.

Gerrit / Github repos[edit]

Git[edit]

$ git remote add upstream https://github.com/foo/bar.git
$ git fetch upstream
$ git checkout master
$ git merge upstream/master

API[edit]

Services[edit]

https://en.wikipedia.org/api/rest_v1/page/title/Cat
https://en.wikipedia.org/api/rest_v1/page/summary/Cat
https://en.wikipedia.org/api/rest_v1/page/html/Cat
https://en.wikipedia.org/api/rest_v1/page/random/title
https://en.wikipedia.org/api/rest_v1/page/random/summary
https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Cat
https://en.wikipedia.org/api/rest_v1/page/mobile-sections-lead/Cat
https://en.wikipedia.org/api/rest_v1/page/mobile-sections-remaining/Cat
https://en.wikipedia.org/api/rest_v1/feed/featured/2017/04/01
https://en.wikipedia.org/api/rest_v1/feed/announcements
https://en.wikipedia.org/api/rest_v1/feed/trending/edits
https://en.wikipedia.org/api/rest_v1/feed/onthisday/all/08/07
https://en.wikipedia.org/api/rest_v1/feed/onthisday/births/08/07
http://appservice.wmflabs.org/en.wikipedia.org/v1/feed/featured/2017/03/05
http://appservice.wmflabs.org/en.wikipedia.org/v1/page/random/summary

CI / Jenkins / Zuul[edit]

  • Main Jenkins dashboard.
  • Search of the dashboard for everything about "apps"
  • Add a comment of "recheck" to force Jenkins to reevaluate a patch.

Remember to always !log in #wikimedia-qa when performing manual commands via Jenkins control panel.

Wikitech / OpenStack / Cloud services[edit]

  • After creating an account, make sure to upload your public key.
  • Deployment-prep project, where new tools and experimental features are hosted before going to production. (Hosts testing eventlogging server, among other things.)
  • Mobile project. (Hosts android-builder, among other things)
  • List of all projects.
  • Nova Resource category.

Event logging[edit]

$ ssh deployment-eventlog05.eqiad.wmflabs
$ tail -f /srv/log/eventlogging/all-events.log | grep "MobileWikiApp"

Analytics[edit]

  • SWAP: Python notebooks integrated into eventlogging.

releases1001 (releases) (formerly Bromine, formerly Caesium)[edit]

To copy stuff over:

$ scp [file] releases1001.eqiad.wmnet:~/[file]
$ scp app.apk releases1001.eqiad.wmnet:/srv/org/wikimedia/releases/mobile/android/wikipedia/alphas/app.apk

Android builds[edit]

  • New: android-builder.mobile.eqiad.wmflabs
    • Gerrit repository that contains the web page that serves the Alpha download link, and the shell script that copies the latest Alpha from the CI server to the web server. After committing a change to this repo, log on to the android-builder server, and do a git pull on /srv/builds.
$ ssh android-builder.mobile.eqiad.wmflabs
$ sudo -s
$ sudo -u android-build /bin/bash
$ cd /srv/builds
$ ssh dbrant@tools-login.wmflabs.org
$ OR: ssh dbrant@tools-dev.wmflabs.org
$ become wikipedia-android-builds
$ webservice [start|stop]

Partners[edit]

people.wikimedia.org[edit]

TranslateWiki[edit]

Wikidata[edit]

Bintray / Maven / Jcenter[edit]

Wmflabs Android maven repo[edit]

$ ssh dbrant@tools-login.wmflabs.org
$ cd /data/project/android-maven-repo/public_html

.ssh config[edit]

## Use bastion-eqiad.wmflabs.org as proxy to labs
Host bastlabs
HostName bastion-eqiad.wmflabs.org
User dbrant
IdentityFile ~/.ssh/id_rsa

Host *.eqiad.wmflabs !bastion-eqiad.wmflabs.org
User dbrant
IdentityFile ~/.ssh/id_rsa
ProxyCommand ssh -a -W %h:%p bastlabs

## Production bastion host
Host bastprod
HostName bast1002.wikimedia.org
User dbrant
IdentityFile ~/.ssh/id_rsa_prod

Host *.eqiad.wmnet *.wikimedia.org !bast1002.wikimedia.org
User dbrant
IdentityFile ~/.ssh/id_rsa_prod
ProxyCommand ssh -a -W %h:%p bastprod

Notice that the above file uses a different key file for production than wmflabs, for security reasons.

On macOS 10.12 and above, you may need to add the following (since it no longer adds the keys to ssh-agent by default):

Host *
UseKeychain yes
AddKeysToAgent yes

Onboarding/Fundamentals[edit]

Administrative[edit]

Design[edit]

Miscellaneous[edit]

 exiftool -AllDates-= -AllDates="2008:01:01 12:00:00" -overwrite_original -r .
  • Remove the GPS Exif tag from photos:
 exiftool -gps:all= -xmp:geotag= image.jpg -overwrite_original *

Teachable moments[edit]