Skip to content

Instantly share code, notes, and snippets.

View richardjortega's full-sized avatar

Richard Ortega richardjortega

View GitHub Profile
@richardjortega
richardjortega / psysh.md
Created March 18, 2014 16:33
PsySH Install

Install:

$ brew update && brew install composer
$ composer global require psy/psysh
# If asked what version constraint to use just type `*`

Update Your PATH for global CLI use:

@richardjortega
richardjortega / currency.php
Last active April 24, 2016 23:59
Psysh Install CodeUp
<?php
echo "Enter the amount in US dollars: $";
$money = read_stdin();
echo "What currency do you want to convert to? (E)uros, (P)esos, (B)ritish Pounds: ";
$currency = strtoupper(read_stdin());
$converted = convert($money, $currency);
@richardjortega
richardjortega / git_global_settings.md
Created April 11, 2014 16:29
Easy Git global settings to make your life easier

Set your name and email for your commit messages

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

Exclude git tracking UNIX file permissions: Unix file permissions modes (755=rwxrw_rw_, 644=rw_r__r__) - the old mode included the +x (executable) flag, the new mode doesn't. http://code.google.com/p/msysgit/issues/detail?id=164

@richardjortega
richardjortega / git_global_config.md
Last active August 29, 2015 13:59
EcoD Notes and Environment Setup

Set your name and email for your commit messages

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

Exclude git tracking UNIX file permissions: Unix file permissions modes (755=rwxrw_rw_, 644=rw_r__r__) - the old mode included the +x (executable) flag, the new mode doesn't. http://code.google.com/p/msysgit/issues/detail?id=164

@richardjortega
richardjortega / linux_commands.md
Created May 6, 2014 16:59
Linux Commands [Find big ass files, truncate those files]

Switch to logrotate later for better managability.

Find big ass files

$ cd /
# This command will find top 10 files based on disk usage
$ du -hsx * | sort -rh | head -10

Truncate big ass files to Zero

# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
require 'bindata'
class CustomProtocol < BinData::Record
endian :big
stringz :command_word
uint8 :op1
uint8 :op2
end
@richardjortega
richardjortega / cubox-i4pro-setup.md
Last active August 29, 2015 14:04
CuBox i4-Pro - Debian Wheezy (Serial Only) with Ruby 2.1.2, Rails 4.1.2, Expanded FS,Networking

This tutorial assists users of the CuBox i4-Pro (using Freescale's iMX6 SoC) stand up a stable, serial-only version (no desktop/GUI) of Debian Wheezy with working Networking (Ethernet and WiFi) with Ruby/Rails. Information collected from various forum posts, blog posts, etc. Attribution added where I could remember. Using a Windows 8.1 machine, please provide comments for update regarding Mac/Linux tutorial translations (for the most part it shouldn't matter except for how you write ISOs to microSD cards).

Note: Relatively new at this level of Linux usage, if there are better ways to do something please mention in comments so I can update

Download Debian Wheezy ISO image

Note: The password for root is cubox-i on this linked Debian image

  • Download Debian Wheezy (may be updated in future) ISO image from Gunnar Wolf (Debian Developer) at http://people.debian.org/~gwolf/. You can use 7-zip to unpack an XZ file.
  • Alternatively, se
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
# Steps from http://www.ireckon.net/2013/03/force-rgb-mode-in-mac-os-x-to-fix-the-picture-quality-of-an-external-monitor
# Steps... (make sure to have laptop lid closed and only one monitor hooked up)
# Step 1) $ ruby patch-edid.rb # This will create a new folder inside of the folder this file is ran in, needs to be moved to Step 2
# Step 2) A new folder will be created in your home directory. Move it into the “/System/Library/Displays/Overrides” folder. If Finder tells you that you are overwriting an existing folder, consider backing it up first.
# Step 3) Restart computer
require 'base64'

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname