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
2016/12/04 20:06:22 [crit] 31075#31075: *1 connect() to unix:/home/foo/source/foo.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/home/foo/source/foo.sock:", host: "foo" |
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
def _myhost(args, stdin=None): | |
if args: | |
![ssh myhost @(args)] | |
else: | |
![ssh myhost -t 'tmux attach'] | |
aliases['myhost'] = _myhost |
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
SSH initialization failed, try again? | |
com.jcraft.JSchexception: Session.connect: java.io.IOException: End of IO Stream Read | |
--- | |
com.jcraft.JSchexception: Session.connect: java.io.IOException: End of IO Stream Read | |
at com.jcraft.jsch.Session.connect(Session.java:485) | |
at com.jcraft.jsch.Session.connect(Session.java:149) | |
[follows backtrace] |
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
<?php | |
return [ | |
/** | |
* Connection information used by the ORM to connect | |
* to your application's datastores. | |
* Do not use periods in database name - it may lead to error. | |
* See https://github.com/cakephp/cakephp/issues/6471 for details. | |
* Drivers include Mysql Postgres Sqlite Sqlserver | |
* See vendor\cakephp\cakephp\src\Database\Driver for complete list | |
*/ |
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
'Datasources' => [ | |
'sqlite' => [ | |
'datasource' => 'Database/Sqlite', | |
'persistent' => false, | |
'database' => 'app_db', | |
'prefix' => '', | |
'encoding' => 'utf8', | |
], |
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
charclass = None | |
while charclass not in classdict: | |
charclass = input("Select a class in (mage, warrior, rogue): ") |
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
~/Downloads> ipython3 test.py | |
#----------------------------------------------------------------------------- | |
# Load Factor Data | |
#----------------------------------------------------------------------------- | |
~/Downloads> |
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
def fizzbuzz_v1(number): | |
"Simpler solution" | |
if number % 3 == 0: | |
return "Fizz" | |
if number % 5 == 0: | |
return "Buzz" | |
if number % 15 == 0: |
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
# CheckIO mission https://py.checkio.org/mission/min-max/ | |
# Write python implementation of the built-in functions max | |
# | |
# max(iterable, *[, key]) | |
# max(arg1, arg2, *args[, key]) | |
def min(*args, **kwargs): | |
key = kwargs.get("key", lambda x: x) | |
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
"""Tries to solve https://gist.github.com/jhzab/38640e3df97eb4e25c9f360f87800f54 in a better way | |
example file at https://gist.github.com/jhzab/d5d4aeeb01ae4094035745a549b4ea14 | |
""" | |
import json | |
filename = 'example.json' | |
result = [] | |
with open(filename) as file: | |
for line in file: |