Skip to content

Instantly share code, notes, and snippets.

View mr-sudaca's full-sized avatar

Jhon Quintero mr-sudaca

View GitHub Profile
@mr-sudaca
mr-sudaca / cleanup_swap.md
Created October 19, 2025 23:57 — forked from anildigital/cleanup_swap.md
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver 

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@mr-sudaca
mr-sudaca / git_upgrade.sh
Created March 16, 2017 18:37
git upgrade in centos
sudo yum -y groupinstall "Development Tools"
sudo yum -y install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
cd /tmp
git clone [email protected]:git/git.git
cd git
make .configure
./configure --prefix=/usr/local
@mr-sudaca
mr-sudaca / fixes.md
Last active March 28, 2016 11:18
some fixes (dev on mac)
byebug
  • CC=llvm-gcc [gem install byebug / bundle ]
therubyracer
  • brew tap homebrew/dupes
  • brew install apple-gcc42
  • export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
  • export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
  • export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
  • brew uninstall v8
Run scp to machine R, which is only accessible through gateway machine G.
Step 1: Establish SSH tunnel. Pick a temporary port between 1024 and 32768 (1234 in this example). Port 22 will be used by scp.
$ ssh -L 1234:<address of R known to G>:22 <user at G>@<address of G>
# Adding "cat -" will keep it running while above will get you connected to G
$ ssh -L 1234:<address of R known to G>:22 <user at G>@<address of G> cat -
Either way you run it, open another terminal for next step.
@mr-sudaca
mr-sudaca / Makefile
Created February 16, 2015 22:58 — forked from tonyseek/Makefile
monaco for powerline
PATCHED_FILENAME = "Monaco for Powerline.ttf"
$(PATCHED_FILENAME): Monaco.ttf fontpatcher.py fontpatcher-symbols.sfd
fontforge -script fontpatcher.py Monaco.ttf
@echo "(´・_・`) You can install the $(PATCHED_FILENAME) now."
Monaco.ttf: Monaco.dfont
fondu Monaco.dfont
rm *.bdf
@mr-sudaca
mr-sudaca / gist:6800022
Last active December 24, 2015 12:49
after_use
#!/usr/bin/env bash
after_use_hooks=($(
find "${rvm_path:-"$HOME/.rvm"}/hooks" -iname 'after_use_*' -type f
))
for after_use_hook in "${after_use_hooks[@]}"
do
if [[ -x "${after_use_hook}" ]]
then