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 / laravel-subdirectory.conf
Created December 3, 2022 01:25 — forked from tsolar/laravel-subdirectory.conf
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@mohamad-supangat
mohamad-supangat / icheck.sh
Created October 12, 2022 03:28 — forked from bcantoni/icheck.sh
Bash script for checking internet connection status and keeping a local log when it changes. Meant to be run at some regular interval as a cron job.
#!/bin/bash
# check internet connectivity status
# file 'status' contains last known status (online or offline)
# file 'status.log' has an entry every time status changes
source ./status
echo "last status: $status at $time"
if nc -zw1 google.com 443; then
echo "online"
if [[ "$status" = "online" ]]; then
@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 / 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 / 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

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

@mohamad-supangat
mohamad-supangat / README.md
Created December 10, 2021 02:53 — forked from nemanjan00/README.md
Disabling Android Setup wizard

Disabling Android Setup wizard

To disable setup wizard:

mv /system/priv-app/SetupWizard/SetupWizard.apk /system/priv-app/SetupWizard/SetupWizard.apk.bkp

To make device think setup is done:

@mohamad-supangat
mohamad-supangat / patch.sh
Created June 11, 2021 01:06 — forked from rufoa/patch.sh
sublime merge 2 build 2056 linux
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
target="${1:-/opt/sublime_merge/sublime_merge}"
check_sha() {
local sha_valid