The nixos.org website suggests to use:
sh <(curl -L https://nixos.org/nix/install)For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volumeThe nixos.org website suggests to use:
sh <(curl -L https://nixos.org/nix/install)For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volumeI am a big fan of the syntastic package. In python, it is useful for viewing both Pyflakes and Bandit errors. However, this only works if syntastic knows what python interpreter to use. Not everyone is fortunate enough to have upgraded all of their software to python3. For reasons out of my control, I end up spending most of my time writing python2 code. This means that the times when I finally get to write python3, all of my syntax checking is broken. How cool would it be to have VIM determine what version of python to use automatically? So, begins my grand experiment...
For this to work, I will be using a virtualenv for python2 and one for python3. It's not absolutely necessary to use virtualenvs but I definitely recommend it. Setting up virtualenvs is out of the scope of this gist but make sure that each virtualenv
To continue my series of vim pre-write hooks, I wanted to add a new check for security static analysis failures. To see the progression of the series, please check out my other gists.
Back to security... In my office, we use OpenStack's Bandit static analysis tool. If you're not familiar with it, you should check it out. It's pretty nifty.
| # 0. Add this function to ~/.bashrc. | |
| # On a mac, install coreutils first and add this function to your ~/.bash_profile. | |
| # 1. Make a shorter symlink pointing to the long golang directory name | |
| # ln -s ~/go/src/github.com/foo/bar ~/foobar | |
| # 2. goto foobar | |
| goto() { | |
| cd `realpath ~/$1` | |
| } |
I ran into this issue while at work and came up with this solution. This gist is mostly just documentation for myself so I can remember what I did 6 months from now. I am in no way saying that this is the right way to fix things but I'll be thrilled if this is in any way helpful to others. That being said, I make no guarantees that bad things will not happen to your machine if you follow these directions. Proceed at your own risk.
Although, I mention using the following setup to resolve an issue I was having using xmonad as my windows manager, I don't think there's anything special about it. It should be possible to use the following steps with any windows manager.
Setting up multiple monitors in xmonad requires defining the screen configuration using xrandr. The problem is that xmonad does not respond to a laptop being placed or removed from a docking station. Obviously, the solution is to update the monitor configuration on the
| import time | |
| from boto.ec2.autoscale import AutoScaleConnection | |
| def find_unused_launch_configs(): | |
| conn = AutoScaleConnection() | |
| autoscale_groups = conn.get_all_groups(max_records=100) | |
| launch_configs = conn.get_all_launch_configurations(max_records=100) | |
| launch_config_names = {lc.name for lc in launch_configs} |
| # coding: utf-8 | |
| # # this is an ipython notebook | |
| # | |
| # This is a markdown block that I can use to describe whatever I want to talk about. | |
| # In[1]: | |
| POSTGRES_URI = "postgresql+psycopg2://localhost:5432/steder" |
| docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!