Tuesday, 19 April 2022

Options are hard

So now I’m down around $80 on my 2 options trades. That’s about $50 outside my current risk tolerance. Not good. My other positions on Robinhood are doing well. Showing gains on all 5 positions, recommended from Top 5 S&P 500 Stock Picks To Buy Now by Steven Cress. I’m now following him. As far as I can tell, his quant articles are insightful, and his recommendations are good. Certainly, this one has been. There are so many news sources out there, that it makes it difficult to zero in on good and actionable information. Seeking Alpha seems to be a source providing frequent articles that actually back up their opinions.

Anyway, I’m trying to get out of the options without totally losing my ass. Who knows, maybe then the underlying stock will turn around and the options prices will outrun the time decay and I can make some money. I think that going farther “in the money” and farther out on expiration may help. I’ve only made a handful of options trades, so I still have a ton to learn. Trading options can be a big part of a successful swing strategy, and I’m hoping to make it part of mine.

The book Mastering the Trade by John F. Carter has been very interesting and informative, but I’m just getting to the discussion about options trading and strategies. John refers to his company and website/forum Simpler Trading a lot, and I’m considering joining for access to the options forums. The Subreddit r/Options may also be a good (and definitely free) place to start. I’m really hoping to get a winning strategy together this year, or at least make significant progress toward that goal. It’s time for a change in my life. Picking up heavy stuff for other people just isn’t sustainable.

Thursday, 14 April 2022

Wild Swings in the Market

Today I witnessed some wild swings in the options market. I’m currently holding 5 stocks that were recommended in a recent Seeking Alpha article and 2 options contracts each for 2 weed stocks. The stocks did okay. Three up and 2 down for the day, but all up overall. The options were a totally different story. I bought 2 OGI call contracts for 5/13 that were just in the money at open. As soon as the buy went through, I was down $0.05 per share. I guess I should wait for the market open before placing orders for options.

My current portfolio also includes 2 5/13 calls for ACB that I bought yesterday, and they were all over the place! I had calculated that I could tolerate a $16 loss on ACB to risk 2% of my capital. When I checked my position early in the day, I was suddenly down $100 on this position. Not only that, but I only paid $102!! Anyway, I didn’t close the position and in a couple of minutes, I was down just $50. Then, when I checked in an hour or so, I was suddenly up to $0.81 for a 172% gain. Holy cow that’s some wild swings for sure! I put in a sell order for 1 contract, but it was never filled. Within a few minutes, it was back down to a sane range. Twice during the day, it jumped to $0.85, so I think tomorrow I’ll put 1 contract up for $0.85 and see how it goes. I had no idea that options are so crazy!

Sunday, 3 May 2020

Kratky Method Hydroponics

In researching hydroponics on the Internet, I ran across something pretty amazing. It’s Kratky Method which is a totally passive, zero electricity method for hydroponics. Yeah, dead simple.

I’ve been working on getting my own hydroponics system setup and have been researching various circulation systems and methods, different layouts, blah, blah, etc. Then I discovered this system that I got setup and started in about an hour one afternoon. As a proof of concept I decided to start very small with just one plant. Apparently it takes about 1 gallon (4 liters) to grow a lettuce plant to maturity. So I found a gallon jug, painted the outside black to prevent algae growth, mixed up the nutrients and “planted” a lettuce seed in rock wool in a 1.5″ basket. The idea is that you fill the container until about the lower 1/2″ of the rock wool is submerged. That will draw the nutrients up through capillary action to the seed. Once the plant starts to grow and the roots reach down, the nutrients recede and the roots chase it to the bottom of the container. The space between the basket and nutrients is where the roots get oxygen as they dangle into the nutrients for food. Add a grow light (or the sun) and that’s it. No air stone, no circualting pump, nothing. And it’s working great.

Now I’m in the process of building a “grow closet” to have whole trays of lettuce and other leafy greens. I found that there are 231 cubic inches in a gallon, so 6″x6″x6″ comes to 216 cubic inches. That should be close enough to grow lettuce then. So I build trays out of wood, to be lined with black landscaping plastic, at 7″x15″x20.5″ internal dimension. If I fill it to an inch from the top, that gives me 1845 cubic inches and 205 cubic inches per plant for 9 plants. I would have built a little bigger, but I was using up scrap material and was a little short. Being 26 cubic inches shy shouldn’t be a show stopper. So now all I have to do is hang the inexpensive led grow lights, fill the tubs, plant the seed and see what happens!

