Skip to content

Instantly share code, notes, and snippets.

@btwarog
btwarog / gist:5381e70908600dd79dd4b0a0df5e8ccb
Last active December 7, 2022 09:09
IPv4 Addresses Android Kotlin
NetworkInterface.getNetworkInterfaces().asSequence().forEach { nInterface ->
println("IPv4 address ${nInterface.displayName} ${nInterface.interfaceAddresses.filter { it.address is Inet4Address }.joinToString { it.address.hostAddress }}")
}
@btwarog
btwarog / sha256 hash
Created October 7, 2022 08:05 — forked from pollux-/sha256 hash
Generating SHA256 hash of a public key from remote server certificate
Creating certificate from remote URL and writing to file (mycertfile.pem)
openssl s_client -showcerts -connect gist.github.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem
Generating SHA256 hash of public key from a certificate (mycertfile.pem)
openssl x509 -in mycertfile.pem -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
@btwarog
btwarog / sha256 hash
Created October 7, 2022 08:05 — forked from pollux-/sha256 hash
Generating SHA256 hash of a public key from remote server certificate
Creating certificate from remote URL and writing to file (mycertfile.pem)
openssl s_client -showcerts -connect gist.github.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem
Generating SHA256 hash of public key from a certificate (mycertfile.pem)
openssl x509 -in mycertfile.pem -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
@btwarog
btwarog / android_studio_shortcuts.md
Created August 23, 2018 16:25 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@btwarog
btwarog / export_google_music.js
Last active January 15, 2017 18:45 — forked from jmiserez/export_google_music.js
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <jeremie@miserez.org>, 2016
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.