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 / auto_wifi.sh
Last active February 7, 2022 02:38
Android auto connect to wifi from shell
#!/system/bin/sh
# i use https://github.com/steinwurf/adb-join-wifi for auto connect to wifi
# tanks
# wait for boot to finish completely
while [[ `getprop sys.boot_completed` -ne 1 ]]
do
sleep 1
done
@danmana
danmana / example_model.py
Created August 16, 2021 15:08
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
@ziadoz
ziadoz / Dockerfile
Last active June 30, 2022 06:53
Install glibc on PHP Alpine Docker Image
FROM php:8-cli-alpine
# @see: @see: https://stackoverflow.com/a/65969295
RUN apk --no-cache add binutils curl \
&& GLIBC_VER=$(curl -s https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/latest | grep tag_name | cut -d : -f 2 | tr -d \",' ') \
&& curl -sL https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-${GLIBC_VER}.apk \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk \
&& apk add --no-cache \
glibc-${GLIBC_VER}.apk \
@thewh1teagle
thewh1teagle / gist:bbd324a13087e206fee2ef0b4db8753f
Created November 17, 2020 22:35
skip samsung setup wizard
adb shell settings put global setup_wizard_has_run 1
adb shell settings put secure user_setup_complete 1
adb shell settings put global device_provisioned 1
adb shell mv /system/system/priv-app/SamsungExperienceService/SamsungExperienceServic
e.apk /system/system/priv-app/SamsungExperienceService/SamsungExperienceService
.apk.bkp
adb shell mv /system/system/priv-app/SetupWizard/SetupWizard.apk /system/system/priv-app/SetupWizard
@rufoa
rufoa / patch.sh
Last active February 2, 2024 06:41
sublime merge 2 build 2068 linux
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
target="${1:-/opt/sublime_merge/sublime_merge}"
check_sha() {
local sha_valid
printf '\00\00\00' | dd of=sublime_text bs=1 seek=290764 count=3 conv=notrunc
https://www.google.com/search?q=%22EA7E-890007%22
@stefanoschrs
stefanoschrs / add-frame.sh
Created August 9, 2019 15:36
deviceframe iPhone X hack
outputDir=/tmp/screenshots/framed
mkdir -p ${outputDir}
##########
# iPhone #
##########
padPath=/tmp/iphone-pad.png
convert -size 1125x185 xc:#e65562 ${padPath}
for filePath in $(find /tmp/screenshots/ | grep iPhone | grep -v framed) ; do
@ernierasta
ernierasta / sway-record
Last active August 18, 2022 19:36
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:
@Jaskaranbir
Jaskaranbir / github_release_script.sh
Last active March 16, 2023 14:00
Shell script to create GitHub releases with automatically generated changelogs (using github-changelog-generator).
#!/bin/bash
# ===> Set these variables first
branch="$GIT_BRANCH"
# Example: "Jaskaranbir/MyRepo"
repo_slug="$TRAVIS_REPO_SLUG"
token="$GITHUB_TOKEN"
version="$TRAVIS_TAG"
# An automatic changelog generator
@bcantoni
bcantoni / icheck.sh
Created July 2, 2018 19:42
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