This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_traceback(e): | |
""" | |
Prints a formatted traceback of the given exception, including filename, line number, function name, code line, | |
and local variables for each frame in the traceback stack. | |
Args: | |
e (Exception): The exception object for which the traceback should be printed. | |
Returns: | |
None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<script src="https://rawgit.com/lmcnulty4/d3dragSelector/master/dragSelector.js"></script> | |
<style> | |
.selector { | |
fill: blue; | |
fill-opacity: 0.3; | |
stroke: blue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import json | |
def dateconverter(o): | |
if isinstance(o, datetime.datetime): | |
return o.__str__() | |
def json_dumps(data): | |
return json.dumps(data, default=dateconverter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%javascript | |
IPython.notebook.kernel.execute('nb_name = "' + IPython.notebook.notebook_name + '".replace(".ipynb", "")') | |
--- | |
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; </style>")) | |
%matplotlib inline | |
from matplotlib import pyplot as plt | |
%pylab inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function json_double_escape () { | |
printf '%s' "$1"|python -c 'import json,sys,re; print(re.subn(r"\\", r"\\\\", json.dumps(sys.stdin.read(), ensure_ascii=False))[0])' | |
} | |
function command_exec_handler() { | |
STARTTIME=$(date --iso-8601=seconds) | |
SECONDS=0 | |
eval $1; | |
EXIT_VALUE="$?" | |
CMD=$(json_double_escape $1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat bin/backups.sh | |
#!/usr/bin/env bash | |
# sudo apt-get install rdiff-backup | |
BACKUPS="$HOME/backups" | |
rdiff-backup --exclude $BACKUPS \ | |
--exclude $HOME/VirtualBox\ VMs \ | |
--exclude $HOME/Downloads \ | |
$HOME $BACKUPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) | |
%pylab inline | |
pylab.rcParams['figure.figsize'] = (20, 16) | |
from collections import Counter | |
from glob import glob | |
from datetime import datetime, timedelta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
N=30 | |
DRYRUN=false | |
WORKDIR=/home/lasse/Desktop | |
HISTORY=__HISTORY | |
HISTORY_DIR=$WORKDIR/$HISTORY/$(date +%Y%m%d) | |
if [ "$1" != "" ]; then N=$1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
!pip install matplotlib scipy numpy keras python_speech_features | |
""" | |
import scipy | |
import scipy.io.wavfile | |
from python_speech_features import mfcc | |
from matplotlib import pyplot as plt | |
import numpy as np | |
from keras.layers import Dense, Input, CuDNNLSTM, TimeDistributed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xerox Phaser 6010N | |
Xerox Phaser 6010N on Ubuntu 64bit 16.04, 18.04 and 20.04 | |
```bash | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 libcupsimage2:i386 | |
# Download the [.DEB driver](https://www.support.xerox.com/support/phaser-6010/downloads/enus.html?operatingSystem=linux&fileLanguage=en) that Xerox supplies. |
NewerOlder