Friday, 1 May 2020

3D Printing Problems

My printer had been working pretty well for a long time. The quality had started to slowly degrade, but I still considered it well within acceptable tolerances. Then, finally, I started experiencing intermittent clogs. I tried cleaning the nozzle as best as I could, soaking in acetone (well, my girlfriend’s nail polish remover), heating the nozzle to 250, changing print settings, etc. Still the problem persisted. As an amateur mechanic, this is when I start replacing parts. A quick Amazon search for bowden parts found the tubing and the clamp thingies on the ends for pretty cheap and another search found the 0.40mm nozzles (something like $5 for 10).

I got the hot end off of the carriage, then heated it to 250 and pushed the latest clog through. I installed the new teflon tube and noted that it’s supposed to push down into the hot end quite a bit. I got the hot end cleared so the tube would sit properly, installed the new nozzle and reassembled the whole thing.

It loaded the filament beautifully and never did the stepper kickback that it had been doing. Now it is printing Benchy perfectly (well perfect enough for me).

Moral of the story is to occasionally just replace that nozzle. They’re cheap, it’s an easy job and it will save your prints.

Friday, 22 November 2019

Import Google contacts into abook

abook screenshot
Abook is simple text based address book that works well with Mutt

I’ve been trying to figure out how to import Google contacts into abook for awhile. I was repeatedly disappointed that I couldn’t find any useful and up-to-date instructions or scripts. It turns out that abook is way more powerful and configurable than I thought. The answer was right in front of me the whole time.

One article that I read was about importing your Outlook contacts into abook format and short Ruby script and a couple of terminal commands. It didn’t work properly for me, but it reminded me of something I should have checked first. That’s right. The man page. Duh.

$ man abook

That told me that I could use abook itself to import from several common contact file types including .vcf. Aha! Google contacts will let you export directly to the standardized vCard format! Go to contacts.google.com, select the contacts that you would like to export, click Export on the left and save to a .vcf file. Then, at the command line, enter:

$ abook --convert --informat vcard --infile ~/Downloads/contacts.vcf --outformat abook --outfile addressbook1

I saved the new addressbook file to addressbook1 because I already had a small addressbook and didn’t want to overwrite it. Unfortunately, I didn’t readily find a was to merge the files since the format includes an “id” number. That’s pretty much it to import Google contacts into abook. Super easy. It’s no wonder it was difficult to find specific instructions and/or scripts. Abook already does it!

To further customize abook, copy the example config from /usr/share/doc/abook to ~/.abook/abookrc and play around. I added a Note field on the Other tab to include notes about how I know the person. Anyway, I hope this simple guide helps and reminds you not to forget about man pages!

Tuesday, 28 May 2019

Installing ArchLinux with Encrypted LVM, UEFI and GPT

This is not a definitive guide. This is just what I learned installing and booting to a command prompt with /boot, /home and root defined as logical volumes inside of an encrypted partition. As I’ve said, this is by no means an exhaustive guide. It’s more like a list of specific steps and resources for more information.

I got a new laptop from System76 and wanted to install Debian. The Debian installer, for whatever reason, wouldn’t load the graphics, making it unusable. Bummer. So I decided to take this opportunity to finally wrap my head around ArchLinux. I see it mentioned everywhere, they have incredible documentation that I often use for help even with other distros, and I like the level of control it allows. However, I don’t know enough about it to just go formatting my new laptop and installing it willy nilly. So I decided to muddle through a test install on a virtual machine using VirtualBox. This presented a couple of unique challenges since it’s not a perfect emulator (but it’s still the best one around).

I wanted to emulate the setup that came on the laptop as far as the encrypted disk and Logical Volume Management, so that’s where I started. It took several tries for me to get it right since these things are new to me, but I eventually got it. Start by following the instructions from the Archlinux Installation Guide up to partitioning.

On a 20G virtual drive, using gdisk, my partitioning goes like this:

/dev/sda1    Sectors 34-2047    BIOS Partition (EF02)
/dev/sda2    512M  EFI Partition (EF00)
/dev/sda3    512M  EXT4 Partition (8300)
/dev/sda4    4G    Swap (8200)
/dev/sda5    whatever is left for LVM (8E00)

Setup the /dev/sda5 as the encrypted volume with:
# cryptsetup -v --type luks1 luksFormat /dev/sda5
I use luks1 because luks2 doesn’t seem to be fully supported yet and is definitely not supported by GRUB. The above command will encrypt /dev/sda5 and ask you for the password you’d like to use.
Open the encrypted volume with :
# cryptsetup open /dev/sda5 cryptdata
This will open the encrypted volume and map it to /dev/mapper/cryptdata. Now create the logical volumes for /var /home and root.
# pvcreate /dev/mapper/cryptdata
# vgcreate data /dev/mapper/cryptdata
# lvcreate -L 2G data -n var
# lvcreate -L 5G data -n home
# lvcreate -l 100%FREE data -n root
Now the disk is partitioned. Time to format.
# mkfs.fat -F32 /dev/sda2
# mkfs.ext4 /dev/sda3
# mkswap /dev/sda4
# swapon /dev/sda4
# mkfs.ext4 /dev/data/var
# mkfs.ext4 /dev/data/home
# mkfs.ext4 /dev/data/root
Now that we’re all partitioned and formatting, let’s get everything mounted.
# mount /dev/data/root /mnt
# cd /mnt
# mkdir efi boot home var
# mount /dev/sda2 efi
# mount /dev/sda3 boot
# mount /dev/data/var var
# mount /dev/data/home home
So now my target filesystem should be all set and it’s time to pick our mirrors. You can go through the steps to sort the list by the fastest mirrors, but I just selected all of the servers in the US. Go to /etc/pacman.d to find the mirrorlist and copy it to mirrorlist.orig.
# cp mirrorlist mirrorlist.orig
# grep -A 1 'United States' mirrorlist|sed -e 's/--//g'|sed 's/#Server/Server/g' >> mirrorlist.us
# cp mirrorlist.us mirrorlist
Install the base system with :
# pacstrap /mnt base
Wrap it up with :
# genfstab -U /mnt >> /mnt/etc/fstab
# arch-root /mnt
# pacman -S --noconfirm vim
# ln -sf /usr/share/zoneinfo/Americas/Chicago /etc/localtime
# hwclock --systohc
Uncomment your locale in /etc/locale.gen (en_US.UTF-8 UTF-8) and run # locale-gen
# echo 'LANG=en_US.UTF-8' >> /etc/locale.conf
# echo 'workstation' >> /etc/hostname
# echo ' localhost' >> /etc/hosts
# echo '::1 localhost' >> /etc/hosts
With both dm_crypt (luks1) and lvm, you’ll need to make /etc/mkinitcpio.conf HOOKS= look like:
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck)
And run : mkinitcpio -P Set the root password with passwd Install grub and efibootmgr :
# pacman -S --noconfirm grub efibootmgr
# grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
Use the command lsblk -f to get the UUID for the encrypted partition. In my case this was /dev/sda5. Edit /etc/default/grub so that GRUB_CMDLINE_LINUX looks like:

Now generate grub.cfg with :
# grub-mkconfig -o /boot/grub/grub.cfg
Exit from chroot, unmount with umount -R /mnt and reboot. That should get you to a prompt.

Saturday, 4 May 2019

How to Rename Similar Files at the Command Prompt Using Sed

Using a simple “script” at the command line, you can rename a bunch of similar filenames with ease. Say you’ve got something like: foo-001, foo-002 and foo-003, but you want them to be bar-001, bar-002 and bar-003. The script will look like :
$ for i in `ls -1 foo*`; do mv $i `echo $i |sed -e 's/foo/bar/'`; done
You can test your code without making changes by removing the ‘mv’ command and just echoing the results to stdout like so :
$ for i in `ls -1 foo*'; do echo $i |sed -e 's/foo/bar/'; done
With the latter command, you can examine the results to see if that’s actually what you want ‘mv’ to rename the files to.

Sunday, 21 April 2019

Powerline Symbols in Urxvt in Ubuntu

The distro is actually Pop_OS, but I seem to remember having to do this in Debian as well.

The GitHub Powerline page says that you can just install the fonts-powerline package through apt and angels will sing. I did not have any such luck. The way I finally got it to work was to actually clone Powerline from GitHub and use the included installer. This, of course, was after several evenings of trying to track down various settings and endless restarts. Just skip to the end and install them from GitHub. Then you’ll have the ‘…for Powerline’ fonts available to you and tmux and vim powerlines will look right in urxvt.

If you’re just using gnome-terminal, the aforementioned fonts-powerline package is all you need.

Monday, 15 April 2019

Installing My Desktop Environment in Debian/Ubuntu/PopOS

For compiling and installing i3-gaps, basically just follow this guide.

For Termite, you’ll have to install vte-ng, and you can use this guide to do both. NOTE: For the vte-ng dependencies, you’ll also need intltool. Initially, $ termite is returning termite: symbol lookup error: termite: undefined symbol: vte_terminal_set_cursor_position, but everything compiled and installed correctly. So that’s frustrating. Okay, so this got Termite to run, but then zsh is weird, colors aren’t working right and tmux won’t run. I’ll have to fuck with this some other time. For right now though, unusable in PopOS. It works fine on my Debian desktop.

Compiling and installing Polybar is as simple as this Reddit post. If you want to use any of the symbols in the bar and default config, you’ll need to install Siji Symbols. The install from Github is pretty straight forward.

To compile and install Rofi, looks like I get to write the dependency install thingy.
For building with gcc do: $ sudo apt install gcc make autoconf automake pkg-config flex bison check
For external libraries, do: $ sudo apt install libpango1.0-dev libpangocairo-1.0-0 libcairo2-dev libglib2.0-dev librsvg2-dev libstartup-notification0-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb1-dev libxcb-xkb-dev libxcb-randr0-dev libxcb-xinerama0-dev libxcb-util-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-xrm-dev
When I tried to build rofi, it failed the Check check. One could run $ ../configure --disable-check, or upgrade Check from https://libcheck.github.io/check/index.html, which is what I did.

Last but not least, installing Compton from the default repo is probably enough, but I want to cover building these elements from source even if most of the dependencies are from the default repos. So here we go. To install the dependencies do:
$ sudo apt install libx11-dev libxcomposite-dev libxdamage-dev libxfixes-dev libxext-dev libxrender-dev libxrandr-dev libxinerama-dev pkg-config make x11proto-dev x11-utils libpcre3-dev libconfig-dev libdrm-dev libgl1-mesa-dev libdbus-1-dev asciidoc docbook-xml libxml2-utils libxslt1-dev xsltproc xmlto
This will install a bunch of shit (about 700M worth in the end), but whatever. Storage and bandwidth is cheap now, right? Who remembers the rootboot image you could get that fit on a 1.44M 3 1/2″ floppy? I mean there was no GUI, but still.

So, i3 doesn’t work as expected, but I suspect that is because I recycled dotfiles from another system. And somehow I broke gnome-terminal. WTF. According to the Internet, something jacked with my locale settings? Weird.
After installing everything, gnome-terminal would throw:
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached
Almost everything I saw on the Internet pointed to a locale problem. I went through a half dozen “fixes” to know avail. Then, I saw something about a problem with vte. I had installed vte-ng for termite, which didn’t work properly for some reason, so I uninstalled it and rebooted. voila!

Monday, 7 January 2019

Last Minute Training for 3M

I’m an idiot. The 3M Half Marathon is right around the corner and I have barely trained. That’s not entirely true, I just haven’t trained much in the last few weeks. I was doing a really good job about keeping up with it for the first 2 months or so, running 3 times a week, but even then I wasn’t doing any cross training. Now, with the race looming just 14 days away, I’m a little worried. I’m confident that I’ll be able to finish, but I think this will be a low point in my running. I’ll be able to say things in the future like, “Well at least it wasn’t as bad as the 2019 3M!”

Anyway, tonight I did 3.4 miles, 10:26 pace and almost all in Zone 5 (yikes!). Not great, but at least I did it. I came home and did 10 Step Overs on each leg, 2 pull ups and 2 dips. Pitiful, right? I will get better. Tomorrow will be strength training and calisthenics.