Skip to content

Instantly share code, notes, and snippets.

View esabook's full-sized avatar
🛰️
Seeking planet

esabook

🛰️
Seeking planet
View GitHub Profile
@esabook
esabook / postman-scripting.js
Created November 26, 2019 07:59
Example usage of auto swith url, set username, save token
// prerequest script
// hooked before call
if (pm.environment.get("offline")=="on"){
pm.environment.set("baseURL", pm.environment.get("offlineSite"));
}else{
pm.environment.set("baseURL", pm.environment.get("onlineSite"));
}
pm.environment.set("username", "salt");
@esabook
esabook / CollectQuestionPreloader.java
Last active November 25, 2019 15:48
Process custom PreloadType to xForm (ODK Collect)
package org.odk.collect.android.logic;
import android.support.annotation.NonNull;
import com.google.common.base.Joiner;
import org.javarosa.core.model.data.IAnswerData;
import org.javarosa.core.model.data.LongData;
import org.javarosa.core.model.data.StringData;
import org.javarosa.core.model.instance.TreeElement;
Powershell or CMD console:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
open link & install:
https://www.microsoft.com/store/productId/9NBLGGH4MSV6
akses icon shortcut, atau cmd:
wsl
ubuntu
@esabook
esabook / init-config-for-wsl-invoker.rc
Last active November 25, 2019 15:52
Accessing all windows app executable (*.exe) from Windows Subsystem for Linux (WSL) without extension
how to use:
nano ~/.bashrc
paste block of command_not_found_handle() in bellow
save & test
example test:
notepad as notepad.exe
explorer as explorer.exe
@esabook
esabook / frida-android-repinning.js
Created November 25, 2019 14:49
Mirror frida-android-repinning.js
/*
Android SSL Re-pinning frida script v0.2 030417-pier
$ adb push burpca-cert-der.crt /data/local/tmp/cert-der.crt
$ frida -U -f it.app.mobile -l frida-android-repinning.js --no-pause
https://techblog.mediaservice.net/2017/07/universal-android-ssl-pinning-bypass-with-frida/
*/
setTimeout(function(){
@esabook
esabook / Analytics.html
Created November 25, 2019 14:43
Listen outbonds link from current view, and send to google analytics
<!-- Here you can add your Google Analytics Tracking code. If you do so, do not
forget to set the include_analytics attribute to true on the _config.yml file -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XB3ENLMJ9V"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-XB3ENLMJ9V');
gtag('send', 'pageview');
@esabook
esabook / InjectJsWebview.kt
Last active February 8, 2020 07:29
listening login form
web.settings.javaScriptEnabled = true
web.settings.allowFileAccessFromFileURLs = true
web.webViewClient = object: WebViewClient(){
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
evaluateJS(view)
}}
@esabook
esabook / SearchablePopupDialog.java
Last active January 19, 2020 09:09
expand autocomplete pupup dialog to separated popup dialog
package ***;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.SearchView;
@esabook
esabook / NumberFormat.java
Last active November 7, 2019 09:50
remove leading zero for decimal result
// remove leading zero from form input,
// 0000003232 change to 3232
// 0000.002 change to 0.002
// 00,030 change to 0,030
String formatedSellingValue = roundedSellingValue
.replaceFirst("^((?![(\\.)|(\\,)]))+(?!$)", "");
@esabook
esabook / RxBus.kt
Last active January 19, 2020 09:10
EventBus wrapper in RxJava
package ***
import io.reactivex.subjects.PublishSubject
import java.util.*
class RxBus {
companion object {
val instance = RxBus()
private val subject = PublishSubject.create<Any>()
}