- homebrew
- micromamba
- Chrome # manual install because brew version doesn't work with 1Password
- File-up
Set a host file.
Set a host file.
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": { | |
| "collapsed": false, | |
| "slideshow": { | |
| "slide_type": "skip" | |
| } |
| def isnote(cell): | |
| try: | |
| return cell['metadata']['slideshow'][u'slide_type'] == 'notes' | |
| except KeyError: | |
| return False | |
| with open('Presentation.ipynb') as json_data: | |
| data = json.load(json_data) | |
| data['cells'] = [cell for cell in data['cells'] if isnote(cell)] | |
| json.dump(data2, open('Presentation-notes.ipynb', 'w')) |
| # Assume we are in your home directory | |
| cd ~/ | |
| # Clone the repo from GitLab using the `--mirror` option | |
| $ git clone --mirror git@gitlab.kwant-project.org:r-j-skolasinski/discretizer.git | |
| # Change into newly created repo directory | |
| $ cd ~/discretizer.git | |
| # Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
| # Replace a line | |
| import os | |
| files = [f for f in os.listdir('.') if f.endswith('md')] | |
| for file in files: | |
| with open(file, 'r') as f: | |
| lines = f.readlines() | |
| with open(file, 'w') as f: |
| import httplib2 | |
| import os | |
| from apiclient import discovery | |
| import oauth2client | |
| import argparse | |
| import base64 | |
| from email.mime.text import MIMEText | |
| flags = argparse.ArgumentParser( | |
| parents=[oauth2client.tools.argparser]).parse_args() |
| #!/usr/bin/env python | |
| from collections import defaultdict, Counter | |
| import subprocess | |
| x = subprocess.check_output('qstat -ea'.split()) | |
| out = x.decode('utf-8').split('\n') | |
| cols = ['Job ID', 'Username', 'Queue', 'Jobname', 'SessID', 'NDS', 'TSK', | |
| 'Required Memory', 'Required Time', 'S', 'Elapsed Time'] |
| iptables -I OUTPUT -o tun+ -j ACCEPT | |
| iptables -I INPUT -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| iptables -I FORWARD -o tun+ -j ACCEPT | |
| iptables -I FORWARD -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| iptables -t nat -I POSTROUTING -o tun+ -j MASQUERADE |
| from datetime import datetime | |
| import socket | |
| from tornado import ioloop, options | |
| from tornado.log import app_log | |
| from ipyparallel import Client | |
| start_time = datetime.utcnow() | |
| class EngineCuller: | |
| """An object for culling idle IPython parallel engines.""" |