I wrote about this before, but its important enough to write twice How to revoke write permissions to a directory How to revoke your own user permissions $ chmod u-w dirname How to delete all permissions from anyone on your system $ chmod a-w dirname removing write access on a file does not stop it from…
All posts by theptrk
why vim?
vim is vi(improved) vim is a powerful way that allows you to transform your thoughts into action in as little keystrokes as possible. In fact, the subtitle of the book Practical Vim is this: “Edit Text at the Speed of Thought” With that said, vim has a steep learning curve that often does not feel…
Intro to OSX File Management Commands
Filenames can have spaces! So when you deal with them either surround the filename with apostrophes like this: “my file name.txt” or escape the spaces my\ file\ name.txt. Otherwise, don’t create new file names with spaces or escape characters to keep your sanity. Wildcards * greedy wildcard ? single character wildcard [] single character list of wildcards {} pattern list of…
Intro to your OS X Filesystem and Permissions
How to find home note: as a user of the system you will be given a user directory under the Users directory $ echo $HOME How to go to the home directory choices: $ cd $HOME, $ cd ~, $ cd, and $ cd then drag your home directory from your Finder window How to go to the…
Setting up version controlled bash_profile
Sometimes your roommate spills water on your computer for a second time. Why would I upload .bash_profile to github? If you keep your config files uploaded to github, you can avoid having to recreate your dotfiles like .bash_profile every time you need to set up a new computer. For most people, setting up a new computer…
Setting up .vim directory
vim settings are important for every vim user and you shouldn’t have to use a vanilla vim setup just because you ssh into a VM or set up a new computer. Since most vim settings have zero personal data, the most convenient thing to do is to upload your vim directory+settings onto the internet for the world to bask…
Mac Unix Command Basics for Beginners
These are useful unix commands that are entered through a Terminal shell prompt. These commands are actually names of Unix programs that usually sit in a folder called /bin where am i? pwd How to check the current directory $ pwd learn more about anything – man How to bring up the manual page for a command:…
Top 10 bash_profile aliases
You are operating with limited time and limited brain power to finish your programs with enough time to go outside and breath fresh air Knowing this, its way too tedious to type out commands like git diff –cached which can be shortcut to gdc with an alias. An alias will allow you to create shortcuts with your own command…
git gotchas
Gotcha 1: git config? “Oops, I’ve been using git without setting my git config?” If youdon’t set your computers git config, it’ll likely choose a default email for you – something like Patrick@MacBookAir.com. That means, even if you push this to Github, your account will not get the commits. How to config your git author…
vim: how to turn on syntax highlighting
Normal mode How to turn on syntax highlighting for your current session :syntax on .vimrc configuration How to default syntax to “on” for all vim sessions Remember to always back up your config files, simply add this to your .vimrc syntax on Try different colors How to cycle through available color schemes for your current session…