Skip to content

Instantly share code, notes, and snippets.

View mohamad-supangat's full-sized avatar
:shipit:
Working from home

Mohmad Supangat mohamad-supangat

:shipit:
Working from home
View GitHub Profile
@mohamad-supangat
mohamad-supangat / README.md
Created October 11, 2022 07:15
backup and restore boot and recovery using dd

backup with dd

dd if=/dev/block/mmcblk0 of=/storage/sdcard1/boot.img bs=4096 count=4096 skip=7552
dd if=/dev/block/mmcblk0 of=/storage/sdcard1/recovery.img bs=4096 count=4096 skip=11648
fash boot.img with dd
dd if=/sdcard/image-new.img of=/dev/block/platform/155a0000.ufs/by-name/BOOT
@mohamad-supangat
mohamad-supangat / readme.md
Last active January 6, 2024 03:29
Auto start boot in charging conencted

lineage os 14.1

init.rc

on charger
  class_start charger
  class_stop charger
  trigger late-init
@mohamad-supangat
mohamad-supangat / script.sh
Created October 11, 2022 07:04 — forked from silvae86/script.sh
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell
#Tested with Samsung Galaxy Note 3 (your mobile phone may have different paths and partitions!!)
#check adb connection...
adb devices
#copy the boot.img image to the mobile phone (in this case, the root of the SD Card)
adb push <path_to_your_boot.img_extracted_from_custom_rom_zip>/boot.img /external_sd/boot.img
#open shell
adb shell
@mohamad-supangat
mohamad-supangat / novnc.service
Created September 13, 2022 13:28
Novnc as systemd service
[Unit]
Description = start noVNC service
After=syslog.target network.target
[Service]
Type=simple
ExecStart=novnc_proxy --vnc localhost:5901 --listen localhost:6080
[Install]
WantedBy=multi-user.target
@mohamad-supangat
mohamad-supangat / README.md
Last active December 30, 2022 01:49 — forked from thewh1teagle/gist:bbd324a13087e206fee2ef0b4db8753f
Skip Android Setup Wizard

adb shell settings put global setup_wizard_has_run 1 adb shell settings put secure user_setup_complete 1 ;

Samsung user

adb shell mv /system/system/priv-app/SamsungExperienceService/SamsungExperienceServic e.apk /system/system/priv-app/SamsungExperienceService/SamsungExperienceService .apk.bkp

Remove Setup Wizard

@mohamad-supangat
mohamad-supangat / example_model.py
Created June 9, 2022 04:24 — forked from danmana/example_model.py
Add support for custom json fields in Odoo
from odoo import models, fields, api
from json_field import JsonField
class Person(models.Model):
_name = 'example.person'
_description = 'Person with json details'
details = JsonField() # a json object represented as dict / list / python primitives
@mohamad-supangat
mohamad-supangat / wp-config.php
Created April 23, 2022 06:36
Fixing loop to many redirect wordpress
<?php
// in wp-config.php
$_SERVER['HTTPS'] = 'on';
/*That’s all, stop editing! Happy blogging. */
@mohamad-supangat
mohamad-supangat / sway-record
Created March 25, 2022 02:48 — forked from ernierasta/sway-record
Swaywm screen and audio recording
#!/bin/bash
# Sway WM screen + audio recorder
# original author: Aaron D. Fields
# blog post: https://blog.spirotot.com/2017/08/21/a-dirty-hack-to-enable-acceptable-sway-wm-screen-recording/
# currently error 503 :-(
#
# Updated version: ernierasta
# Repo: https://gist.github.com/ernierasta
#
# Changelog:
@mohamad-supangat
mohamad-supangat / mysql-docker.sh
Created March 4, 2022 02:31 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mohamad-supangat
mohamad-supangat / auto_wifi.sh
Last active February 26, 2022 06:26
Wpa Supplicant Auto Android
#!/system/bin/sh
# wait for boot to finish completely
while [[ `getprop sys.boot_completed` -ne 1 ]]
do
sleep 1
done
# sleep an additional 2m to ensure init is finished
sleep 120