Skip to content

Instantly share code, notes, and snippets.

@motleytech
motleytech / osx_vm.md
Created June 25, 2016 05:36
osx vm on osx

Recently, I tried creating an OSX Virtualbox VM on my macbook. Creating a virtualbox VM should be easy, I guessed, as I am just looking to run an OSX guest on an OSX host. Not trying to create a hackintosh here.

However, it turned out to be more tricky than I anticipated. For starters, I needed a bootable iso of the OSX operating system, but Apple does not provide one anymore. So this is what I had to do...

I searched around on google and ran into many useless pages. Finally, I found one that had a useful solution.

I replicate the instructions here, in case that website goes missing.

Step by step instructions

Look for Install OSX Yosemite.app in your /Applications folder. If its already there, you can save on a large download.

@motleytech
motleytech / ls_colors.md
Created June 25, 2016 05:35
ls colors and shortcuts

If you are missing colors in the terminal / console, (and the 'l' shortcut command) here is how to fix that.

Open your ~/.bashrc file in an editor

vim ~/.bashrc

and add the following at the bottom

@motleytech
motleytech / git_shortcuts.md
Created June 25, 2016 05:33
git shortcuts and aliases

Here are some useful git config options for

  1. Displaying colors in status and diff outputs.
  2. Creating aliases and shortcuts for common git commands.
  3. Setting shortcuts from the command line itself.

First, create a ~/.gitconfig file for your user account, which will store the changes we are about to make.

touch ~/.gitconfig
@motleytech
motleytech / fix_scrollbar.md
Created June 25, 2016 05:31
Fix ubuntu scrollbars
sudo apt-get remove overlay-scrollbar
sudo apt-get remove liboverlay-scrollbar-0.2-0
sudo apt-get remove liboverlay-scrollbar3-0.2-0
@motleytech
motleytech / ubuntu_share.md
Created June 25, 2016 05:29
access ubuntu samba share

Often, my work involves sharing a folder in my Ubuntu vm to access it from the host machine, and every once in a while, samba refuses to play ball (Samba is the one who is in charge of sharing folders).

Here is how to fix the problem. After enabling the share in the folder properties (keeping guest access off), we will have to give explicit permissions for a user to access the shared folder.

Suppose your username on ubuntu is testuser. Type the following commands to give access to the test user...

$ useradd -N -M -g sambashare testuser

$ smbpasswd -a testuser
@motleytech
motleytech / utils_osx_emulation.ahk
Last active June 23, 2016 21:07
os x key emulation in windows
; Show on all desktops and Always on top shortcuts for windows
WS_EX_TOOLWINDOW := 0x00000080
+MButton::WinSet, ExStyle, ^%WS_EX_TOOLWINDOW%, A
^MButton::WinSet, AlwaysOnTop, toggle, A
; osx key emulation
#Right::send {End}
#Left::send {Home}
#+Right::send {LShift down}{End}{LShift up}
#+Left::send {LShift down}{Home}{LShift up}
@motleytech
motleytech / casper.md
Created June 21, 2016 01:00
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
@motleytech
motleytech / delete last git commit
Created June 12, 2016 01:21
delete last git commit locally and remote
git reset HEAD^ # remove last local commit
git push origin +HEAD # update remote
git push origin +HEAD^ # only delete last commit on remote... keep local as it is.
@motleytech
motleytech / nginx conf for static files
Last active June 11, 2016 06:45
motleytech nginx conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
Host motleytech
Hostname motleytech.net
IdentityFile ~/.ssh/id_rsa_mt
Host github
Hostname github.com
IdentityFile ~/.ssh/id_rsa