Thanks to Joshua Fernandes’ Robin_Stocks python module, you can download all your stock orders from RobinHood easily to a CSV file in order to calculate gains and losses to help when doing your taxes.

Below is a quick guide for how to do it in Linux, buy you can probably do it just as easily in Windows or on a Mac!

#First, install the module
$ sudo pip install robin_stocks

#Next, create a file to contain your user credentials, here’s an example
$ cat config.json
{
“username”: “usernamehere”,
“password”: “passw0rdh3r3”
}

#Don’t worry, Robin_Stocks is smart enough to ask for your MFA code if you are using that feature

#Here’s the simple python program to make a CSV file and save it to your computer

$ cat download_stock_orders.py
import json
import robin_stocks as rh


content = open(‘config.json’).read()
config = json.loads(content)
rh.login(config[‘username’], config[‘password’])
rh.export_completed_stock_orders(“.”)

#Run it like this:
$ python3 download_stock_orders.py
Found Additional pages.
Loading page 2 …
Loading page 3 …
Loading page 4 …

#And here’s the resulting file dated with today’s date!
$ ls *.csv
stock_orders_Jan-08-2021.csv

#Here’s what it looks like!
$ head stock_orders_Jan-08-2021.csv
symbol,date,order_type,side,fees,quantity,average_price
VNE,2021-01-07T17:42:58.730000Z,limit,buy,0.00,2.00000000,20.55000000
KBNT,2021-01-07T14:30:10.837000Z,market,sell,0.00,10.00000000,5.44000000
BNGO,2021-01-06T19:26:02.112000Z,limit,buy,0.00,12.00000000,5.05500000
PLTR,2021-01-04T14:37:28.082000Z,limit,buy,0.00,9.00000000,22.55000000
PLTR,2020-12-31T16:33:27.710000Z,market,sell,0.00,9.00000000,23.87110000
VSTO,2020-12-31T14:33:02.565000Z,limit,buy,0.00,5.00000000,23.98000000
FUBO,2021-01-04T14:36:31.806000Z,limit,buy,0.00,4.00000000,27.00000000
FUBO,2020-12-28T14:19:39.850000Z,limit,sell,0.00,3.00000000,40.46000000
UUUU,2020-12-29T14:59:36.264000Z,limit,buy,0.00,3.00000000,4.15000000

After this I simply loaded it into a spreadsheet and was able to sort and easily calculate gains and losses!

Here’s a short little test that I worked up many years ago specifically for using for Linux SysOps candidates and I thought I would share it for anyone who would like to use it.  It measures a few things.  Firstly, of course, it tests for basic familiarity with Linux but more importantly, how well a candidate can follow instructions.  This is probably the most important trait to have where critical systems are involved and most of the operator actions are pre-scripted.  I have found the last part of the test on page 3 will identify detail-oriented candidates for you quite effectively and weed out the rest.  I’ve put it in PDF format so you can print it easily.

Click on the thumbnail below to download it.

Link for Linux Sys Ops test download
Click to download the Linux Sys Ops test (PDF format)

I’m sure the last part also can easily be adapted for other non-linux oriented roles that require good traits for focus, memory and precision.

I can post up the answer key, but really if you don’t already know the answers, you probably shouldn’t be administering this test!

Here’s the steps I had to take in order to add an encrypted listener in addition to the standard listener on an old Oracle instance.  Hopefully it may save you some time.. I had to futz around with it a bit until I got it going and then was able to deploy to some other servers in the same fashion:

STEP1 – – Go to the directory right above your “TNS_ADMIN” location.. typically it would be something like this:

cd /u01/product/11.2.0/dbhome_1/network/

STEP2 – – Create a new “admin2” directory

mkdir /u01/product/11.2.0/dbhome_1/network/admin2

STEP3 – –  Create new listener.ora and sqlnet.ora files in the new admin2 directory, and customize for your particular instance.  I arbitrarily picked port 11521 because it would be easy to remember for me.

####### listener.ora ########

SSL_CLIENT_AUTHENTICATION = FALSE

ENCRYPTED_LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 11521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11521))
)
)

ADR_BASE_ENCRYPTED_LISTENER = /u01
SECURE_REGISTER_LISTENER_PROD = (IPC)
####### sqlnet.ora ########

SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS)
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER= (SHA1, MD5)
SSL_VERSION = 0
SQLNET.ENCRYPTION_SERVER = required
SSL_CLIENT_AUTHENTICATION = FALSE
SQLNET.CRYPTO_SEED = ‘SomeCrazyCryptoSeedWhateverYouWantHere’
SQLNET.ENCRYPTION_TYPES_SERVER= (AES256)
SSL_CIPHER_SUITES= (SSL_RSA_WITH_AES_256_CBC_SHA)
SQLNET.EXPIRE_TIME=60

STEP4 – – Next we will need to register the new listener to let the DB know about the regular one and the new encrypted one (or more if you’d like).  I’m doing this in the TNSNAMES.ORA file and calling it “ALL_LISTENERS”.

In my case this was located in the regular TNS_ADMIN home location: /u01/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

#######
ALL_LISTENERS=
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = FQDN.DB.HOSTNAME)(PORT = 11521))
)
####

Then in SQLPLUS as the SYSDBA you will need to run:

SQL> ALTER SYSTEM SET LOCAL_LISTENER=ALL_LISTENERS;
———————————————————–
Note: You may have to stop everything and restart the DB at this point… but it may not be necessary.  I just did it to make sure everything was clean.

STEP5 – – Start up your standard listener first as usual:

lsnrctl start

Next follow this procedure in order to start the second encrypted listener:

cd /u01/product/11.2.0/dbhome_1/network/admin2
export TNS_ADMIN=`pwd`
lsnrctl start ENCRYPTED_LISTENER

After a minute or so you should be able to see that the listener status is READY, and has 1 handler(s) for this service by running the command:

lsnrctl status ENCRYPTED_LISTENER

Hopefully this is straight forward enough.  I hate reading Oracle docs and would rather just have an example cookbook approach, so if you are like me maybe you will appreciate this.

–Cheers!