Skip to content

Instantly share code, notes, and snippets.

View chrismattmann's full-sized avatar

Chris Mattmann chrismattmann

View GitHub Profile
@chrismattmann
chrismattmann / git_remember_password.md
Created March 24, 2019 04:29 — forked from ankurk91/git_remember_password.md
Git credential cache, why type password again and again

Git tip: Tired of entering password again and again ?

Run this command to remember your password:

git config --global credential.helper 'cache --timeout 28800'

Above command will tell git to cache your password for 8 hours.

@chrismattmann
chrismattmann / facebook-contact-info-summary.rb
Created March 31, 2018 01:09 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@devhero
devhero / py_remote_extract_tar_gzip.py
Last active May 24, 2023 18:50
python download and extract remote file tar.gzip
# Instruct the interpreter to create a network request and create an object representing the request state. This can be done using the urllib module.
import urllib.request
import tarfile
thetarfile = "http://file.tar.gz"
ftpstream = urllib.request.urlopen(thetarfile)
thetarfile = tarfile.open(fileobj=ftpstream, mode="r|gz")
thetarfile.extractall()
# The ftpstream object is a file-like that represents the connection to the ftp server. Then the tarfile module can access this stream. Since we do not pass the filename, we have to specify the compression in the mode parameter.
@chrismattmann
chrismattmann / gist:3ca50b1e598a43bb46830c5c6438af35
Created August 4, 2017 17:21 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@chrismattmann
chrismattmann / gist:208bd08acdfe85d20dcde5d70c1a8906
Created March 6, 2017 00:50
Count how many times Russia pops up in an online URL
$ ./countRussia.py
countRussia.py -u <url>
$ ./countRussia.py -u http://www.nbcnews.com/meet-the-press/meet-press-03-05-17-n729271
2017-03-05 16:47:09,232 [MainThread ] [INFO ] Retrieving http://www.nbcnews.com/meet-the-press/meet-press-03-05-17-n729271 to /var/folders/n5/1d_k3z4s2293q8ntx_n8sw54mm5n_8/T/meet-press-03-05-17-n729271.
Total mentions of Russia: 55
FROM girder/girder
RUN mkdir /assetstore
RUN git clone https://github.com/memex-explorer/image_space.git
RUN girder-install plugin -s image_space/imagespace
RUN girder-install plugin -s image_space/imagespace_smqtk
RUN npm install --only=prod --unsafe-perm
@andrewfhart
andrewfhart / gist:72f0e0ce0c54b76d0bf4
Created February 12, 2016 18:59
Basic Balance application installation with Profile module
# The following instructions outline the process for getting
# Apache OODT Balance up and running on a new machine,
# including installing the "profile" module.
#
# Full docs / source @ https://github.com/apache/oodt/tree/master/balance/etc/skel
#
#
# Get required PEAR classes installed on your system
(sudo) pear channel-discover pear.apache.org/oodt
(sudo) pear remote-list -c oodt
@ankurk91
ankurk91 / git_remember_password.md
Last active May 17, 2024 03:46
Git credential cache, why type password again and again

Tired of entering password again and again ?

Run this command to remember your password:

git config --global credential.helper 'cache --timeout 28800'

Above command will tell git to cache your password for 8 hours.

@rochacbruno
rochacbruno / ACCESS_ELASTIC.md
Last active May 3, 2024 19:15
Docker-compose wait-to-start

When unsing docker compose you can have a problem with the order of dependent linked containers

The solution is to start a script which tries to access a service and waits until it gets ready before loading your program