Showing posts with label OSX. Show all posts
Showing posts with label OSX. Show all posts

Friday, January 19, 2018

Remap Right Shift To Up Arrow OSX

The up arrow on the new 2017 Macbook pros are stupid small and very difficult to accurately hit. This can be extremely annoying when in a terminal and you need to hit "up" several times to go through your history.

Unfortunately there is no builtin way to modify the right shift key and map it to arbitrary keys. Fortunately, however, there is an app call "Karabiner" that grants you this functionality at an OS level. Meaning, it's not application specific.

The process is incredibly simple:

  1. Download Karabiner
  2. Go to the "Simple Modifications" tab
  3. Click "Add Item"
  4. From Key: right_shift, To Key: up_arrow as seen below:

Enjoy!

Saturday, January 26, 2013

Rant: OSX Find Clipboard - Invokes Baby Punching

OSX has multiple clipboards that allow you to do fairly user friendly actions such as drag and drop various files, fonts, text, etc. Among these clipboards is the global "Find Pasteboard". This has been by far the stupidest and more shortsighted idea i have ever seen implemented by apple.

At first it seems like a great idea, select text somewhere, hit cmd+e and search for it in a completely separate application just by hitting cmd+g. I'm sure certain people find that very useful. But there is a problem with this. A problem that makes me want to punch babies.

For example:
if you search for text in chrome on a webpage, and you switch to sublime text 2 to search for something in your code, it automatically inputs the text that you typed into chrome, into the sublime "find" box. ok...thats odd, i'll just backspace and start typing my search. Ah damn, i forgot the syntax to that one perl regex. When you switch back to chrome to search the page, IT COMPLETELY WIPES OUT/REPLACES YOUR SEARCH IN SUBLIME. so that big long regex i was typing in sublime? gone. Thanks apple, your "feature" wiped out the last 30 minutes of research i was doing.

oh.my.god. this is the type of thing that creates serial killers.

The absolute worst part about all of it, the part where apple's arrogance and unbelievable big head ruins everything, is in the fact that THERE IS NO WAY TO DISABLE IT. AT ALL. ZILCH. NADA. They simply say that "this is intended behavior" which is the equivalent of them giving you the finger and saying "deal with it".

The entire idea of the find clipboard itself is stupid. It's a feature thats hardly known, and much more likely to cause frustration and issues than the problems it solves. The probability that you need to search for two different strings in different applications is obscenely higher than the few situations in which you want to search text from one app in another.

I'm not saying take this feature out, as i'm sure someone might be using it, i'm simply asking for a way to disable it.

This issue is more evidence of what i believe to be apple's worst quality, the arrogance of their imposed "user experience" on the consumer. I'm done with apple, this issue is on top of the dozens of other things that have driven me mad by them. I'm doing back to linux. At least then i have %100 control over my computer.

Monday, November 19, 2012

OSX Trash Bin Wont Empty

They mountain lion update for me has made my mac much worse. One of the issues i've found is that the trash bin wont finish emptying for some ungodly reason. It will just sit there, saying it has to delete like 2000 items and it will just never finish. Well, luckily there is an easy way to do it manually.

A user's trash bin is stored in their home directory, under "~/.Trash". All you have to do is go into that directory and just 'rm -rf' everything there. Or if you are paranoid about the hard drive sectors, you can always do a 'rm -rfP' which will overwrite the files 3 times before releasing the sections as free.

TL;DR

rm -rfP ~/.Trash/*

Wednesday, October 17, 2012

OSX Alert Boxes

Found this on a stackoverflow post, apparently running the following line pops up a box with the specified text:
osascript -e 'tell app "System Events" to display dialog "ZOMGLULZ"'

Monday, October 8, 2012

Generate NTLM hashes via command line

Turns out the NTLM hashing algo is super simple. It just takes the string you give it, converts it to UTF-16LE and then outputs the md4 of that. You can generate your own fairly simply at the command line:

iconv -f ASCII -t UTF-16LE <(printf "lolwut") | openssl dgst -md4
What this does is use a fairly popular unix utility "iconv". -f is the "from" encoding, which is this case is just simple ASCII and sets to "to" encoding using -t. It reads in the string using printf and pipes that to openssl for the digest. the result is the NT hash of the string (or password if you want to look at it like that) "lolwut"

$iconv -f ASCII -t UTF-16LE <(printf "lolwut") | openssl dgst -md4
dcc1ed89d1d080ef47dccf3e59a50d45
create a function and place it in .bashrc:
ntlm_hash () {
iconv -f ASCII -t UTF-16LE <(printf "$1") | openssl dgst -md4
}
now just type "ntlm_hash lolwut" to get the same result.

Wednesday, June 27, 2012

Sublime 2 command line starter

Textmate simply needed you to type "mate file1" to open file1 in the textmate gui.

Sublime 2 doest have that. well thats stupid. so I made my own:

alias sublime='open -a "/Applications/Sublime Text 2.app"'

now just type "sublime file1" and it will start the file in the gui, just like textmate.

Updating metasploit in brew

Straight from brew when you first install metasploit:


Metasploit can be updated in-place by doing:
  cd `brew --prefix metasploit`/libexec/
  svn up