Skip to content

Instantly share code, notes, and snippets.

View berkedel's full-sized avatar

Akhmad Syaikhul Hadi berkedel

View GitHub Profile
@berkedel
berkedel / fix-xcode-select-error-xcodebuild-requires-xcode.md
Last active April 13, 2024 17:14
Fix `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`

Tried to create react app

npx create-react-app app

Unfortunately, got an xcodebuild error

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v57-darwin-x64.tar.gz
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@berkedel
berkedel / fix-sudoers-issue-on-macos-catalina.md
Created January 3, 2020 11:21
Fix `sudoers` issue on macOS Catalina

Fix sudoers Issue on macOS Catalina

If you messed up with editing sudoers, this solution is for you. The solution is limited to restoring /etc/sudoers file to the original state. It is easier to mess up your config such as saving wrong format, etc.

How to Fix

  • Please reboot your macOS into recovery mode. While rebooting press and hold Cmd+R key.
  • After you completely reboot, you will see a dialog. You need to open Terminal by clicking Utilities > Terminal on menu.
  • In order to mount /etc as writable state, you need to disable SIP first by executing csrutil disable.
  • Reboot into single user mode. While rebooting press and hold Cmd+S key.
@berkedel
berkedel / disassemble-luajit-v2.py
Created October 24, 2022 13:32
Quick and dirty verbose LuaJIT's bytecode version 2 disassembler. For v1, please refer to https://gist.github.com/MickaelWalter/4b130d36040844abcb71bf69fe8d6fd4
#!/usr/bin/env python3
import sys
import struct
import math
# Constants
# Internal (LEB128 buffer)
MAX_ULEB_SIZE = 256 # Maximum proto size here is 2^7^256
@berkedel
berkedel / import-x509-pk8-to-jks-keystore.md
Created October 12, 2020 10:43
How to import x509.pem pk8 file into jks keystore

How to import x509.pem pk8 file into jks keystore

Prerequiste:

Generate a file platform.priv.pem from you pk8 file.

openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out platform.priv.pem -nocrypt
@berkedel
berkedel / Visualize Git Cheatsheet.md
Last active October 18, 2022 11:19
Visualize Git Cheatsheet

Visualize Git Cheatsheet

Git Cheatsheet, (c) 2009-2012, Andrew Peterson

Stash

A place to hide modifications made to the workspace, while working on something else. (The stash area is not required in a “normal” workflow.)

Stash

@berkedel
berkedel / adding_new_webhook_topics.php
Created February 3, 2018 07:38 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.

Encrypt and Decrypt Plain String

Encrypt

echo "<plain_string>" | openssl enc -e -des3 -base64 -pass pass:mypasswd -pbkdf2

Decrypt

@berkedel
berkedel / android-backup-apk-and-datas.md
Created July 8, 2021 01:54 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@berkedel
berkedel / mount-hfsplus-in-raspberry-pi.md
Last active June 26, 2021 14:22
Mount HFS+ in Raspberry Pi

The first thing to do before we access HFS+ drive, ensure our board is running lastest software.

sudo apt update
sudo apt upgrade

Install all HFS packages we need.

sudo apt-get install hfsplus hfsutils hfsprogs gdisk