Headless Google Drive Uploads

First of all we need an Access Token for the Google Drive account we’re uploading to. This can be attained in many different ways. I’ve written a simple bash script to get Google API authentication and access tokens, which can be found here. Note: due to a bug somewhere, Google doesn’t seem to like drive scopes, so I’m using the all-enveloping https://docs.google.com/feeds for now.

Linux `cal` utility in landscape mode

Linux `cal` utility in landscape mode The cal utility in Linux does not, unfortunately allow one to output the calendar in landscape mode (4 columns or more). The default cal -y output mode will display 3 columns. Here’s a hack-around: Download the latest release of util-linux Extract and edit the misc-utils/cal.c file. Find the yearly function. …

Подробнее

Arduino Uno as an FTDI RS232 to Serial Adapter

Then I remembered I had an Arduino Uno that I thought had an FTDI chip. It didn’t, but I did find out that it in tri-state mode (with the Atmel chip in reset) I could send and receive data to pins 0 and 1 (RX and TX respectively) by simply writing and reading from the virtual serial device created by Linux after connecting the Uno via USB.

Advertisement Proposal Scam

Advertisement Proposal Scam So a couple of nights ago I got a weird e-mail from “Diana” at dianabem501@gmail.com. It said: I have visit your blog https://codeseekah.com/ I can pay you $200 per month. Contact me for more info. Intrigued, decided to respond and see where this scam went. I replied “What for?”… …getting back the following: …

Подробнее

Remove Duplicate WordPress Category Pages

Remove Duplicate WordPress Category Pages A rather peculiar problem has come my attention yesterday. WordPress has an infinite amount of category pages that are absolutely identical. For example: https://codeseekah.com/category/wordpress/ https://codeseekah.com/category/1/wordpress/ … https://codeseekah.com/category/infinity/wordpress/ This happens for all hierarchical taxonomies, and here is why. Basically, WordPress only queries the last term in the path. You might not like …

Подробнее

Lighthouse – WordPress Performance Plugin Review

Lighthouse – WordPress Performance Plugin Review Like many rants, this one starts with a promise. One made by the developers of Lighthouse on their marketing page: …optimize MySQL tables by removing all unused table space (both MyISAM and InnoDB)… All unused table space for InnoDB via a PHP plugin? Suspicious, I got my hands on a …

Подробнее

Dynamic Python Mixins

Dynamic Python Mixins I was pretty surprised to find out how straightforward it is to create mixin factories and templates in Python. I had a bunch of classes with attributes that needed special getter and setter methods with JSON serialization logic inside of them. class Model: parameter = None def get_parameter(self): return json.loads(self.parameter) def set_parameter(self, value) …

Подробнее