Skip to content

Instantly share code, notes, and snippets.

Ian Chesal ianchesal

View GitHub Profile
@ianchesal
ianchesal / bitbucket2github.sh
Created Jul 17, 2020
Convert a bitbucket repository to a github repository
View bitbucket2github.sh
#!/bin/sh
# Usage:
#
# cd ~/src/some-bitbucket-repo
# ~/bin/bitbucket2github.sh
#
# The script assumes the name of the directory is the name
# of the repository that you want to use on github.com.
@ianchesal
ianchesal / brew_list_versions.txt
Created Jul 26, 2019
Currently installed brew packages
View brew_list_versions.txt
❯ brew list --versions
adns 1.5.1
aom 1.0.0
autoconf 2.69
awscli 1.16.200
bash-completion 1.3_3
bat 0.11.0_1
cairo 1.16.0_2
exiftool 11.57
ffmpeg HEAD-2d900d8_1
@ianchesal
ianchesal / simpledesktops_download.py
Created Jul 8, 2011 — forked from compbrain/simpledesktops_download.py
Download simpledesktops.com wallpaper images
View simpledesktops_download.py
#!/usr/bin/python
__doc__ = """
simpledesktops_download.py
A quick script that fetches desktop images from the http://simpledesktops.com/ site.
It will start at the most current list of images and keep moving backwards, downloading
desktop images in to a directory on your local machine, until it finds an image that
already exists on disk. At that point it will stop.
@ianchesal
ianchesal / fstab
Last active Dec 27, 2015
fstab to keep my dead Main drive inside my '07 iMac from mounting at boot time and dragging the whole system down. I copy-and-pasted this from https://gist.github.com/threebytesfull/968327 because GitHub kept through a 500 error every time I'd try to clone that gist. Props to the original author of this solution.
View fstab
# Original gist: https://gist.github.com/threebytesfull/968327
#
# See also: http://apple.stackexchange.com/questions/17264/prevent-bootcamp-partition-from-automatically-mounting
#
# You can find the volume UUID in Disk Utility. Select the volume on the left
# and then File->Get Info. See "Universal Unique Identifier".
#
# Options used below:
# ro for readonly (can be omitted)
# noauto to prevent auto-mount
@ianchesal
ianchesal / dirsize.py
Created Sep 1, 2012
Figures out the total size of all the sub-directories under a directory
View dirsize.py
#!/bin/env python
__doc__ = '''
dirsize.py
Figure out the size of everything contained in all the sub-directories under a target
in some sort of parallel manner. Try and produce some output that's not as terrible
to grok as du.
@ianchesal
ianchesal / openfds.pl
Created Sep 1, 2012
Open File Descriptors per Process
View openfds.pl
#!/usr/bin/env perl
# Works on any system that supports a 'ps aux' call and the lsof
# command. Counts the number of open file descriptors for each
# process in the 'ps aux' output. Handy if you're trying to see
# which process is hanging on to the most FDs.
use strict;
printf("%-10s %-10s %s\n", 'PID', 'OPEN FDS', 'COMMAND');
@ianchesal
ianchesal / gist:3187966
Created Jul 27, 2012
Error trying to unloaded kext for track pd
View gist:3187966
MacBook-Pro:~ ian$ sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTrackpad.kext
(kernel) Can't unload kext com.apple.driver.AppleUSBTrackpad; classes have instances:
(kernel) Kext com.apple.driver.AppleUSBTrackpad class AppleUSBFnTrackpad has 1 instance.
(kernel) Kext com.apple.driver.AppleUSBTrackpad class AppleUSBGrIITrackpad has 1 instance.
(kernel) Kext com.apple.driver.AppleUSBTrackpad class AppleUSBGrIIITrackpad has 1 instance.
(kernel) Kext com.apple.driver.AppleUSBTrackpad class AppleUSBTrackpad has 1 instance.
Failed to unload com.apple.driver.AppleUSBTrackpad - (libkern/kext) kext is in use or retained (cannot unload).
@ianchesal
ianchesal / gist:2998601
Created Jun 26, 2012
AskDifferent Question #54791
View gist:2998601
> dig 54.247.29.171 any
; <<>> DiG 9.7.3-P3 <<>> 54.247.29.171 any
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27993
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;54.247.29.171. IN ANY
@ianchesal
ianchesal / gist:2288184
Created Apr 3, 2012
Calculate Winners for the Apple.SE iPad Contest
View gist:2288184
#!/usr/local/bin/python
import json
import subprocess
from pprint import pprint
import time
import sys
import operator
# The Level 3 Crowd
View gist:68fd7f9d5c7f1c5ff2e2
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
You can’t perform that action at this time.