Skip to content

Instantly share code, notes, and snippets.

View arbal's full-sized avatar
👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);

Arbal arbal

👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);
  • Los Angeles, CA
  • 15:02 (UTC -07:00)
View GitHub Profile
@arbal
arbal / hung.m
Created July 27, 2023 16:01 — forked from kkirby/hung.m
Updated NonResponding
/**
* compile using this:
* gcc -framework Carbon -framework Foundation ./hung.m -o hung
*
* Referenced from https://apple.stackexchange.com/a/424763/260619
* Original source code https://github.com/jksoegaard/NonResponding
* Original Author: jksoegaard
**/
#import <Foundation/Foundation.h>
@arbal
arbal / README.md
Created June 23, 2023 06:52 — forked from HosseyNJF/DELETE_DATA_FROM_PROMETHEUS.md
Delete data from exported time-series from Prometheus / VictoriaMetrics in a time range.

Usage

Note that the response cache must be deleted after these steps in order to remove previously cached results - see more details here.

@arbal
arbal / bitcoin_fast_sync_ideas.md
Created June 22, 2023 23:30 — forked from bensig/bitcoin_fast_sync_ideas.md
Fast Sync Bitcoin Node - 3 Options

Option 1 - Use This Bitcoin Fast Sync Command

There is no torrent which would be faster than just using the Bitcoin network "hive" - which is huge. There may be a way to sync using local or low-latency nodes nearby, but any time you specify which nodes you sync from - it introduces risk.

Very good to have a fast CPU and lots of RAM, SSD is not as important as RAM.

With this command I was able to download the entire blockchain and create all indices in almost exactly 24 hours:

bitcoind --datadir=<path-to-external-ssd> -blockfilterindex=1 -txindex=1 -coinstatsindex=1 -dbcache=16384 -daemon If you have 32GB of RAM, you can use 32768 for dbcache

@arbal
arbal / unbound-cheat-sheet.md
Created June 11, 2023 17:02 — forked from f9n/unbound-cheat-sheet.md
Unbound Cheat Sheet

Unbound Cheat Sheet

Installation

$ yum install -y unbound

Setup SSL keys for unbound-control

@arbal
arbal / impbcopy.m
Created February 13, 2023 23:52 — forked from mwender/impbcopy.m
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@arbal
arbal / Disable-Ventura-Bloatware.sh
Created January 15, 2023 00:44 — forked from b0gdanw/Disable-Ventura-Bloatware.sh
Disable Ventura Bloatware
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot
# user
@arbal
arbal / get_current_console_user.md
Created January 8, 2023 22:31
Ways to get the current/active GUI (Console) user in macOS

Grab the current or most recent console user in macOS

Should work on Linux as well.

id -un

stat returns last user logged in most recently.

stat -f %Su /dev/console

Can cause some false positives depending on environment.

ls /dev/console | awk '{ print $3 }'

@arbal
arbal / ffmpeg-progress-dialog.sh
Created January 1, 2023 17:58 — forked from TimmThaler/ffmpeg-progress-dialog.sh
This bash script shows you the progress of your ffmpeg conversion.
#!/bin/bash
#
# ffmpeg-progress-dialog.sh
# by Timm Thaler
#
# based on the ffmpeg-progress.sh from https://gist.github.com/pruperting/397509
# licensed under the GNU GENERAL PUBLIC LICENSE Version 3
#
# Dependencies / needed software
# ffmpeg (of course)
@arbal
arbal / Grub_Powerup.md
Created December 30, 2022 01:05 — forked from MaxLaumeister/Grub_Powerup.md
Grub Init Tune: Mario Bros. Mushroom Powerup

Grub Init Tune - Mario Bros. Mushroom Powerup

This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.

Here's the code, which goes in your /etc/default/grub file:

GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"

Installation Instructions

@arbal
arbal / ffmpeg-merge-two-videos.md
Created December 25, 2022 09:06 — forked from joshschmelzle/ffmpeg-merge-two-videos.md
Merging two video clips into one and placing them next to each other with ffmpeg

Taking two video clips, placing them side by side, combining 4 channels of audio into 2, and output.

ffmpeg -i video1.MP4 -i video2.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[v]; [0:a][1:a]amerge[a]" -map "[v]" -map "[a]" -ac 2 output.mp4

This was done with two filters and the audio from both inputs.

  • hstack places each video side-by-side.
  • amerge combines the audio from both inputs into a single, multi-channel audio stream, and -ac 2 will make it stereo (without this option the audio stream may end up as 4 channels if both inputs are stereo.)