Skip to content

Instantly share code, notes, and snippets.

View m-rap's full-sized avatar
🐢

Rian Prakoso m-rap

🐢
  • Surabaya, Indonesia
View GitHub Profile
@m-rap
m-rap / ges and gst
Last active December 20, 2024 02:15
ges and gst
# cut video using ges-launch-1.0
ges-launch-1.0 +clip input.mp4 inpoint=2.0 duration=5.0 -o output.mp4
# amplify audio of an mp4 video
gst-launch-1.0 filesrc location=input.mp4 ! decodebin name=dec ! x264enc ! qtmux name=mux ! filesink location=output.mp4 dec. ! audioamplify amplification=0.6 ! audioconvert ! mux.
@m-rap
m-rap / setup headless raspberry pi os bookworm 64-bit
Last active December 20, 2024 02:15
setup headless raspberry pi os bookworm 64-bit
# mount sdcard
udisksctl mount -b /dev/<sdcard-rootfs-devblock>
# install qemu-user-static and copy it inside raspberry rootfs
sudo apt install --no-install-recommends qemu-user-static
sudo cp /usr/bin/qemu-aarch64-static <rootfs-mountpoint>/bin
# chroot to raspberry os on host
sudo chroot <rootfs-mountpoint> /bin/qemu-aarch64-static /bin/bash
@m-rap
m-rap / ble (logitech m585)
Last active July 21, 2023 02:18
bluetooth
# path: /var/lib/bluetooth/<hostdevid>/<remotedevid>/info
[General]
Name=M585/M590
Appearance=<?>
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
WakeAllowed=true
@m-rap
m-rap / launch.json
Created August 19, 2022 11:00
simple vscode cmake debug configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"externalConsole": true,
"target": "./build/aprogram",
"cwd": "${workspaceRoot}",
@m-rap
m-rap / ssh-remote-port-forwarding.sh
Created June 15, 2022 02:49
Making ssh server on private network accessible on public remote
# open port 11022 on remote and tunnel it port 22 on local
ssh <user>@<remote-ip> -R 11022:localhost:22
#forwarding port 5900 on remote to 25900 in local
ssh user@hostname -L 25900:localhost:5900
@m-rap
m-rap / scan.sh
Created May 20, 2022 10:09
scan command
# list devices
scanimage -L
# scan with res 300 dpi
scanimage -d <device> --mode Color --resolution 300 -o scan.jpg
#!/bin/bash
IFS="=" read -ra dbuspathval <<< $DBUS_SESSION_BUS_ADDRESS
dbuspathval=${dbuspathval[1]}
docker run \
-it \
--privileged \
--shm-size=2g \
-e DISPLAY=$DISPLAY \
@m-rap
m-rap / bt_csr_5.13.0-35.patch
Last active May 1, 2022 22:21
bt_csr_5.13.0-35.patch
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 4fe15e1434b0..80c11ef5465a 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1935,6 +1935,8 @@ static int btusb_setup_csr(struct hci_dev *hdev)
*/
set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks);
set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks);
+ set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks);
+ set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks);
@m-rap
m-rap / rclone with progress stats
Last active December 20, 2024 02:17
rclone with progress stats
rclone mount --vfs-cache-mode writes --stats 1m --stats-one-line <remote> <local> -v