Skip to content

Instantly share code, notes, and snippets.

View allolex's full-sized avatar
🏠
Working from home

Damon Davison allolex

🏠
Working from home
View GitHub Profile
@allolex
allolex / install_asdf_rust_jetbrains_clion_2022_in_2023.md
Last active November 12, 2023 18:33
asdf, rust, and the JetBrains CLion IDE

asdf, rust, and JetBrains CLion IDE.

JetBrains has a new Rust IDE, but I don't want to pay for the license, so I am using a fallback version of CLion. That means my IDE is vintage 2022.

  1. Install rust using asdf in the usual way.
    • asdf install rust latest
    • That's currently 1.7.3 for me right now.
  2. After you have done that, set .tool-versions with that version:
    • asdf local rust latest
  3. Install the rust standard library:
@allolex
allolex / find_attackers.pl
Last active February 20, 2020 18:13
Script to scour Apache logs for IP's performing brute-force password attacks on WordPress sites
#!/usr/bin/env perl
use strict;
use warnings;
my %config = (
'limit' => 20000,
'name' => '/var/log/apache2/blog.access.log'
);
my $lines = get_lines(\%config);
@allolex
allolex / damons_mutt_configuration.md
Last active August 30, 2018 12:16
Mutt with multiple IMAP (Google Mail) accounts in the cloud. This is how I have my mutt installation set up and configured. I primarily use Google products for my mail these days, so the config here should be just fine for that. The principle shown here holds true for all mail accounts.

Mutt for multiple email accounts

This is an OS X-centric configuration.

My setup and configuration for Gmail/Google Apps

The idea here is to use environment variables, loaded via aliases to mutt, to control which account you're loading. Years ago I had all of my accounts configured to be accessible from a single mutt

@allolex
allolex / pr.md
Created May 9, 2016 16:37 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@allolex
allolex / web-servers.md
Last active December 19, 2015 07:19 — forked from willurd/web-servers.md
Make copy and pastable without shell prompts

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

python -m SimpleHTTPServer 8000
@allolex
allolex / gist:5546591
Created May 9, 2013 09:42
Where's my vodka?
POST http://crystalheadvodka.com/site/where_map_ajax 404 (Not Found) jquery.min.js:140
c.extend.ajax jquery.min.js:140
onsubmit
@allolex
allolex / mobile_dev_choices.md
Created December 16, 2015 19:22
Mobile development frameworks, write once and target many devices
@allolex
allolex / gist:4564357
Last active December 11, 2015 07:09
Improved code for snapping photos when committing to a git repo
#!/bin/bash
function make_image_dir () {
TARGET_DIR=$1
if [ ! -d "${TARGET_DIR}" ]; then
mkdir "${TARGET_DIR}"
fi
}
function ignore_image_dir () {