Skip to content
View good_code.py
class CustomerPortal(LoginRequiredMixin, UserPassesTestMixin, DetailView):
model = Customer
template_name = 'bod/customer_portal.html'
def test_func(self):
user_pk = int(self.kwargs['pk'])
user = self.request.user
is_customer = user.groups.filter(name='Customer').exists()
return is_customer and user.pk == user_pk
View gist:b6f68dc9362b9bc21f47
Not creating home directory `/var/lib/rabbitmq'.
* Starting message broker rabbitmq-server [ OK ]
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb (1:2.4.9-1ubuntu2) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Initializing mongodb...
MongoDB already running
Initializing default configuration...
node version not match. Please use node v4.1
sed: can't read /home/pac/Desktop/Release-v3.0/etc/woogeen_config.js: No such file or directory
View start-all.sh
pac@ubuntu:~/Desktop/Release-v3.0$ bin/start-all.sh
starting nuve, stdout -> /home/pac/Desktop/Release-v3.0/logs/woogeen-nuve.stdout
9129
9136
2016-02-01 18:33:42.252 - INFO: RPC - Conected to rabbitMQ server
2016-02-01 18:33:42.258 - INFO: RPC - Exchange rpcExchange is open
2016-02-01 18:33:42.263 - INFO: RPC - Queue nuveQueue is open
2016-02-01 18:33:42.267 - INFO: RPC - ClientQueue amq.gen-ej0Pt1aFNY9uI-3kB1cbXg is open
starting mcu, stdout -> /home/pac/Desktop/Release-v3.0/logs/woogeen-mcu.stdout
2016-02-01 18:33:47.777 - INFO: AMQPER - Exchange rpcExchange is open
View movie_titles.py
# Assuming that we are in the directory with movie files
movie_tiles = [movie_title.replace('The ', '') for movie_title in listdir()]
outfile = open('/Users/Pac/Desktop/movies.txt', 'w')
outfile.write('\n'.join(movie_titles)
outfile.close()
View file.sh
pac@ubuntu-desktop:~/Code⟫ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
pac@ubuntu-desktop:~/Code⟫ echo "deb http://ubuntu.kurento.org trusty-dev kms6" | sudo tee /etc/apt/sources.list.d/kurento-dev.list
deb http://ubuntu.kurento.org trusty-dev kms6
pac@ubuntu-desktop:~/Code⟫ wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
--2016-01-31 12:39:00-- http://ubuntu.kurento.org/kurento.gpg.key
View gist:b0b1ba2ff0fce9df8584
# Given this input...
data = '''
undo traffic-policy inbound # regular statement
<% # command
module: create-variable
name: 'display blah'
%>
View gist:286b5110e646e9387b11
# Input:
data = '''
undo traffic-policy inbound # regular statement
<% # command
module: create-variable
name: 'display blah'
%>
View gist:8ccfc920a1acf92b5957
libdc1394 error: Failed to initialize libdc1394
(kurento-media-server:44289): GStreamer-CRITICAL **: gst_pad_get_direction: assertion 'GST_IS_PAD (pad)' failed
(kurento-media-server:44289): GStreamer-CRITICAL **: Removing pad without direction???
(kurento-media-server:44289): GStreamer-CRITICAL **: gst_object_unparent: assertion 'GST_IS_OBJECT (object)' failed
(kurento-media-server:44289): GStreamer-CRITICAL **: gst_pad_get_direction: assertion 'GST_IS_PAD (pad)' failed
View gist:f1fcf672f5c7126ceca2
>>> undo traffic-policy inbound
>>> quit
>>> <%
>>> module: create-variable
>>> name: traffic_policy_name,
>>> %>
>>> a statement
>>> <% module: assert
>>> another-key: blah
>>> haha: "display blah" %>
View gist:9388e156bb4f40a16bc8
>>> undo traffic-policy inbound
>>> quit
cmd: ['module:', 'create-variable', 'name:', 'traffic_policy_name,']
>>> a statement
cmd: ['module:', 'assert', 'another-key:', 'blah', 'haha:', '"display blah"']
>>> just another statement
Something went wrong with that request. Please try again.