Skip to content

Instantly share code, notes, and snippets.

View 1oglop1's full-sized avatar

Jan Gazda 1oglop1

  • Amsterdam
View GitHub Profile
@1oglop1
1oglop1 / dup.py
Created August 18, 2016 12:36
skill assesment
#!/usr/bin/python3
import filecmp as fcmp
import itertools as it
from pprint import pprint
import sys
import os
if 2 != len(sys.argv):
print("Usage: dup.py [FOLDER]")
exit()
#!/usr/bin/python3
import filecmp as fcmp
import itertools as it
from pprint import pprint
import sys
import os
if 2 != len(sys.argv):
print("Usage: dup.py [FOLDER]")
exit()
"""
Find duplicated files module
"""
import filecmp as fcmp
from pprint import pprint
import sys
import os
def args():
@1oglop1
1oglop1 / tensor.txt
Created February 16, 2018 18:20
tensor error
(anaserp) C:\Users\win10\serp>serpent train context 1
c:\users\win10\anaconda3\envs\anaserp\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Found 98 images belonging to 4 classes.
Found 14 images belonging to 4 classes.
2018-02-16 19:11:30.020571: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2018-02-16 19:11:30.264945: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1105] Found device 0 with properties:
name: GeForce GTX 760 major: 3 minor: 0 memoryClockRate(GHz): 1.0845
pciBusID: 0000:01:00.0
@1oglop1
1oglop1 / iam_json.py
Last active October 9, 2018 09:54
Convert AWS IAM Credential Report csv to JSON for elasticsearch ingestion.
"""
AWS IAM credential report produces csv with bit unusual values which
complicated ES ingestion.
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html
This simple script converts the 'null' values into correct form.
"""
import csv
import json
from dateutil.parser import parse
@1oglop1
1oglop1 / final_cfn_template.json
Last active February 18, 2019 07:33
Sceptre state machine definition resolver
{
"Outputs": {
"Arn": {
"Value": {
"Ref": "sfnname"
}
}
},
"Parameters": {
"RoleArn": {
@1oglop1
1oglop1 / get_cert_chain.py
Created October 5, 2019 08:02
Get fingerprints of certificates in certificate chain (python)
"""
https://stackoverflow.com/questions/19145097/
"""
import socket
from OpenSSL import SSL
import certifi
hostname='www.google.com'
port=443
@1oglop1
1oglop1 / now.json
Created October 24, 2019 12:59
how about Now.sh?
{
"version": 2,
"name": "my-python-project",
"builds": [
{ "src": "www/**/*", "use": "@now/static" },
{ "src": "api/**/*.py", "use": "@now/python" }
],
"routes": [
{
"src": "/",
@1oglop1
1oglop1 / log.txt
Created November 14, 2019 21:17
Zeit.co Now dbg
[debug] [2019-11-14T20:59:48.611Z] Found config in file ~/blog/pelican/blog/now.json
> [debug] [2019-11-14T20:59:48.617Z] Using Now CLI 16.5.2
> [debug] [2019-11-14T20:59:48.619Z] user supplied a possible target for deployment
> [debug] [2019-11-14T20:59:48.643Z] GET https://api.zeit.co/www/user
> [debug] [2019-11-14T21:00:24.470Z] GET https://api.zeit.co/www/user : 35825.794ms
> Deploying ~/blog/pelican/blog/public under 1oglop1
> Using project blog
[now-client-debug] 2019-11-14T21:00:24.491Z Creating deployment...
[now-client-debug] 2019-11-14T21:00:24.491Z Provided 'path' is a directory. Reading subpaths...
[now-client-debug] 2019-11-14T21:00:24.493Z Read 4 subpaths
@1oglop1
1oglop1 / now.json
Created November 14, 2019 21:19
Now config
{
"version": 2,
"name": "blog",
"builds": [
{
"src": "api/**/*.py",
"use": "@now/python"
},
{
"src": "www/**/*",