abs()
delattr()
hash()
# install dependencies needed to build new openssh | |
sudo apt-get build-dep openssh openssh-server | |
# downloaad openssh-server v9.3 | |
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p2.tar.gz | |
tar -xzf openssh-9.3p2.tar.gz | |
cd openssh-9.3p2/ | |
# compile | |
./configure --with-md5-passwords --with-pam --with-selinux |
$JAVA_HOME/bin/keytool -importkeystore -srckeystore /<our_ca_certs>.jks -srcstorepass <pass> -destkeystore $JAVA_HOME/lib/security/cacerts -deststorepass changeit | |
$JAVA_HOME/lib/security/cacerts | |
openssl s_client -connect bpaustralia.lei.com:443 -CApath /etc/ssl/certs | |
sudo cp /etc/nginx/certs/lob2023cer.crt /usr/local/share/ca-certificates | |
sudo update-ca-certificates --fresh |
# To delete downloaded packages | |
sudo apt-get clean | |
# To remove all stored archives in your cache for packages | |
sudo apt-get autoclean | |
# To remove unnecessary packages | |
sudo apt-get autoremove | |
# check kernel version can remove |
sudo useradd -m lorneluo --shell /bin/bash | |
sudo mkdir -p /home/lorneluo/.ssh | |
sudo touch /home/lorneluo/.ssh/authorized_keys | |
sudo vi /home/lorneluo/.ssh/authorized_keys | |
# past ssh key into /home/lorneluo/.ssh/authorized_keys | |
sudo echo '' >> /home/lorneluo/.ssh/authorized_keys | |
sudo chmod 644 /home/lorneluo/.ssh | |
sudo chmod 600 /home/lorneluo/.ssh/authorized_keys |
# https://airflow.apache.org/docs/stable/installation.html | |
sudo apt-get update | |
sudo apt-get install -y build-essential mysql-server libmysqlclient-dev libblas-dev libatlas-base-dev | |
sudo apt-get install -y --no-install-recommends \ | |
freetds-bin \ | |
krb5-user \ | |
ldap-utils \ | |
libffi6 \ | |
libsasl2-2 \ |
AWSTemplateFormatVersion : 2010-09-09 | |
Resources: | |
LambdaExecutionRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: '2012-10-17' | |
Statement: | |
- Effect: Allow |
class BitmexAPI: | |
# Contructor etc... | |
def place_order(self, order: Order): | |
def place_order_api_call(): | |
size_sign = 1 if order.order_side == OrderSide.BUY else -1 | |
result = self.__bitmex_client.Order.Order_new(symbol='XBTUSD', | |
orderQty=size_sign * order.size, |
docker run -it --rm --entrypoint bash -e ODBCINI=/opt/odbc.ini -e ODBCSYSINI=/opt/ -v "$PWD":/opt lambci/lambda:build-python3.8 | |
# install unixODBC | |
curl ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz -O | |
tar xzvf unixODBC-2.3.7.tar.gz | |
cd unixODBC-2.3.7 | |
./configure --sysconfdir=/opt --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE --prefix=/opt | |
make | |
make install | |
cd .. |
# controlar o mouse no Windows. | |
# https://stackoverflow.com/questions/4263608/ctypes-mouse-events | |
# see http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx for details | |
import ctypes | |
import time # opcional | |
def pos(x, y): | |
ctypes.windll.user32.SetCursorPos(x, y) |