Skip to content

Instantly share code, notes, and snippets.

View rkmax's full-sized avatar

Julian Reyes Escrigas rkmax

View GitHub Profile
#!/usr/bin/env bash
set -e
target_osx=$(sw_vers -productVersion)
project_dir=/Users/rkmax/development/aseprite
skia_dir=/Users/rkmax/development/skia
arch="$(uname -m)"
bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg
@rkmax
rkmax / migrate_from_exist_hitory.sh
Created January 27, 2024 21:03 — forked from exdeniz/migrate_from_exist_hitory.sh
Remove Duplicate zsh History
cat -n .zsh_history | sort -t ';' -uk2 | sort -nk1 | cut -f2- > .zhistory
@rkmax
rkmax / omnivore.sh
Created January 25, 2024 18:41
Helper script to save a URL to Omnivore.app
#!/usr/bin/env bash
#
# Helper script to save a URL to Omnivore
#
set -e
if [ -f $HOME/.omnivore ]; then
source $HOME/.omnivore
fi
@rkmax
rkmax / ssh-tunnel-cheat-sheet.md
Created May 2, 2017 20:56 — forked from jkullick/ssh-tunnel-cheat-sheet.md
SSH Tunnel Cheat Sheet
# $LOCAL_IP: 'localhost' or machine from local network
# $LOCAL_PORT: open port on local machine
# $REMOTE_IP: remote localhost or IP from remote network
# $REMOTE_PORT: open port on remote site

# Forward Tunnel: map port from remote machine/network on local machine
ssh -L $LOCAL_PORT:$REMOTE_IP:$REMOTE_PORT $USER@$SERVER

# Reverse Tunnel: make local port accessable to remote machine
#!/usr/bin/env python
import subprocess
import sys
SCREEN_LAYOUT = {
'horizontal': {
'full-size': '0,0,{width},{height}',
'half-left': '0,0,{width}/2,{height}',
'half-right': '{width}/2,0,{width}/2,{height}',
Coverage Badges
@rkmax
rkmax / camera-zoom.sh
Created December 1, 2022 17:21
this script uses v4l2-ctl to set the zoom level of a webcam
#!/usr/bin/env bash
#
# this script uses v4l2-ctl to set the zoom level of a webcam
#
set -e
# you may have multiple cameras but usual video0 is the right one
camera=/dev/video0
@rkmax
rkmax / enable-remote.sh
Created November 18, 2014 23:50
Setup a virtual screen for connect from VNC viewer (example VNC VIwer Android)
#!/bin/bash
WIDTH=1280
HEIGHT=800
x11_cmd=x11vnc
if [[ ! -z $(pgrep ${x11_cmd}) ]]; then
pkill ${x11_cmd}
fi
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev
function latest_version() {
curl -sL https://api.github.com/repos/creationix/nvm/releases/latest \
| grep 'tag_name' \
| cut -d '"' -f 4
}
@rkmax
rkmax / update-wordpress-domain.sql
Created August 23, 2019 19:33
Safe domain transition for wordpress
set @old_domain = '';
set @new_domain = '';
-- Update post
UPDATE wp_posts
SET guid = replace(guid, @old_domain, @new_domain),
post_content = replace(post_content, @old_domain, @new_domain);
UPDATE wp_postmeta
SET meta_value = replace(meta_value, @old_domain, @new_domain);