Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@aculich
aculich / how-many-files.sh
Created August 17, 2016 21:02
quick way to count up files of different sizes
#!/bin/bash
cd /path/to/files
find . -type f | wc -l
find . -type f -size +1M | wc -l
find . -type f -size +10M | wc -l
find . -type f -size +1G | wc -l
find . -type f -size +10G | wc -l
@aculich
aculich / gmailaccount.py
Created February 25, 2017 02:32 — forked from tyleha/gmailaccount.py
A simple IMAP manager class for Gmail
from imaplib import IMAP4_SSL
import email as em
from email.utils import parsedate, parsedate_tz
from email.parser import HeaderParser
class GmailAccount(object):
def __init__(self, username=None, password=None, folder=None):
self.username = username
self.password = password
self.folder = folder
@aculich
aculich / jupyter_notebook_config.py
Last active September 11, 2018 03:17 — forked from masnick/jupyter_notebook_config.py
jupyter notebook script_post_save
# Based off of https://github.com/jupyter/notebook/blob/master/docs/source/extending/savehooks.rst
import io
import os
from notebook.utils import to_api_path
_script_exporter = None
_html_exporter = None
def script_post_save(model, os_path, contents_manager, **kwargs):
@aculich
aculich / timestamp-formats.py
Created March 11, 2017 17:12
reference for most commonly requested bash timestamps
#! /bin/bash
## Taken from:
## https://zxq9.com/archives/795
# reference for most commonly requested bash timestamps
cat << EOD
Format/result | Command | Output
------------------------------+----------------------------+------------------------------
@aculich
aculich / atom-commands.md
Created March 29, 2017 17:51 — forked from stigok/atom-commands.md
List of key bindable Atom commands

Atom Commands

Application

application:about
application:show-preferences
application:show-settings
application:quit
application:hide

application:hide-other-applications

@aculich
aculich / gist:1edc31f28444c0a7b6f1d422d6cdf676
Created May 18, 2017 04:05 — forked from mayoff/gist:1138816
AppleScript to make Google Chrome open/reload a URL
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *)
tell application "Google Chrome"
activate
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
if (count every window) = 0 then
make new window
end if
set found to false
@aculich
aculich / screen-tmp-permission-denied.md
Last active August 31, 2017 18:26
screen tmp dir permission denied on BRC Savio SL7 test node
[aculich@sl7 ~]$ screen
Cannot make directory '/var/run/screen': Permission denied
[aculich@sl7 ~]$ ls -lad /var/run/screen
ls: cannot access /var/run/screen: No such file or directory
[aculich@sl7 ~]$ ls -lad /var/run/
drwxr-xr-x 21 root root 800 Aug 25 16:05 /var/run/
@aculich
aculich / aminer-jq-example.bash
Last active November 1, 2017 21:54
example of using jq to extract journals from the AMiner Open Academic Graph: https://aminer.org/open-academic-graph
#!/bin/bash
## example of using jq to extract journals from
## the AMiner Open Academic Graph:
## https://aminer.org/open-academic-graph
wget https://academicgraphv1wu.blob.core.windows.net/aminer/aminer_papers_0.zip
unzip -p aminer_papers_0.zip aminer_papers_0.txt > aminer_papers_0.txt
jq . aminer_papers_0.txt -C | less -r
jq .venue aminer_papers_0.txt -C | wc -l
@aculich
aculich / ansible-summary.md
Created November 7, 2017 15:11 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names