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 / crontab.sh
Last active October 30, 2023 09:24
Run php8 artisan queue:work in cpanel cronjob
/opt/alt/php81/usr/bin/php /home/u8071632/public_html/prakerin/api/artisan queue:work --queue=high,default >> /home/u8071632/public_html/prakerin/log_cron.txt 2>&1
@mohamad-supangat
mohamad-supangat / url
Created February 5, 2022 01:28
Get google token with Request consent
https://accounts.google.com/o/oauth2/v2/auth?client_id=XXXX.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/userinfo.profile&response_type=code
source: https://www.daimto.com/how-to-get-a-google-access-token-with-curl/
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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