Skip to content

Instantly share code, notes, and snippets.

View NeoHBz's full-sized avatar

Saurav NeoHBz

View GitHub Profile
@NeoHBz
NeoHBz / bouncer.json
Created June 26, 2024 08:03
export for Bouncer iOS app to filter SMS
[
{
"type": "any",
"action": "transaction",
"caseSensitive": true,
"subAction": "transactionFinance",
"phrase": "-Federal Bank",
"id": "D3542430-2CBC-4357-A243-90D97D04B908",
"useRegex": false
},
@NeoHBz
NeoHBz / new_user.sh
Created June 19, 2024 10:26
MacOS: Create new user without homedir/login
sudo dscl . -create /Users/unbound
sudo dscl . -create /Users/unbound UserShell /usr/bin/false
sudo dscl . -create /Users/unbound RealName "Unbound DNS User"
sudo dscl . -create /Users/unbound UniqueID "550"
sudo dscl . -create /Users/unbound PrimaryGroupID 20
sudo dscl . -create /Users/unbound NFSHomeDirectory /var/empty
sudo dscl . -passwd /Users/unbound "password"
sudo dscl . -append /Groups/_developer GroupMembership unbound
@NeoHBz
NeoHBz / recoverlivephotos.txt
Created June 10, 2024 08:14
Recover Live Photos after it gets separated on a non-Apple system
Source: https://discussions.apple.com/thread/254398527?sortBy=best
FYI: How to rebuild a Live Photo after it gets separated into two files, one photo and one video.
This is not really a question but I wanted to share what I discovered with the community so it can help others as I have not been able to find any online resources so far.
After transferring photos from iPhone to Mac using Image Capture or using file transfer in a Windows PC, the Live Photos break into two file types, .MOV and .JPG and can not be viewed as a single Live Photo anymore.
BUT there is a solution that stitches/merges them back together.
Open Photos on your Mac. In Preferences make sure Copy Items to the Photo Library is selected. Close Preferences window.
{
"accountChart": [
"on",
"on",
"on",
"on"
],
"ads": "off",
"alwaysShowDecimalPlaces": false,
"alwaysShowWordsHistory": true,
@NeoHBz
NeoHBz / mount_volume.sh
Created October 19, 2022 20:41
mount block volume on Oracle Canonical Ubuntu
# run iscsiadm commands from Oracle Cloud WebUI >> Block Storage >> Block Volumes >> Block Volume Details
lsblk
sudo mkdir /mnt/drive
sudo mount -t auto -v /dev/sdb1 /mnt/drive
@NeoHBz
NeoHBz / batch_rename.sh
Created September 22, 2022 10:18
batch rename files with regex pattern
sudo apt install rename
# remove `-n` for the script to actually work
rename -n 's/^\[https.*\]_(.*)/${1}/' *
@NeoHBz
NeoHBz / AuthyToOtherAuthenticator.md
Created September 4, 2022 09:29 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@NeoHBz
NeoHBz / keyRemapper.sh
Last active August 20, 2022 17:17
Command to Remap F4 and F5 keys to control keyboard brightness on newer MacBook models, no reboot required.
hidutil property --set '{"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc": 0xC00000221,
"HIDKeyboardModifierMappingDst": 0xFF00000009
},
{
"HIDKeyboardModifierMappingSrc": 0xC000000CF,
"HIDKeyboardModifierMappingDst": 0xFF00000008
}
]}'
import { useCallback } from "react";
import { Button } from "@chakra-ui/react";
import useRazorpay from "react-razorpay";
export default function Pay() {
const Razorpay = useRazorpay();
const handlePayment = useCallback(async () => {
const order = {
id: "order_JZtmToLbdp5p2F",
entity: "order",
@NeoHBz
NeoHBz / tampermoney-github_fork_status.js
Last active June 5, 2022 17:27
Tampermoney script to show Fork Status (fork x commits ahead, y commits behind)
// ==UserScript==
// @name GitHub Fork Details
// @namespace https://gist.github.com/NeoHBz/5028c5493fb68cb167235d2c074a138c
// @version 1.0
// @description Displays if GitHub forks are behind/ahead from the parent fork
// @author NeoHBz
// @include https://github.com/*/*/network/members
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==