In general, AWS services can be accessed using
- AWS web interface,
- API libraries in a programming language, such as
boto3
for Python 3, - AWS command-line interface, i.e.
awscli
.
I opted for the API library since it is
import multiprocessing | |
import multiprocessing.managers | |
import os | |
import sys | |
from typing import AnyStr, Union | |
class QueueManager(multiprocessing.managers.BaseManager): | |
def get_queue(self, ident: Union[AnyStr, int, type(None)] = None) -> multiprocessing.Queue: |
import wx | |
def fraction_to_value(fraction, min_value, max_value): | |
return (max_value - min_value) * fraction + min_value | |
def value_to_fraction(value, min_value, max_value): | |
return float(value - min_value) / (max_value - min_value) |
import paramiko | |
import requests | |
import base64 | |
import json | |
from simple_salesforce import Salesforce | |
#--------------------------------- | |
# FTP portion | |
#--------------------------------- |
dependencies | |
virtualenv | |
http://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html | |
sudo pip install vitualenvwrapper | |
in .bash_profile add (or create) |
#!/usr/bin/env python2 | |
# -*- encoding:utf-8 -*- | |
from __future__ import print_function | |
import argparse | |
import datetime | |
import exifread | |
import flickrapi | |
import os | |
import sys |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
#!/usr/bin/python | |
''' | |
Script to count messages by user posted to a channel for a given date range. | |
Install: | |
# sudo pip install slackclient | |
Also you will need to obtain a slack API token: | |
https://api.slack.com/docs/oauth-test-tokens |
Copyright 2020 Aubrey Taylor | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH |
// Inspired by http://stackoverflow.com/questions/2886446/how-to-get-methods-list-in-scala | |
def dir(x: AnyRef): Unit = println(x.getClass.getMethods.map(_.getName).distinct.sorted.mkString(" ")) | |
scala> dir("") | |
charAt codePointAt codePointBefore codePointCount compareTo compareToIgnoreCase concat contains contentEquals copyValueOf endsWith equals equalsIgnoreCase format getBytes getChars getClass hashCode indexOf intern isEmpty lastIndexOf length matches notify notifyAll offsetByCodePoints regionMatches replace replaceAll replaceFirst split startsWith subSequence substring toCharArray toLowerCase toString toUpperCase trim valueOf wait |