Skip to content

Instantly share code, notes, and snippets.

View likethesky's full-sized avatar

Bradford Cottel likethesky

View GitHub Profile
@likethesky
likethesky / gist:3342081
Created August 13, 2012 15:48
Determining retina display manufacturer on rMBP
ioreg -lw0 | grep \"EDID\" | sed "/[^<]*</s///" | xxd -p -r | strings -6
Ripley: http://bit.ly/OGiSO8 (want manufacturer: 'SEC') also: http://bit.ly/Qea0kF
# If it outputs: LPxxx... then you have an LG, if: LSNxx... then you have a Samsung
# See: [DigiLloyd Burn-in follow-up](http://macperformanceguide.com/blog/2012/20120804_1-MacBookPro-Retina-screen-burn-in-followup.html) -and- [DigiLloyd MBPr Screen Burn-in] (http://macperformanceguide.com/blog/2012/20120703_2-MacBookPro-Retina-screen-burn-in.html)
# And (Apple Support thread): https://discussions.apple.com/thread/4034848?start=0&tstart=0
# Serial # links (to determine week of manufacture): http://www.macrumors.com/2010/04/16/apple-tweaks-serial-number-format-with-new-macbook-pro/ -and- http://www.chipmunk.nl/klantenservice/applemodel.html
@likethesky
likethesky / gist:3559639
Created August 31, 2012 21:50
Rebuild MBR partition on USB key
@likethesky
likethesky / gist:3559671
Last active December 28, 2020 20:44
find: Usage of Unix find command
find . -name '*lookingfor*' -print
-or-
find /path/you/want/to/start/in -name '*.rb' -print
-or-
# On OS X (searched indexed spotlight files, both user & system):
@likethesky
likethesky / gist:3559687
Created August 31, 2012 21:54
Extract a single file from .tar -- give it a name interactively
cpio -i -r *strict.lua < lua-5.1.4.tar.gz
@likethesky
likethesky / gist:3559735
Created August 31, 2012 21:58
Fix Ubuntu from command-line / recovery mode

So choose Recovery Mode, then login/exit to the command line, then:

mount -n -o remount,rw /

Above makes your hard drive read/write, which you'll need, in order to do the next step

sudo nano /etc/X11/xorg.conf

Use nano to edit your xorg.conf to fix it, ideally.

@likethesky
likethesky / gist:3829964
Created October 3, 2012 21:28
Setup fresh Sublime Text 2 on Ubuntu / Linux

Ubuntu / Linux install of Sublime Text

This will install and setup sublime (in /opt) and make it available via the 's' link (kept in /usr/local/bin)

Just type s on command line to open Sublime Text from then on!

First, (from a browser in your target Linux OS) go here: http://sublimetext.com (<-- click this link) and THEN right-click the <Download for Linux> button, and choose: Copy Link Location ... so you have the latest/greatest for your Linux OS.

Now in a terminal (ctrl-alt T, in Ubuntu), execute the following:

cd /opt

@likethesky
likethesky / gist:3836758
Created October 4, 2012 22:02
NetBeans 7.2 sample JavaFX app directory
brad@brad-macmini-ubuntu12-x64:~/NetBeansProjects/JavaFXApplication1$ ls -lAHtrR
.:
total 24
drwxrwxr-x 4 brad brad 4096 Oct 4 09:15 nbproject
drwxrwxr-x 3 brad brad 4096 Oct 4 09:15 src
-rw-rw-r-- 1 brad brad 82 Oct 4 09:15 manifest.mf
-rw-rw-r-- 1 brad brad 3474 Oct 4 09:17 build.xml
drwxrwxr-x 5 brad brad 4096 Oct 4 11:58 build
drwxrwxr-x 4 brad brad 4096 Oct 4 11:58 dist
@likethesky
likethesky / gist:3842609
Created October 5, 2012 21:46
Shutdown Ubuntu via terminal command

sudo shutdown -P now # completely shuts down and powers off machine (if hardware supports power off signal)

sudo shutdown now # shuts down, doesn't power off -- see http://askubuntu.com/a/73698/79523 for more details.

@likethesky
likethesky / index.html.haml
Created November 5, 2012 21:31
Cantango Demo -- goes in public/index.html of cantango_demo
%h1 Welcome to the CanTango Demo
%td= link_to("Home", root_path)
%td= link_to("Sign in", new_user_session_path)
%td= link_to("Sign up", new_user_registration_path)
%td= link_to("Sign out", destroy_user_session_path, :method => :delete)
%td= link_to("User forgot password", new_user_password_path)
%br
%br
%td= link_to("Admin home", admin_dashboard_path)
@likethesky
likethesky / gist:4262178
Created December 11, 2012 21:13
addressable gem dependency not bundled
My bundle aliases:
b = bundle
be = b exec
bi = b install --path vendor
bu = b update
bil = bi --local
binit = bi && b package --all && echo "vendor/ruby" >> .gitignore
# Note: my comments are in [#square brackets like this]