Skip to content

Instantly share code, notes, and snippets.

View madun92's full-sized avatar

wahid hidayat madun92

  • Jakarta Utara, indonesia
View GitHub Profile
@madun92
madun92 / firebase-backup.sh
Created February 26, 2024 05:48 — forked from crrobinson14/firebase-backup.sh
Firebase Realtime Database Backup Script
#!/usr/bin/env bash
# This script uses a shallow-get technique to get a list of all top level keys
# in a Firebase Realtime Database, then extract the tree under each key into a
# separate JSON file, one per top level key.
#
# It’s great for making backups because you don’t end up with one ginormous
# export file which is really hard to manage with other tools.
#
# It can also immediately give you a sense of where your space is going per key,
@madun92
madun92 / Install Python 3.7.0 on CentOS 7
Last active February 28, 2024 04:10 — forked from wpupru/Install Python 3.7.0 on CentOS 7
Install Python 3.7.0 on Centos 7
Install Python 3.7.0 on CentOS/RHEL 7
1.Requirements:
yum install gcc openssl11-devel bzip2-devel libffi-devel -y
2.Download Python 3.7:
cd /usr/src
wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz
@madun92
madun92 / postgres_queries_and_commands.sql
Created February 16, 2024 08:16 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
import logging
from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.operators.python import PythonOperator
# Change these to your identifiers, if needed.
POSTGRES_CONN_ID = "postgres_default"
@madun92
madun92 / Appium python - swipe
Created July 19, 2023 17:04 — forked from mayukataoka/Appium python - swipe
Appium python - swipe
self.driver.swipe(start_x=0, start_y=0.6, end_x=0, end_y=0.2, duration=800)
@madun92
madun92 / AdbCommands
Created July 16, 2023 04:38 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@madun92
madun92 / 00.install-android-sdk.sh
Created March 21, 2023 17:16 — forked from nhtua/00.install-android-sdk.sh
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@madun92
madun92 / Android-Emulator-on-AWS-EC2.md
Created March 21, 2023 17:15 — forked from yazinsai/Android-Emulator-on-AWS-EC2.md
Installing and running Android Emulator on Amazon AWS EC2 (Ubuntu 16.04 / m5.xlarge)

Getting the Android Emulator running on EC2 📱

# @ your EC2 instance
sudo apt update
sudo apt install openjdk-8-jre unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
@madun92
madun92 / macro.md
Created February 25, 2021 07:02 — forked from brunogaspar/macro.md
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten