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 | |
""" | |
The attached utf-8 encoded text file contains the favorite musical artists of 1000 users from LastFM. Each line is a list of up to 50 artists, formatted as follows: | |
Radiohead,Pulp,Morrissey,Delays,Stereophonics,Blur,Suede,Sleeper,The La's,Super Furry Animals\n Band of Horses,Iggy Pop,The Velvet Underground,Radiohead,The Decemberists,Morrissey,Television\n | |
etc. | |
Write a program that, using this file as input, produces a list of pairs of artists which appear TOGETHER in at least fifty different lists. For example, in the above sample, Radiohead and Morrissey appear together twice, but every other pair appears only once. Your program should output the pair list to stdout in the same form as the input (eg Artist Name 1, Artist Name 2\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
;; force myself to use arrow keys so that I don't | |
;; mash the control key with my pinky 90% of the time I am using | |
;; emacs. | |
(defun save-the-pinky () | |
"Echo out message to echo area" | |
(interactive) | |
(message "Use the arrow keys!") | |
) | |
(global-set-key [(control n)] 'save-the-pinky) |
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
function highlight_status | |
{ | |
if [ "$1" -ne "0" ]; then | |
echo -e "\033[31;1m${1}\033[0m" | |
else | |
echo 0 | |
fi; | |
} | |
export PS1='[$(highlight_status $?)]\u@\h:\w\$ ' |
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
addr={{ pillar['shoe']['network'].addr }} |
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
postgresql: | |
service: | |
- running | |
packages: | |
pkg.installed: | |
- pkgs: | |
- libpq5 | |
- postgresql-client-9.2 |
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
# Lets verify!! | |
set pgp_verify_sig=yes | |
set pgp_autosign=yes | |
set pgp_timeout=32000 | |
# old style signing | |
# set pgp_create_traditional=yes | |
# decode application/pgp | |
set pgp_decode_command="/usr/local/bin/gpg %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" |
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
set_cmd_user: | |
cmd.run: | |
- name: env > /tmp/env | |
- user: git | |
- cwd: /home/git |
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
local@bm-allinone:~$ 2013-03-07 13:37:24,076 [salt.loaded.int.module.debconfmod][WARNING ] Package debconf-utils is not installed. | |
2013-03-07 13:37:24,379 [salt.loaded.int.module.debconfmod][WARNING ] Package debconf-utils is not installed. | |
2013-03-07 13:37:24,552 [salt.loaded.int.top.cobbler][ERROR ] Could not connect to cobbler. | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/salt/tops/cobbler.py", line 49, in top | |
data = server.get_blended_data(None, minion_id) | |
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__ | |
return self.__send(self.__name, args) | |
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request | |
verbose=self.__verbose |
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
local@bm-allinone:~$ cat /srv/salt/base/states/top.sls | |
base: | |
'roles:django': | |
- match: pillar | |
- django | |
local@bm-allinone:~$ sudo salt 'bm-console' pillar.data | |
2013-03-07 19:49:44,703 [salt.loaded.int.module.debconfmod][WARNING ] Package debconf-utils is not installed. | |
bm-console: | |
[...] | |
roles: |
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
local@bm-allinone:~$ sudo salt '*' test.ping | |
bm-d2: | |
True | |
2013-03-07 22:39:19,351 [salt.master ][ERROR ] An extra return was detected from minion bm-d2, please verify the minion, this could be a replay attack | |
local@bm-allinone:~$ sudo salt '*' state.highstate | |
bm-d2: | |
Data failed to compile: | |
---------- | |
The function "state.highstate" is running as PID 407 and was started at 2013, Mar 07 22:39:30.137480 | |
local@bm-allinone:~$ 2013-03-07 22:39:30,352 [salt.loaded.int.module.debconfmod][WARNING ] Package debconf-utils is not installed. |