This file contains hidden or 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
1. Install oh-my-zsh | |
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" | |
2. Clone necessary plugins. | |
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
3. Add plugins to ~/.zshrc as | |
plugins = ( [plugins...] zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting) |
This file contains hidden or 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
jaan@gonzo /> python | |
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58) | |
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import tensorflow as tf | |
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) | |
2017-08-11 16:49:07.472553: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. | |
2017-08-11 16:49:07.472591: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. | |
2017-08-11 16:49:07.472612: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. | |
2017-08-11 16:49:07.472628: W tensorflow/c |
This file contains hidden or 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 python | |
# Note, updated version of | |
# https://github.com/ipython/ipython-in-depth/blob/master/tools/nbmerge.py | |
""" | |
usage: | |
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb | |
""" | |
import io |
This file contains hidden or 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 os,re,pdb | |
## Get the repos | |
path='/var/lib/apt/lists/' | |
files=os.listdir(path) | |
release_files=[file for file in files if file.endswith('Release')] | |
origin_pattern=re.compile('Origin: (.*)\n') | |
suite_pattern=re.compile('Suite: (.*)\n') |
This file contains hidden or 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 twisted.internet.protocol import ClientFactory | |
import pdb,json | |
from twisted.protocols.basic import NetstringReceiver | |
from twisted.internet.defer import inlineCallbacks | |
from twisted.internet.threads import deferToThread | |
from Queue import Queue | |
# audio imports | |
import pyaudio,wave,threading | |
class AudioClient(NetstringReceiver): |
This file contains hidden or 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
Aim: associate each protocol with a username | |
Method right now: I make the client send it's username to server upon connecting in the connectionMade method. This is | |
thus, the first msg of the client. | |
The server differentiates this msg from client from rest by using flag unregistered in the class StrokeEcho, | |
Required approach: | |
Do this without the use of flag by appending something to the first msg the client sends while establishing | |
a connection with the server and then receive it the server end. I am assuming the client sends some data to | |
the server when I call connectTCP like it's IP-address etc. I want to modify that msg and receive at the | |
server end. |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from twisted.internet.protocol import Protocol, Factory | |
class StrokeEcho(Protocol): | |
def __init__(self, factory): | |
self.factory = factory | |
def connectionMade(self): | |
print "Connected client:",self | |
self.factory.echoers.append(self) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from twisted.internet.protocol import Protocol, Factory | |
class AudioEcho(Protocol): | |
def __init__(self, factory): | |
self.factory = factory | |
def connectionMade(self): | |
print "Connected client:",self | |
self.factory.echoers.append(self) |
This file contains hidden or 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 twisted.internet.protocol import Protocol, ClientFactory | |
import pdb | |
# audio imports | |
import pyaudio,wave | |
class AudioClientFactory(ClientFactory): | |
def __init__(self, canvas_obj): | |
self.canvas_obj = canvas_obj | |
def buildProtocol(self, addr): | |
return StrokeClient(self) |
This file contains hidden or 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 twisted.internet.protocol import DatagramProtocol | |
# Here's a UDP version of the simplest possible protocol | |
class AudioEchoUDP(DatagramProtocol): | |
echoers = [] | |
def startProtocol(self): | |
print "Audio server started" | |
def datagramReceived(self, datagram, address): | |
if address not in self.echoers: |
NewerOlder