diff options
author | Mark Powers <mark@marks.kitchen> | 2022-07-19 21:12:41 -0500 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2022-07-19 21:12:41 -0500 |
commit | 4e965c7d9a66d6a72b24c7b319c10d8006f2026e (patch) | |
tree | 4021ef67be5ed3a76e0632c3cfec5d6428806850 /content |
Initial Commit
Diffstat (limited to 'content')
29 files changed, 1051 insertions, 0 deletions
diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..515d82d --- /dev/null +++ b/content/about.md @@ -0,0 +1,56 @@ +--- +title: "About" +date: 2022-07-13T20:37:25-05:00 +--- +Hello! I'm Mark Powers. This is my website. I started it back in 2018 when I +wanted to share my process of learning to bake bread. Now it's mostly just a +general blog, but also where I host a lot of my [projects](/projects). + +Occupation +: Software Engineer - DevOps Lead at [Chameleon +Cloud](https://chameleoncloud.org) + +Location +: Chicago. Previously, Chicago Suburbs, Madison, and West Michigan + +Almae Matres +: Hope College, UW-Madison + +Source Code +: [gitweb](https://git.marks.kitchen) +: [github](https://github.com/Mark-Powers/) + +Social +: [markp@fosstodon](https://fosstodon.org/@markp") + +Hobbies +: Programming, video games, reading, bicycling, woodworking, chess, cooking, +disc golf + +Operating System +: Regolith Linux — I like how little fuss Ubuntu is, it runs any I want without +too much hassle. Regolith is great for people like me, who are also want to +try/use i3 in an environment they are comfortable with. + +Editor +: Vim — I stick mostly to defaults. I like that pretty much on any system, +it'll have this editor that I am used to, and Vim is very powerful with enough +practice. + +RSS Reader +: Miniflux — I like being able to browse feeds anywhere. Previously, I used +FreshRSS, but my install broke and I couldn't fix it. I have over 500 feeds at +the moment, and the fetching service of Miniflux works well. + +Pets +: One very fluffy black cat, one shorthair kitten + +Erdos Number +: 3 — Myself ↔ Charles A. Cusack ↔ Charles J. Colbourn ↔ Paul Erdos + +Articles +: Keahey, Kate, Jason Anderson, Michael Sherman, Zhuo Zhen, Mark Powers, Isabel Brunkan, and Adam Cooper. "Chameleon@Edge Community Workshop Report." (2021). +: Cusack, Charles A., Aaron Green, Airat Bekmetjev, and Mark Powers. "Graph pebbling algorithms and Lemke graphs." Discrete Applied Mathematics 262 (2019): 72-82. +: Cusack, Charles A., Airat Bekmetjev, and Mark Powers. "Two-pebbling and odd-two-pebbling are not equivalent." Discrete Mathematics 342, no. 3 (2019): 777-783. +: Cusack, Charles A., Mark Powers, and Airat Bekmetjev. "Doppelgangers and Lemke graphs." Discrete Mathematics 341, no. 10 (2018): 2686-2693. + diff --git a/content/blog/100_days.md b/content/blog/100_days.md new file mode 100644 index 0000000..9e5c107 --- /dev/null +++ b/content/blog/100_days.md @@ -0,0 +1,11 @@ +--- +title: "100 Days to Offload" +date: 2020-07-21T21:13:21-05:00 +--- +I want to write more. I keep a diary, where I write mostly short things about each day. But, it is hard to be intrinsically motivated to write things that only you will see. This isn't a problem on the internet, where anyone can post what they want. Writing longer blog posts seemed hard, so I joined fosstodon.org (@markp), a decentralized "twitter" social network (I want to avoid twitter due to its algorithmic curation), There, I could write shorter things (which didn't seem like such a big commitment), and get some social engagement which has been hard to come by lately. On fosstodon, I saw a lot of people posting about 100 Days to Offload, which is just encouraging everyone to just write on their blog, no matter how well put together the posts are. Specifically, the challenge is to write 100 blog posts in a year. + +The premise is that writing is a habit that requires effort and time to learn. So I've decided to use my blog for this challenge, and to start posting much more often than I have been. My goal is to hit 50 posts in a year, which is only one a week. Not only is this very achievable, and it gives plenty of time to produce content of some quality. 50 posts leaves no room for excuses, and if they go well enough, I may still have time to hit 100. + +There is a lot I want to get out of this challenge. Firstly, I want my blog to have some posts that I am proud of and that are helpful. Right now, it is mostly some minor showcases of my projects, but none of them are really that interesting or insightful. Second, I want to get better at editing my writing. It is something that I have always avoided properly doing (if you go back to my early posts, there are some obvious grammatical errors). Thirdly, I want to practice being creative and do other things than just consume. It is much harder to be attentive and focused on creative endeavors, especially after years of putting them aside. + +If you are like me, and have always wanted to write and create on the internet, why not start now? If what you make ends up awful, oh well it was just part of that weird challenge to pump out content. The potential for something great to arise, even if unlikely, is worth the effort. diff --git a/content/blog/2021_year_to_date.md b/content/blog/2021_year_to_date.md new file mode 100644 index 0000000..59cb54d --- /dev/null +++ b/content/blog/2021_year_to_date.md @@ -0,0 +1,13 @@ +--- +title: "2021 Year to Date in Review" +date: 2021-06-16T21:38:07-05:00 +--- +A lot has happened in my life so far this 2021. + +For the spring semester, I was a research assistant. I worked on creating an experiment in order to detect ground motion using computer hard drives. Lots of people have done experiments seeing how noise can affect hard drive performance, and of course there is this famous video where someone is yelling at their hard drives. Most of this work is done with fairly high frequency vibration, but ground motion is typically much lower. My preliminary experiments showed that we can detect vibration as increased latency for some frequencies at an amplitude that is a legal limit for blasting (velocity of 5 mm per second). Most of my work was looking at different OS configuration and workload generation in order to maximize the sensitivity we saw. There is a lot of variance in latency patterns based on what type of drive is being used, and even the capacity of the drive. The majority of my work was on looking into analyzing the data I recorded, and finding out how to extract the information. + +I also completed my Master's degree in Computer Sciences in May. I didn't have a thesis, and I took a breadth of courses. I did stuff with machine learning, programming languages, networking, security, human computer interaction, and numerical analysis. In previous semesters, I was a TA for a few introductory courses and operating systems, and I even got to the be lecturer for Programming I. What I liked most about undergrad was taking a wide variety of courses in computer science, and I was never able to pick just one area. Graduate school let me take classes that also weren't offered at my small undergrad school. + +I've started a job this month, and so far it has been great. I'm working on a national science foundation project, creating a cloud computing test bed. I get to work on open source software, and work on fun programs. There are a lot of parts to it, combining all sorts of different types of programs. It has been a challenge learning so much, I've never had to jump into something so large, but this also makes it an interesting challenge. + +There have been more personal updates too. I got engaged this May. I went on my first vacation since 2019, and I'm excited to travel more as things slow down. I had to move as well (for the job). My cat since I was little passed away, he was getting very old, and I've been expecting it for years. It has been a wild year so far, and I'm looking forward to what comes next. diff --git a/content/blog/best_of_2019.md b/content/blog/best_of_2019.md new file mode 100644 index 0000000..6e9d314 --- /dev/null +++ b/content/blog/best_of_2019.md @@ -0,0 +1,51 @@ +--- +title: "Mark Kitchen Best of 2019" +date: 2020-02-08T20:41:55-05:00 +--- +A selection of the best things I experienced in 2019 + +# Best Movie +## The BlacKkKlansman + +I didn't watch many movies during 2019. I enjoy Spike Lee and Adam Driver is always excellent. Honorable mentions go to Interstellar and Street Fighter the movie. +and Street Fighter the movie. + +# Best Book +## The Contrary Farmer - Gene Lodson + +An unknown book by a farmer who does things contrary to big agribusiness. I appriciate how clear he is about his life. Honorable mention to How to Cook Your Life: From the Zen Kitchen to Enlightenment. + +# Best Album +## Northwest Passage - Stan Rogers + +I have been loving all of Stan Roger's discography, this album has a good selection. My favorite songs are Barrett's Privateers, The Idiot, the Mary Ellen Carter, and White Squal. This year I also enjoyed The Heart of Saturday Night, Fiddler On the Roof, John Prine's September 79. + +# Best Recipe +## Chicken Tikka Masala - Budget Bytes + +This recipe is so good. It's perfectly delicious. I have it memorized at this point. I'd also like to shout out The Perfect Loaf for a great sourdough recipe. + +# Best Linux Software +## Valve's Proton + +While non libre, this has given me the comfort to switch to entirely linux on my desktop computer. Now, steam games automatically are configured, usually requiring no setup. Most all of my games work great, and I am not limited in my choices. I have also been using cherrytree, which is excellent. + +# Best Board Game +## Decrypto + +A really fun game that is in the same category as the classic Codenames. I also enjoyed We're Doomed, though did not play very much. + +# Best Video Game +## Super Mario Maker 2 + +The Mario platforming series is my favorite video games series. Mario Maker is the peak of the franchise (and at times the trough). + +# Best Newsletter +## The Convivial Society + +A newsletter about technology, discussing how it has changed our society. I look forward to each new issue. + +# Best Website +## Low-Tech Magazine + +Another great website about technology. I love their articles about wind usage especially. diff --git a/content/blog/best_of_2020.md b/content/blog/best_of_2020.md new file mode 100644 index 0000000..dc64f56 --- /dev/null +++ b/content/blog/best_of_2020.md @@ -0,0 +1,71 @@ +--- +title: "Best of 2020" +date: 2021-01-05T21:32:58-05:00 +--- +A selection of the best things I experienced in 2020. By my counts, I have watched ~30 movies, wathed (at least some) of 15 shows, read 28 books, and have subscribed to 332 RSS feeds. + +# Best Movie + +## The Matrix + +I can't belive it took me so long to see the Matrix. This year I also enjoyed The Addam's Family, Johnny Mnemonic, and Spirited Away. + +# Best Book + +## A Sand County Almanac + +I read this classic after getting it for Christmas, and I really loved it. Unlike many others, my favorite parts of Walden are where he describes the mundane interactions with everything. Almanac reminded me a lot of this of course, and also the excellent essays of Wendell Berry. I also recommend Siddartha, All the Pretty Horses, and Does it Matter?. + +# Best Album + +## Rough Rowdy Waves - Bob Dylan + +I consider this classic Dylan, and like most of his original work it is excellent. It also is strange, famously featuring a 17-minute song about the Kennedy assassination. I was less of a fan of his trilogy of standards, and I have been savoring all new Dylan since I became a fan back in 2012. His series Theme Time Radio is also recommended, where the hosts a radio show. I also recommend all of Simon and Garfunkel's discography, and as always more Stan Rogers. + +# Best Recipe + +## 18th-Century Ginger Cakes + +This recipe was so good and fun. It creates a spicy and sweet cake using very few ingredients. I also would recommend this recipe for green gazpacho. + +# Best Software + +## TT-RSS + +TT-RSS is ideal for how I want to use RSS feeds. It is not especially exciting in of itself. This year, I also made good use of wiki.js and I have become very proficient with vim. + +# Best Board Game + +## Village Green + +Another late entry I received as a gift from my girlfriend, this game is a short and easy game. I like this kind of game a lot. My main criticism is sometimes the symbols are hard to read, but this does not greatly detract from things. + +# Best Video Game + +## Quadrilateral Cowboy + +This game has such good world-building and story telling without any dialogue. The gameplay is good too. It offers the best cyberpunk experience there is in a game. Other games I enjoyed include the video game interpretation of Walden, The Talos Principle, Spelunky 2, and Hollow Knight. + +# Best TV Show + +## Taskmaster + +This show is really fun, and most of the seasons are available for free on their YouTube channel. If you haven't heard of it, Taskmaster is an excellent, hilarious British game show where comedians do stuff. I would certainly recommend it. I also enjoyed The Queen's Gambit and Dr. Who (Matt Smith). + +# Best Blog + +## https://austinkleon.com + +Austin's blog is really excellent. Every week there are multiple posts on it that I am really interested in. They have inspired me to concrete action in a way that most weblogs do not. + +# Best Podcast + +## No Such Thing As a Fish + +This is exactly the type of podcast I enjoy: funny people talking about interesting things. I have been binging episodes. I find this podcast a great way to relax, the topics are almost never something stressful. Some other podcasts I enjoy are Car Talk and Stuff You Should Know. + +# Best Comic + +## Transmetropolitan + +There has been a theme of cyberpunk related stuff this year, and for anyone looking for an engaging cyberpunk graphic novel, I would recommend this one. I also started Saga, but I have not caught up completely yet. diff --git a/content/blog/best_of_2021.md b/content/blog/best_of_2021.md new file mode 100644 index 0000000..c79dbdd --- /dev/null +++ b/content/blog/best_of_2021.md @@ -0,0 +1,67 @@ +--- +title: "Best of 2021" +date: 2021-12-27T21:41:29-05:00 +--- +This list is some of the best of stuff I experienced in 2021. + +# Best Movie + +## I'm Not There + +I started watched this Bob Dylan inspired docu-mocku-dramatized-metary back in high school when I first got into his music (of which I am a huge fan of, see last year's album pick). I never finished this movie then, and I recall finding it hard to understand. In summary, this movie characterizes six different parts of Bob Dylan through six different characters. It is hard to follow because of this, but I thought it was great and engaging. I haven't been able to parse the Richard Gere story, as other critics have noted, but I enjoy the style it was set in, and so will give it a pass. + +Honorable mentions are Knives Out, Coraline, and Kiki's Delivery Service. + +# Best Book + +## Surely You're Joking, Mr. Feynman! + +This is an excellent book about the life of Richard Feynman, a physicist who worked at Los Alamos during the war. There is minimal mention of physics, though, the book is about intellectual curiosities and his "curious character," as the book mentioned. I related to a lot of his stories, such as his criticism of the education system in Brazil at the time, and how it is like what I saw in my education. + +Honorable mentions are A Swim in a Pond in the Rain, Saga, and What are People For?. + + +# Best Album + +## Aereo-Plain - John Hartford + +I love bluegrass music, but John Hartford's bluegrass music is my favorite type. I had four of his albums: Aereo-Plain, Morning Bugle, Nobody Knows What You Do, and Mark Twang on repeat for much of the year. These songs are so catchy, delightful, joyous, American, melancholy, and childish that they have been on my mind like few albums before. + +Honorable mentions are Will the Circle be Unbroken, Hot Rats, and A Night at the Opera. + + +# Best Video Game + +## Half Life: Alyx + +Half Life: Alyx is a Half Life game, but in virtual reality. It is such an excellent experience. The writing and gameplay are fantastic, and it is such fun. The infamous Jeff chapter is one of the most compelling sequences I've ever seen in a game. This game makes a compelling case that VR games are the best way to experience an immersive story, and I look forward to more games like this for VR in the future. + +Honorable mentions are Dwarf Fortress, Caves of Qud, and Forewarned. + +# Best TV Show + +## Over the Garden Wall + +This series is wonderful. It reminds me a lot of Ghibli movies. + +I didn't watch a ton of television shows, or at least new shows, and so I'm omitting honorable mentions. I enjoyed introducing my partner to Taskmaster. + +# Best Youtube Series + +## Cody'sLab - Chicken Hole Base + +This is a series where a man buys land in Nevada, and tries to make it self-sustaining, loosely limiting himself to things that would be possible on Mars. I found myself enthralled with Cody's videos when I first discovered them. I'd recommend this series to anyone who is in science: Cody is living the mad scientist dream. + +# Best Blog + +## Ran Prier + +My RSS reader has 157 blogs at the moment, though some may be hiding under other categories, and so this category had a lot of competition. I most enjoyed seeing frequent posts by Ran Prier. Often his posts are about "weird collapse." + +# Best Board Game + +## Deception: Murder in Hong Kong + +I enjoyed this game a lot, in which a player tries to give clues like Mysterium. I find it much more enjoyable than Mysterium or other games within this genre. + +Other games I enjoyed were Calico and Star Realms. diff --git a/content/blog/email_scripts.md b/content/blog/email_scripts.md new file mode 100644 index 0000000..601ee38 --- /dev/null +++ b/content/blog/email_scripts.md @@ -0,0 +1,24 @@ +--- +title: "Email_scripts" +date: 2020-09-19T21:24:43-05:00 +--- +Email is great. It is a time tested standard, reliable, and federated. Today I spent some time cleaning up a couple scripts I have regarding email. Ever since I set up my own server with mailinabox.email/, I have been scripting some IMAP and SMTP things. It is much easier to do things with a custom server than with a large email provider like Gmail since you don't have their proprietary system on top of everything. The scripts reside in this repository. + +## email_helper.py + +This file handles all the shared code regarding IMAP and SMTP, like sending and parsing the inbox. I did not have this before today, and foolishly was just copying the send mail method in every script. In refactoring this, I accidentally sent out an email about an old post to all the subscribers on my website from the email sign up (sorry about that). I'm not quite sure how old this post was, as I don't show years for some reason in posts, which is something I need to fix. + +## config.py + +Manages the config file for everything. If no config file exists, it will prompt you to create one with a creation tool. + +## kitchen-update-email.py + +This script is fairly specific, and it checks if there is a new post on my website and if so sends out the email. Most of this code is DB logic, since that's where the information for when the last email was sent is kept. I run it in crontab, and so emails are send when my server hits midnight. +## reminder.py + +This is where things begin to get a bit interesting. I set up this script to send an email starting with the subject "REMINDER: " with the rest of the subject and body coming from the command arguments. This makes it really easy to set up a crontab line with the script for things like "pay rent near the end of the month" or "backup computer on the 5th". I can see the email in my inbox when it comes, and it is a reminder to do that thing. + +## daily-update.py + +This script does the most, and I run it every day. First, it will check my inbox for any emails that contain "REMINDER" in the subject and include their subjects in a list, just so the unread emails don't get buried in my inbox. Next, it will go to the [Library of Congress newspaper archives](https://chroniclingamerica.loc.gov/) to find a newspaper from 100 years ago and if there is one it will appear also in the email. I find old news to be fascinating, and in the future would be interested in including some more "this day in history" features. Lastly, this script will also include a detailed weather forecast table. I have more ideas of things to include, and I am excited to extend this daily email with even more things. diff --git a/content/blog/end_of_summer.md b/content/blog/end_of_summer.md new file mode 100644 index 0000000..57bac40 --- /dev/null +++ b/content/blog/end_of_summer.md @@ -0,0 +1,5 @@ +--- +title: "End of Summer Update" +date: 2019-09-19T20:40:26-05:00 +--- +Before the fall is officially here, I want to send an update on some stuff that I've been up to. In August, I participated in my first ever game jam. It was also my first real game that I made, other than some small arcade-ish games. The game is called Cosmic Cargo, made over a week with a team of (mainly) 2 developers, 1 sound artists, and some others helping with testing. The game is based on Oregon Trail, but in space. You can check it out [here](https://seafarerscafe.itch.io/cosmic-cargo). I had a lot of fun making the game and I want to participate in more jams in the future. I also recently moved and started my PhD in computer science. It has been great so far, but also very stressful adapting to a new environment. The CS department here alone has more students than the total at my last school. I created my own budgeting app, which is just a glorified literal spreadsheet. I wanted an easily enter purchases I made into a spreadsheet, but my problem was that editing a sheet on a phone is not fun. So I made a short app that takes the data I want as simple inputs, allowing it to do some data validation and automatically input things like the date. The app then can use the share function to send an email with the content I entered to my gmail account. Emails sent from this app are parsed using google scripting into a spreadsheet. Ideally, I would not need to go through google to do this, but the process works well. The email traces also are a sort of backup too. Eventually, I want to easily add a photo of a receipt too in the app, but my first attempts at doing this were not so easy. Hopefully, some of you received this blog update through email. I have been meaning to set up a newsletter infrastructure with this website and more regularly update it as well. For now, I'll alert the email list that there is a new post at least. If you wish to be added to this, you can sign up [here](http://marks.kitchen/email) diff --git a/content/blog/feb_2022_update.md b/content/blog/feb_2022_update.md new file mode 100644 index 0000000..de6afbf --- /dev/null +++ b/content/blog/feb_2022_update.md @@ -0,0 +1,11 @@ +--- +title: "What's been up - Feb 2022" +date: 2022-02-23T21:44:39-05:00 +--- +This month consisted of a lot of looking for apartments to move to. My fiancee and I live in the Chicago suburbs, but we are growing very tired of them. It is the worst of every world. So we have decided to move into the city. I'll have to deal with a bit of a commute, but it is not bad for Chicago, and I am not planning on going in every day, at least for now. Our current apartment has brought us a lot of anxiety as well. We've both realized how important it is to have community. It isn't easy to make friends in the suburbs, especially during a pandemic. There is a lot more that will be accessible to us in the city. I am looking forward to living near an affordable makerspace. + +Lately at work I've been working on our reservation system. I wrote a plugin system for it that I am pretty proud of, but I know code review will leave me humbled. Writing a plugin framework for a system that is not designed for one forced me to learn a lot about the system. + +I spent some time programming for fun. I have been writing a [Matrix chat bot](https://github.com/Matthew-Klawitter/Matrix-Barista-Bot) with my friend Matt. My latest plugin allows us to clip the last 30 seconds of mumble calls, which I update to a website of sound bites. I've been doing digital spring cleaning as well, getting my directories in order and updating my git repos with anything missing. + +I've been playing some video games. I finished *Inscryption*, which surprised me, and one of my favorite games I've ever played. Everyone says go in completely blind, and this is essential advice. I picked up *Black Mesa* as well, since I am a fan of the Half Life series, though never played the original. Every night I've been reading some of *Leaves of Grass*, and sometimes I add in a [short story](https://standardebooks.org/ebooks/anton-chekhov/short-fiction/constance-garnett) by Chekhov. I spent a few weeks practicing French on duolingo, but have lapsed lately. After the move, I'm planning on looking into adult night classes at the lycée. diff --git a/content/blog/file_hoard.md b/content/blog/file_hoard.md new file mode 100644 index 0000000..5871a18 --- /dev/null +++ b/content/blog/file_hoard.md @@ -0,0 +1,8 @@ +--- +title: "File Hoard Timeline Experiment" +date: 2020-08-10T21:20:13-05:00 +draft: true +--- +If you are like me, you download dumps of strange data archives. I have old ebooks, internet zines, saved web pages, and more that I have saved to my computer for my later usage. This is what I do rather than bookmark an article or video, I’ll manually save it (see my last post on how things do not last very long on the internet). There is a problem with this: it is not very nice to browse huge folders, usually you will check just the first few things. Another problem: even though all of these I’ve downloaded provide me with more content to enjoy than I ever could have time to, I spend almost no time at all enjoying them. Rather, I’d just open up some social network feed (reddit, twitter, hacker news) that does the hard work of curating for me (by telling me what to look at now, and more things will show up later). + +So what is a solution? A local web server that randomly will suggest things for me to check out from my hard drive, and displays them in a timeline format mimicking these popular websites. Instead of opening a link to a website when you click on an item, it runs an OS command to open it in your default application (so audio files open in VLC for me). It works great for me, rather than browsing a social media site, I can check out the content that I decided was interesting enough to save for later. Right now, it does need a few more features. Namely, authentication (so someone doesn’t send a bunch of requests that open a ton of documents on your computer) and filtering (so huge dumps can be ignored). The random algorithm could also be improved, by comparing access times to created times to find obscure files you have never even opened. Overall, it is an interesting project that helps move away from algorithmic and hyper fast content that I find is toxic to my attention span and mental well being. While it is a simple program at the moment, it has a lot of potential for future features. diff --git a/content/blog/games_and_other_updates.md b/content/blog/games_and_other_updates.md new file mode 100644 index 0000000..761e7e0 --- /dev/null +++ b/content/blog/games_and_other_updates.md @@ -0,0 +1,7 @@ +--- +title: "games.marks.kitchen and other updates" +date: 2020-06-13T20:45:45-05:00 +--- +My games website https://games.marks.kitchen is now public. So far, most of the games are either stuff I did a while ago, or simple things like snake and stacker. I am working on a paper airplane game, inspired by Glider Pro on Mac II. + +I also have recently added an [RSS feed](http://localhost:1313/index.xml) for my website. It will notify of posts on blog and bread (the same posts as are sent automatically via email). diff --git a/content/blog/git_forges.md b/content/blog/git_forges.md new file mode 100644 index 0000000..1c16fdc --- /dev/null +++ b/content/blog/git_forges.md @@ -0,0 +1,7 @@ +--- +title: "Git forges" +date: 2020-11-14T21:29:32-05:00 +--- +I've updated my [git server](https://git.marks.kitchen/) and written an [info page](https://git.marks.kitchen/info.html) about it. Check out the info page link for a post about it, I'll leave the post there rather than copy it all to here. + +I've been pretty busy with school projects this semester. I'm taking more courses than normal in an attempt to finish an MS degree this year, and my TA position is also busier this semester. Because of this, I haven't been writing blog posts much, but I expect that once it winds down I will get back into it. diff --git a/content/blog/june_2019_update.md b/content/blog/june_2019_update.md new file mode 100644 index 0000000..b86e75f --- /dev/null +++ b/content/blog/june_2019_update.md @@ -0,0 +1,5 @@ +--- +title: "June 2019 update" +date: 2019-06-08T20:39:31-05:00 +--- +It has been a while since I last posted, but the summer has kept my busy. I've had many issues with HTTPS on my website, and have resolved to temporarily disabling it so that the HTTP version is still available at least. The biggest project I've worked on since my last update has been my Telegram Arcade. I use the Telegram messenger a lot, and one feature that is fun about it is the HTML5 game support. There is incredibly little about this online, I haven't found anyone posting about using this API. After spending a few hours with it, I found it incredibly frustrating, but I got it to work and have tried to make it easier for others to use it as well. A user well sent an inline message to your bot in the form of @ . Your bot will tell Telegram what games to show to the user. They will select one and Telegram sends a message in chat with a link to play that game. By clicking the play button, a request is made to your bot for a URL to play this game, and then the user is redirected to that URL. Your game must communicate with your bot to set the player's score. When a score is set by your bot, Telegram will display it in the chat. My Telegram Arcade tries to take away all the hard work from setting this up. Telegram Arcade is both a telegram bot and a web server for HTML5 games setup in the same directory as the bot. Currently, it has a basic snake game and a stacker game. These games make an HTTP request back to the web server to update the score, but other than this the HTML files are just pure JS canvas games. I had a fun time getting this to work, and while the games I made with the bot are not great, they are a good proof of concept. I hope to get more games on the Telegram API, currently the only games I know of on the platform at hosted by @Gamee and @Gamebot. diff --git a/content/blog/making_of_marks_database.md b/content/blog/making_of_marks_database.md new file mode 100644 index 0000000..8501921 --- /dev/null +++ b/content/blog/making_of_marks_database.md @@ -0,0 +1,15 @@ +--- +title: "The making of marks.database" +date: 2019-04-07T20:36:20-05:00 +--- +I used to keep text files, tracking movies, books, my music collection, and various long term to do lists. Last year, I transferred some of this information over to a MySQL database, managed with a couple python scripts that just wrapped MySQL commands. It was fairly clunky though, and pretty limiting too. Even php myadmin would've been easier. So recently, I created marks.database, which is a node front end for my specific database needs. It manages those things listed above. Additionally, I have created a meal planner section, which allows me to store the items in my pantry and combine them into recipes. + +The program is built on node with vue and sequelize. Not much else is really needed. The CSS is fairly brief, though I might expand it later. Currently, it is just locally run, so performance isn't a big deal. Each update sends back the whole table. + +There are some other things that should be improved about this project. I mentioned that it is running locally. The only requests it accepts are ones from the local IP. This might be a security flaw, and I could instead include an authentication scheme. The project should be organized better too. Each table should be a separate page, but instead it just hides all the non current tabs. + +Working on marks.database taught me a little about design too. Initially, everything was on one page, which quickly became too clunky. With such large datasets it's important to be able to sort and filter. At first, I had the fields to add a new item to a table at the bottom, which was annoying. Every time you added an item, the fields scrolled off the bottom of the screen. With sorted data, you aren't appending to the end, so it works just as well to include the input fields at the top too. Colors to differentiate rows in a table are important too, they make viewing much easier on the eyes. + +I want to expand the database to be able to track my expenses. This will probably have to wait until this summer, where I might get some more free time to work on something like that. The meal planner system could work better too, it should be easy to add an ingredient to your shopping list for example. I also want to be able to sort movies by director, for example. I am happy with the progress that I have made so far on marks.database. + +![My pancake recipe](/img/database.png) diff --git a/content/blog/making_of_marks_kitchen.md b/content/blog/making_of_marks_kitchen.md new file mode 100644 index 0000000..ff223e0 --- /dev/null +++ b/content/blog/making_of_marks_kitchen.md @@ -0,0 +1,11 @@ +--- +title: "The making of marks.kitchen" +date: 2019-03-19T20:13:18-05:00 +--- +While it has been more than one month in the making, for this month's blog entry I'll be talking about how I've pieced it all together. For the most part, it is a pretty standard node server using express, mysql, sequelize (ORM), and a little bit of vue. I originally wanted to have everything be a static webpage, but vue was pretty lightweight. I have considered switching to static webpage generators, but right now I am very happy with the development process. + +I included bootstrap on the website for a while, but I decided against it. I wanted to have a unique look, and using bootstrap gave it that feel a lot of websites have. It wasn't hard to include a little CSS to do a few things I was using bootstrap for anyway. I want to keep the website pretty quick too, and bootstrap really added to the size of a page. + +I set up an admin page that allows me to log in and post to a board. Currently there are bread, index, and blog boards. Right now I'm just posting plain text, with the option to attach images and also tags. I also have page with essays, which is static for now. I'm not sure how I want to organize this section, so I am focusing on other stuff for now. The admin page also collects some statistics about routes. I set a unique cookie when a user starts a session, and I track their requests to the server. The users IP isn't stored, keeping privacy in mind. I'm not doing too much with this data right now, but eventually I could get a better idea of what a user's session typically looks like, and how many sessions are started. + +My goal in starting this website was to have fun. I thought that showing off stuff I baked would be a good excuse to make a website, and I have had a good time making one. It encourages me to build a cool website, and also bake delicious bread. I also want to write more, and this platform offers I good excuse to blog too. I'm going to try to get blog posts out monthly. I'd like to do weekly even, but I know that isn't likely right now. diff --git a/content/blog/mastodon_bot.md b/content/blog/mastodon_bot.md new file mode 100644 index 0000000..e357a8e --- /dev/null +++ b/content/blog/mastodon_bot.md @@ -0,0 +1,19 @@ +--- +title: "My new Masotdon Bot; Writing social media bots" +date: 2020-08-01T21:18:43-05:00 +--- +This week I created my own bot for the social network Mastodon. The idea came about when I was using Hacker News "past" feature, which shows an archive of older posts sorted by date. So, my bot will post each day three times the top posts from one decade in the past. Here is a link so you can check it out: [the bot](https://botsin.space/web/accounts/246078) + +It is interesting and grounding to see what was going on one decade ago. Will the top posts be about some new exciting tech that has since been completely forgotten? Or perhaps some contemporary blog post that still remains insightful? The comments on the articles remain a time capsule of a different internet age. + +This experiment shows how temporary the internet is also. So many of the links are to content that doesn't work. Even if the website is still operating, images or video the articles are often missing. If you want more proof of this, check out your youtube favorites/liked playlists. Odds are it's riddled with [Deleted Video]s, with no information about what was ever in its place. It's a reminder to download anything that you truly wish to keep around. + +## Onto the code + +The [Mastodon.py](https://github.com/halcy/Mastodon.py) library provides a python wrapper for the Mastodon API. The documentation for it provides an OK explanation at setting things up. So to clarify, there is one piece of code it gives to generate a clientcred.secret file. After generating this, you will generate a usercred.secret file. You then use this to log in when you want to use your bot. While this is simple after the fact, it does make it so you have to run separate code to set up the secret files. Here is a link to the source file for my bot, but keep in mind it requires you to have generated the secret files. + +After the setup, you should be ready to use any of the docs to interact with Mastodon as you please. Sending a string as a toot is about as simple as it can be. I generate the string by parsing the HTML from Hacker News with Beautiful Soup, finding the link to the story and the comments. I could not find a way to use the HN API to view past posts, so I am just requesting the web page. Since I am only doing this three times a day, this shouldn't really be be causing any stress on the system. I set it up so the bot takes an argument from 0 to 2, for which post it should use (the first through third). I set up cron to run three separate times, each calling the script with a different argument. This was simpler than parsing which hour of the day went with which post. + +## The Good Old Days + +Writing this bot was very easy for me, and it was nostalgic. In highschool I ran multiple twitter bots that would send out all sorts of things. It has been over 5 years since I last touched social media bots (though I have been working with telegram bots), and my programming skill has improved hundreds of times over. I struggled with understanding the OO paradigm back then, and reading documentation was hard and dense. I am able to look back on my old code with some fondness for how hacked together everything seems, piecing together random bits of various example tutorials. Luckily, I have them all saved, and I know they won't just drop off from the internet ;) diff --git a/content/blog/on_this_day.md b/content/blog/on_this_day.md new file mode 100644 index 0000000..9c86d0b --- /dev/null +++ b/content/blog/on_this_day.md @@ -0,0 +1,13 @@ +--- +title: "On_this_day" +date: 2020-09-27T21:26:09-05:00 +--- +There is this idea of "Daily Devotions," which typically refers to a Christian practice, but I want to extend into other areas of life. In my last post, I talked about a script I wrote that sent me a daily update email with news from 100 years ago via the [Library of Congress newspaper archives](https://chroniclingamerica.loc.gov/). I wanted to add more to the email, and this week I read [Austin Kleon's blog](https://austinkleon.com/2017/10/21/on-this-day/) post on the same theme and it inspired me. I really enjoy seeing something that was meant for today, in a different time, so I extended my daily email with a few more things. Now it includes the daily wikiquote, the wikipedia page for today, and a Calvin and Hobbes comic. Each of these give content meant for a date, but they all are from a different place, and are different kinds of devotions. + +The wikiquote is chosen by a user of the website, and while interesting, quotations do not really have a place on a date. A good quotation is timeless, and so doesn't belong tied down. It is a devotion to some philosophical notion, but usually a shallow one. + +The wikipedia page for today contains a large historical perspective on a date. Everything "important" that has ever happened on a given day is recorded there: events, births, deaths. This gives some factual knowledge to the reader, but again I think it is a bit shallow. It is not insightful to know precisely what day an event happened on usually. + +Comic strips are more interesting to me, since they are mundane. It is an artistic expression, and over time they piece together to form a more meaningful thought. They have stories and plots, and they serve as seasonal reminders. Calvin and Hobbes in specific is very nostalgic to me, and even more so are the winter time series, showing a joyful Calvin enjoying a dreary time of the year. Bill Watterson created something that is entertaining to kids, but with a lot of meaning for adults as well. While comic strips may be pulp, I can understand one in a devotional sense. + +Daily news from 1920 is also mundane, but I would not classify it as artful as comics. Reading contemporary accounts of history helps me stay grounded. In my email, I specifically get "The Belding Banner," which is the closest newspaper to my hometown the Library of Congress had. All the news that affected the people who lived in the same place as me has come and passed with little of it being remembered. It is important to still be able to look through it. It reminds me that so much of what I might be worried about will pass too. diff --git a/content/blog/open_stuff.md b/content/blog/open_stuff.md new file mode 100644 index 0000000..605b516 --- /dev/null +++ b/content/blog/open_stuff.md @@ -0,0 +1,36 @@ +--- +title: "Open stuff" +date: 2022-07-14T20:47:43-05:00 +draft: true +--- +I've been interested in open source software for a long time. When I see some proprietary tool that I think looks useful, I enjoy writing my own version of it. These clones are usually fairly limited, but since I am the sole user of most of these projects, that is fine. They are good enough for what I need and want. + +## Budgeting: + +I have a simple website that stores a table of my transactions. I wrote some basic queries to also have tables by week, month, and year. Prior to this, I wrote an app where I entered the transaction details that would then be sent to myself as an email. I wrote a Google script to scrape my gmail inbox for these emails, and then parse them into a Google spreadsheet. My app was easier to use than entering data into a mobile spreadsheet. While it seems complicated, the underlying programs were fairly simple (~60 lines of Java code for the app, and 25 lines for the Google script). I moved away for this system to both get away from google, and because spreadsheets were not the easiest to work with (I'd rather do the complicated stuff in SQL). + +## Blog: + +I wrote this website with my own backend for a few reasons. I didn't want to be locked into any system like WordPress. It also gave me a chance to learn more about creating web servers and sites. I wanted something with more power than just a static HTML site, and something that would be fun. My original idea was to create a website where I only posted pictures of bread. I expanded this into much more, where I now have a blog, games, and a few other misc. projects. + +## Life Database: + +There were a lot of things I wanted to keep track of my progress with, and so I wrote a website to keep track of them, mainly movies I've seen, books I've read, my music collection, and bookmarks. All of these have popular websites that can be used, but again I wanted to keep my data local. I have been finding myself wanting something even simpler, and in 2020 I have just been managing these things in cherrytree (a hierarchical note taking application). + +## Games: + +I do like to recreate bits of games (simple bits at least). The one that fits best into this blog is Quiz Bunny, which was similar to some ad ridden app game that has the same premise. It took a day to recreate, and it was quite a new program for me. I had not made anything "multiplayer" like it really before. I created the basics of correspondence chess on my website, with a graphical board that you can interact with, however it is still very alpha of a project since the rules of chess are trickier than they seem. + +## Home Weather Station + +Here we get to the real reason for this blog post. I love weather data, and I wanted a home weather station. I wanted to know my home's temperature, pressure, humidity, and the trend of these things. There are many existing products that do this, starting at about $60 for the most basic of items. That's when I considered just building my own station instead. I purchased a Raspberry Pi Zero W, an Adafruit BME280 sensor, and the needed peripherals (SD card, PSU) for just 40 dollars. I used the Adafruit module to connect to the sensor, and logged its data to a file. Then, I wrote a web server in python that plotted this data, so I can view it whenever from my local network. It works great, and I have much more control over this data and how I want to use it than I could with any consumer device. + +This was my first experience with doing any sort of electronics work where I had to create my own circuit. I had to purchase a soldering iron, some wire spools, and other things needed as well for this hobby. These did bring the price up to more than just a consumer device, but now I am past the hurdle of not having supplies. There are other electronics projects I want to tinker with in the future, with the next being setting up a plant monitoring station. + +I love software and computing, but I also want to branch out. The reason I got into programming in high school was because it was free and infinite. Now that I have some disposable income, I can now search for hobbies that are in the "cheap" category, and the hardware community has a lot of help for beginners (knowing programming well helps even more). Electronics is also easy to do in my apartment, in contrast to other things like woodworking. + +![A Raspberry PI zero](/img/pi_zero.png) + +## Content Note + +I'm planning on posting about weekly, inspired by #100DaysToOffload (which is 100 posts in a year). I am aiming for 50 blog posts a year at the moment. My next post will probably be about this. diff --git a/content/blog/podcast_generator.md b/content/blog/podcast_generator.md new file mode 100644 index 0000000..67a94b7 --- /dev/null +++ b/content/blog/podcast_generator.md @@ -0,0 +1,19 @@ +--- +title: "Local Podcast Generator" +date: 2020-08-01T21:22:19-05:00 +--- +A while back I wrote local-podcast-generator as an Android app. It is just a fork of a simple http server that generates an RSS feed for the files in a given directory. There are a few more things I need to work out in it before it is fully released. + +## What is it? + +You give it a directory on your phone, and it creates a podcast feed based on the files in that directory. You can take that feed and add it to your favorite podcast player. It does not recursively explore down the file tree. + +## Why? + +Let's say you have a series of audio lectures or audio books downloaded to your phone. You've tried to listen to them in a media player, like VLC, but this isn't optimal. Media players don't keep track of which episodes you have listened to, and they can lose your place. If you take time off from listening, you can come back to your podcast player and pick up right where you left off. Podcast apps are designed for this type of long form, episodic audio content. + +I've tried to listen to librevox audio files in VLC, but it really is just inferior to a podcast app. That's why librevox offers rss feeds for their audio books. But some of my audio content comes from CDs, and so feeds don't exist for them. Hosting them as an RSS feed seems to be overkill, and would require you to download them over network. Running the podcast generator app keeps everything local. + +## Download + +Get the apk release from here. You should hopefully be able to install that (I'm still figuring out how to build and distribute apk releases, so let me know if there are any issues). diff --git a/content/blog/refactoring_via_synthesis.md b/content/blog/refactoring_via_synthesis.md new file mode 100644 index 0000000..3c1bd72 --- /dev/null +++ b/content/blog/refactoring_via_synthesis.md @@ -0,0 +1,20 @@ +--- +title: "Refactoring via Synthesis" +date: 2020-03-12T20:44:48-05:00 +--- +I finally have released my final project from last semester for my Programming Verification and Synthesis course. I made a frontend for it so it can be used as a web app. (Please be kind with any requests, as it can take a while per each one). The idea is to take a segment of code, and replace it with a shorter one, along with some method declarations. + + +*How to use*: + +The first box is (restricted) java code. Keep to one statement per line, and don't use the compound assignment operators (+=, etc). Avoid for loops and instead use while loops. All variables must be int types, and do not include declarations within the code segment. + +The second box is the set of variables (comma seperated) to check for equality on. After refactoring, the new code will ensure these variables are the same as in the original. By contrast, not all variables may be important after the code body, and so their equality does not matter. + +The third box is the set of java classes that may be used (comma seperated). Works best at calling static methods. There is no way to use a custom class as of now, so you are limited to the standard Java API. + +The fourth box is any delcarations to make for variables. These are variables that should not have values prior to the code segment. + +After clicked refactor, a new body of code will be generated that is equal (ideally) to the original code. + +Check it out here: https://refactoring.marks.kitchen/ diff --git a/content/blog/rotary_phone_running_linux.md b/content/blog/rotary_phone_running_linux.md new file mode 100644 index 0000000..bf74f86 --- /dev/null +++ b/content/blog/rotary_phone_running_linux.md @@ -0,0 +1,276 @@ +--- +title: "Rotary phone running Linux" +date: 2022-04-14T21:52:01-05:00 +--- +# How to connect a vintage rotary phone to raspberry pi (and use it as a wedding guestbook) + +I'm a software engineer, and am not very familiar with the inner workings of +most electronics. I had an idea for using an old rotary phone as a Linux +peripheral device. In this blog post, I'll show you what I learned, and how to +connect an old rotary phone to a Raspberry Pi. + +<iframe src="https://drive.google.com/file/d/1omulMRk71ZLnNeU9ytPbbEzRNth8wofV/preview" width="640" height="480" allow="autoplay"></iframe> + +## Requirements + +To do this project, you won't need any electronics knowledge. It is basically as +simple as unscrewing a few connections, plugging together wires, and taping them +down. I assume you have some knowledge of running Linux programs on the +Raspberry Pi, and in particular a bit of Python experience. + +The materials needed for this project are also simple. + +* First, you will need a Raspberry Pi. You could use a Raspberry Pi zero for + this, but my understanding is that connecting to GPIO on the zero is + trickier. On a normal-sized pi, you can instead use jumper cables. You will + also need an SD card and power supply. +* You will need some wires to connect the componants to your pi. I got some + jumper cables ([these](https://www.adafruit.com/product/4944) and + [these](https://www.adafruit.com/product/1956)). You could use any wires + really. I used the ones mentioned above, and taped them as needed to form a + connection. If you are comfortable soldering, that is fine too. +* To use audio, you will need a [USB audio + adapter](https://www.adafruit.com/product/1475). I have an older pi, which + has a 3.5 mm output jack on the board. If you didn't need audio in, you + could get away with just using that. Any USB audio adapter that works on the + pi should be fine. +* Now, you will need something to plug into the 3.5 mm jacks on the adapter. I + used [these](https://www.adafruit.com/product/4181), which makes it very + easy to connect the phone wires to a 3.5 mm jack. Alternatively, you could + just use an old 3.5 mm cable, and splice it onto the phone's wires. +* You will need a rotary phone. I got mine from an antique store, and I think it + is from the 70s or 80s. Make sure the phone you choose is a rotary phone if + you want to use the dial. There are some phones that appear to have dials, + but the dial does not spin, and the numbers are actually buttons instead. + You probably could get these to work if you tinkered around yourself, but I + have no experience with them. [JWZ + wrote](https://www.jwz.org/blog/2016/01/my-payphone-runs-linux-now/) this + post about using a more modern payphone. If you search ebay for "rotary + phone" you will find lots that fit the bill. +* You will need some screwdrivers to take apart the phone. My phone just uses + regular screws. + +In total, the pi and phone are by far the most expensive part of this project. +Most phones I've seen have been around $40, or more for fancy colors. So +overall, you could probably complete this project on a budget of $45-$100 +depending on your selection of phone, and if you have an old Raspberry Pi lying around. + +An old-fashioned rotary phone is a very simple device. The hook (the button to +know if the phone is picked up) is just a basic button. The rotary dial may seem +complicated, but ultimately, it is just a pair of basic buttons. The speaker and +microphone are just analog audio componants. I'll first describe how each of +these individual parts can be connected to the Raspberry Pi. + +Since I've already done this process on my phone, I don't have photos in +progress, but hopefully it should be self explanitory to take things apart. Your +phone may look different on the inside anyway, but the concepts will likely be +similar. + +The first thing to do is to take your phone apart. No actions here need to be +desctructive, or at least weren't for me. Everything was just unscrewing +connections. I removed as many wires as possible. The ones that are required for +use will be connected to the componants we are interested in a way that can't be +removed. I also took out the bell, since this was very large. It functions via +electromagnet, and I haven't figured out the best way to run it via the Pi. + +## Connecting audio + +The phone handset is connected to the base by 4 wires. These form two pairs, one +for the microphone, and one for the speaker. They operate like a normal analog +audio cable. + +<iframe src="https://drive.google.com/file/d/147yXcljBHC5YustzxSKdR3e3zPz3KHJj/preview" width="640" height="480" allow="autoplay"></iframe> + +I was able to differentiate the pairs by unscrewing the plastic on +the headset, after doing so I could see the color wires that connected to the +speaker, which here are white and green. The remaining wires went to the +microphone. + +<iframe src="https://drive.google.com/file/d/1HXRcyiyssQoM8UFvF867ygjDNpQvtQ4J/preview" width="640" height="480" allow="autoplay"></iframe> + +I used the 3.5 mm clips, +and taped them to these wires. Then I plugged in the 3.5 mm cables into the USB +audio adapter. I plugged this into my laptop, and tested both the microphone and +speaker worked by recording with audacity, and playing a YouTube video. + +My microphone is very clippy, which is to be expected of +something so old. Perhaps your phone will be better. I accidently bought the +wrong adapter here, and needed to add an auxillery cable, so my cables look very +messy. + +<iframe src="https://drive.google.com/file/d/1ngBg4z-gllk_08xzF5WV_9jWlH2iOrN0/preview" width="640" height="480" allow="autoplay"></iframe> + +## Connecting the "hook" + +Next, I wanted to connect the "hook" switch. Basically, this is a button that is +pressed when the phone is set down on the phone, and released when it is picked +up. Under the switch on the phone, there were a series of plates and wires. To +simplify things, I removed all of these wires but two. This actually complicated +things, since it was tricky getting the plates to compress correctly with the +wires missing. I added cardboard to pad the space. + +<iframe src="https://drive.google.com/file/d/1A5NbGSgC4ooElVGK-jb0b8Ix5UW6YQuz/preview" width="640" height="480" allow="autoplay"></iframe> + +I took the two wires, and taped them to jumper cables. Next, I connected them to the +GPIO pins, one to ground, and one to a general purpose pin. I booted my pi, and +ran the following python program to test it worked. + +```python +import RPi.GPIO as GPIO +import time + +BUTTON_GPIO = 24 # Change to the pin you are using +GPIO.setmode(GPIO.BCM) +GPIO.setup(BUTTON_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP) + +while True: + if not GPIO.input(BUTTON_GPIO): + print("phone is on hook") + else: + print("phone is picked up") + time.sleep(1) +``` + +While running it, you can pick up and set down the phone handset to see if the +wires are connected correctly. + +## Connecting the dial + +The dial is the most complex part of the phone, but it basically is just two +buttons. + +<iframe src="https://drive.google.com/file/d/1V9wChq0vLBPAYIcBnffrIViQU8G_i2MN/preview" width="640" height="480" allow="autoplay"></iframe> + +The first here on the left is formed by the green and blue wires. For each +number the dial rotates past, the circuit is closed. For example, if you dial a +4, the plates connected to these wires touch 4 times, and so the Pi sees this as +4 button presses. + +The second button formed by the two white wires is closed while the dial is in +motion. To simplify my wiring, I ignored this button, and instead just timed the +first button, by counting how many times the button is pressed before 0.3 +seconds without any change (to signify the dial reached the end). + +I used tape and jumper cables to connect the green and blue wires to the GPIO on +my Pi. Then I used this program to test the dial is working. It should print +out the number dialed. The `REST_TIME` parameter may need tweaking if your dial +moves very slowly. + +```python +from datetime import datetime, timedelta +import RPi.GPIO as GPIO +import time + +BUTTON_GPIO = 25 # Change to the pin you are using +GPIO.setmode(GPIO.BCM) +GPIO.setup(BUTTON_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP) +REST_TIME = 0.3 # seconds + +rest_start = datetime.now() +count = 0 +printed = True +pressed = True +while True: + # If there is a new press of the button + if not GPIO.input(BUTTON_GPIO): + if not pressed: + # Count how many times the button is pressed + count+=1 + pressed = True + printed = False + else: + # End the current button press + if pressed: + rest_start = datetime.now() + pressed = False + # If it has been REST_TIME seconds since the button was pressed, and we + # haven't printed the result, print it + if datetime.now() - rest_start > timedelta(seconds=REST_TIME) and not printed: + # Only add this dial to queue if we should accept numbers at this time + print(count % 10) # wrap 10 presses to 0 + # Reset values + count = 0 + printed = True + time.sleep(0.01) +``` + +## More programs to try + +From the first two programs, you can get some idea of how to read the dial and +the hook button. To play and record audio, I found the programs `aplay` and +`arecord` work best, and can be easily invoked via Python's subprocess module. +I also like to use `espeak` to have the Pi read text. + +### Wedding Guestbook program + +Here is a simple program to create a wedding guestbook. This is an idea I, and +many others had, as a cool retro thing to have at a wedding reception to have +guests leave recordings at. + +It is very basic, feel free to adjust it to your needs. The way it works is when +someone picks up the phone, the recorder +will start, and save the recording to a timestamped file. When the phone is hung +up, the recording ends. If you want the user to interact with the dial, I +recommend the general purpose phone program listed later. + +Note, this requires you to have the program `arecord` installed. + +```python +import subprocess +import time +import threading + +# Events allow us to wait until a variable is set +phone_hung_up = threading.Event() +phone_hung_up.set() +phone_picked_up = threading.Event() +phone_picked_up.clear() + +# This thread sets the variables based on the status of the "hook" button +class HangUpThread(threading.Thread): + def __init__(self, phone_hung_up, phone_picked_up): + threading.Thread.__init__(self, args=(), kwargs=None) + self.daemon = True + + self.phone_picked_up = phone_picked_up + self.phone_hung_up = phone_hung_up + GPIO.setmode(GPIO.BCM) + GPIO.setup(BUTTON_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP) + + def run(self): + while True: + if not GPIO.input(BUTTON_GPIO): + self.phone.phone_picked_up.clear() + self.phone.phone_hung_up.set() + else: + self.phone.phone_picked_up.set() + self.phone.phone_hung_up.clear() + time.sleep(0.1) + +HangUpThread(phone_hung_up, phone_picked_up).start() +while True: + # Wait until the phone is picked up + phone_picked_up.wait() + # Start the recording process + process = subprocess.Popen(["arecord", f"{datetime.now().strftime('%Y%m%d-%H%M%S')}.wav"]) + # Record until the phone is hung up + phone_hung_up.wait(): + # Kill the process + process.terminate() +``` + +### General purpose phone + +I wrote [this](https://git.marks.kitchen/?p=rotary_pi;a=summary) program that is +a general purpose way to run commands when a number is dialed. For example, you +can dial a specific number, and it will play a song, or read the weather, or let +your record a message. My configuration is similar to the default. I added some +fun Wav file events, such as one to the George's voicemail song from Seinfeld: +``` +52=events.WavEvent /etc/phone/sound/seinfeld.wav +``` + +If you have any questions about this, please email me (check my website's footer +for my address). I've just moved apartments, and so wasn't able to fully verify +all of the sample programs here work perfectly. + diff --git a/content/blog/rotary_phone_video.md b/content/blog/rotary_phone_video.md new file mode 100644 index 0000000..7604f89 --- /dev/null +++ b/content/blog/rotary_phone_video.md @@ -0,0 +1,7 @@ +--- +title: "Raspberry Pi Rotary Phone" +date: 2021-08-15T21:38:56-05:00 +--- +I hooked up a raspberry pi to an old rotary phone. Here is a video showing it off: https://www.youtube.com/watch?v=M4eCrctDMEc + +Sorry for the phone audio being so quiet, I may have to follow up with a different set up. I'll write a blog post/video later showing off the insides, maybe once I get the bell working/a pi zero packaged inside. diff --git a/content/blog/self-hosted.md b/content/blog/self-hosted.md new file mode 100644 index 0000000..2aa43ae --- /dev/null +++ b/content/blog/self-hosted.md @@ -0,0 +1,32 @@ +--- +title: "Self hosting services" +date: 2020-07-27T21:15:50-05:00 +--- +I host a variety of server applications. Some of these are public, like my website, but many are intended just for myself. Self-hosting services allows me to remove the need to use a lot of proprietary websites, and it keeps my data private. Many of my needs started out as local offline applications, and I migrated to using online services that allowed me to use them from anywhere. Setting up servers requires a bit of technical knowledge, but this knowledge is best learned by attempting (and failing) in low stakes environments. The first services I ever ran were twitter bots that ran each day on my raspberry pi model B. These scripts were only a few files total, and if I ever messed up, I could simply reinstall the operating system. + +# VPS vs local server + +I started out with running things off a local server, either a raspberry pi or an old laptop. This appealed to me most, since it was the cheapest. However, now I run most of my things off a VPS (virtual private server) that I rent from DigitalOcean. Running things locally can usually be cheaper, if you have old hardware lying around. Your home network does not usually have a static IP, and so accessing your services from another network can be difficult, not to mention to security risk involved opening ports. While a VPS costs me a monthly fee, I feel more comfort in knowing if my services are attacked, my home computers will be safe. Not having to run my own hardware is nice too, I do not worry about the drive failing on my VPS. In general, I actually run a mix of both. Anything I want to use from any network is on my VPS, and anything I just need at home is run locally. + +# What I host + +## VPS Services + +- marks.kitchen - my personal website +- games.marks.kitchen - games I have made +- database - a frontend for a mysql database I used to keep track of some data. +- budget - a similar frontend I wrote that keeps track of expenses - It has been partially complete for a while, and so the code is not public yet. I intend to have more budgeting features, and to display cool graphs. +- wiki.js - my private wiki - I was using an offline hierarchical notetaker (cherrytree), but was worried about syncing between devices, and I wanted mobile support. I just switched over in the last week to this, and am in the process of copying over old notes. Since there is a tree structure to the notes, and links, I can really use a wiki for anything. Before cherrytree, I just had random txt files all over my hard drive. Some of these remain in hiding to this day. +- tt-rss - an RSS reader - Anytime I read an interesting article, I'll add the website's feed to my reader. I am trying to avoid all types of algorithmically curated content, and using RSS just gives me the items as they come in. There is no algorithm trying to optimize my time on the service. RSS feeds still exist on a lot of websites. Even youtube has RSS feeds for channels. +- kanboard - project management - I use this for keeping track of to do items. Mainly, I use it to keep track of my school assignments, and TA responsibilities. This is helpful when I have a lot on my plate, and I need to plan out deadlines many weeks ahead of time. I also use a text file kept in my home directory for keeping track of to dos, and find when I don't have as much to manage, I prefer the simplicity. +- git - version control - A personal git server running gitea. I just set this up, so I haven't used it much yet. As github is becoming more of a big commercial entity, I find myself wanting to move away from it. Additionally, even with private repos on github, I do not assume my code is actually private. Some things I want an extra layer of hidden-ness on, like personal scripts. Or, there are things that I want copies of (like early CS projects) that don't belong on a public site. +- mailinabox email - email server - I think everything is a little weirded out by how much google knows about us. Email reveals so much personal information, and google is known to scrape it all. Aside from these reasons, it's also just cool to run your own email server. mailinabox takes care of a lot of the hard stuff in setting it up. This does require a seperate VPS. +- nextcloud - files, photos, contacts, calendar. Nextcloud can do just about everything else I used google for. It comes set up with mailinabox. I have all of my photos backed up to it automatically from my phone. + +## Local Services + +- jellyfin - media server - The best open source media player I have found. I run it on my desktop that has all of my media files on it, and I can connect to the server from my phone, my laptop, or my roku. It does both video and audio, though the audio player is not perfect. +- invidious - youtube alternate frontend - Instead of youtube snooping on all of your data and giving in to the algorithm, invidious provides a different look for the website. It is minimal and works fast. I set up my own instance on my desktop so that I could keep my video history private, but I find that things like subscriptions do not automatically update. I hope to fix this problem, but until I do, I am using a firefox extension that redirects youtube videos to invidious. +- pi-hole - content blocker - Blocks trackers and ads before they even get onto your network. It works across all devices. Pi-hole certainly isn't as perfect as an ad blocking extension, but unlike an ad blocker, it can work in non browser applications, and on mobile (though firefox on mobile supports extensions). +- weather station - local weather station - As mentioned a few posts ago, I set up a raspberry pi zero to log some data at my apartment. + diff --git a/content/blog/teaching.md b/content/blog/teaching.md new file mode 100644 index 0000000..79afae5 --- /dev/null +++ b/content/blog/teaching.md @@ -0,0 +1,25 @@ +--- +title: "Thoughts on teaching" +date: 2020-08-22T21:21:18-05:00 +--- +This summer, I taught my first class, an intro to programming (procedural Java) course at my university, for students with no background in the area, open to students of any major. I was a TA for the two semesters prior, and at my undergrad I was a general tutor for the computer science department. However, this summer was my first experience leading a class, and the first time where I was the lecturer. The course was entirely online, which brought more challenges. I wanted to share some of my experiences from this time, and some of my thoughts on teaching in general. + +## Teaching Java + +Java is a great language to learn at first. This may be my bias, as it is also my first language, and so it holds a special place in my heart. Lately, a lot of people suggest Python or Javascript as a first language because they are "easy" to learn. I disagree entirely. Python and Javascript are caught up in fast changing usage, the definition of "pythonic" changes, and so does ECMAScript. If you look up a programming question for one of these languages on stack overflow, you will find so many answers it is overwhelming. Java has less syntactic sugar, and so the syntax is easier to learn. Additionally, in both of these languages, looking up a question will likely instead give you the name of a recommended library function. While learning how to use libraries is important, it is better to start with learning a few in the standard library of the language. Programming beginners are already overwhelmed, and adding in 3rd party libraries extends a programming language too much right away. Lastly, Java is also statically typed. Static typing is great when you are learning programming, since the compiler will offer corrections. + +Teaching Java to start does have some difficulties too. The course got into basics of source code vs byte code, which makes some sense, but Java throws in a virtual machine here too. The class also focused on procedural programming. Java requires you to have a class, which is confusing. Some Java editors automatically add packages, which causes problems with the unit test grading. + +## Creating Lectures + +Creating lectures is difficult. I required the reading for a chapter to be done before the lecture on that chapter. That way, most learning could be done from the reading, and the practice examples in the textbook would reinforce this. Then the lecture would be for clarifying things, going deeper into concepts, and showing examples that would help them with projects. + +My philosophy was to give students a lot of practice seeing code problems. Much of lecture was live coding in front of students. I think the students who did show up live and could ask questions about these examples, benefited the most. It was great when students asked "what if you changed it to..." and we could find out together. As a programming, my instinct is to run code when I have these questions, but this is something that has to be taught. So any question I was asked, I tried to answer by writing code. + +I also focused in lecture on the patterns behind programming. When writing a new method that iterates through an array for example, often there is a similar pattern: initialize a variable, loop through the array, return the variable. Similarly, there are simple patterns for things like using Scanner: import, create the scanner, use the scanner. If students can remember these patterns, they can mix them together to write all the required programs. As they learn more, they begin to understand what these patterns are, once they learn things like what using an instance method really is. + +## Managing people + +I had a few TAs that I worked with, who were my peers in prior semesters. I do not think I managed them very well. Primarily, their job was to hold office hours to help students with homework, and this went fine, though I should have asked for more help with creating assignments and review material. I got these jobs done fine myself, but it may have benefited to have examples created from the minds of multiple people. + +It was also my first time managing students. As a TA, the only conflict I had was with regrade requests. As an instructor, you are exposed to many more situations. Students have emergencies, forget things, and communicate too late. Usually, I was very relaxed with policies. When something came up, I would think of what is the best for the student's education. I find it easy to be a stickler about rules, but very soon into the course I realized this is not helpful for learning. If a student asks for an extension on an assignment they missed, it is better they do it late than not at all, especially in programming, where so much learning comes from the actual practice of programming. diff --git a/content/blog/using_rss.md b/content/blog/using_rss.md new file mode 100644 index 0000000..84f7487 --- /dev/null +++ b/content/blog/using_rss.md @@ -0,0 +1,16 @@ +--- +title: "Using RSS" +date: 2020-11-28T21:30:44-05:00 +draft: true +--- +Today's internet is built around silos: websites want to be the place you have to come to see update. For example: you have to come to Twitter to check out someone's post, and while you are there you may stick around for a while. RSS is different. RSS is a format in which a website publishes its posts, with a specified title, description, a link to the original post, and maybe some other details. You use a program that checks this list regularly, and it will show you when a new item appears, like how your email inbox may show a collection of emails from many sources. + +That's what makes RSS different. Rather than having to check periodically on your own, your reader checks for you. You don't need to check twitter regularly, and while you are there get stuck scrolling recommended items. RSS puts all the new stuff together for you to easily browse at your own pace. + +A lot of sites still support RSS. It's a great way to browse content as well. There are many online feed readers, such as inoreader, feedly, and miniflux. Personally, I host my own version of tt-rss. These services let you sync feeds across devices. There are local only programs like Thunderbird and flym for android that are generally completely free, but don't sync as easily. Email me if you're interested in using tt-rss, and I can give away a few accounts on my instance. + +Once you decide on a reader, you can paste a site's page into the reader to subscribe to it. You can subscribe via an RSS link, which may be included at the bottom of a page, or usually just with the normal URL (the reader will look for an RSS link automatically). Additionally, I have created this Firefox extension which will popup with RSS links on a page: https://addons.mozilla.org/en-US/firefox/addon/rss-bridge-helper/. + +My extension does more than just show normal links. If you search for a public RSS-bridge URL, you can also use it for Twitter, Instagram, and Youtube feeds. These sites don't provide RSS natively, and RSS-bridge is a website that generates feeds for other sites so they work in your feed reader. Youtube does have some native RSS support, but they do not advertise it. + +RSS is a way to decentralize the web again. It can help us move beyond just scrolling on one website controlled by ad-tech businesses. It works in for your interests, rather than forcing you to work within the confines of a particular website. diff --git a/content/blog/wikijscmd.md b/content/blog/wikijscmd.md new file mode 100644 index 0000000..99ff978 --- /dev/null +++ b/content/blog/wikijscmd.md @@ -0,0 +1,9 @@ +--- +title: "wikijscmd" +date: 2020-10-16T21:27:20-05:00 +--- +For my personally wiki I use wiki.js. Prior, I used to use cherrytree, which is a hierarchical note taker. However, I wanted to use it on mobile, and there is no way to do so with cherrytree files. So I looked for personal wikis. I wanted something that would let me make pages private, as I like to use it as a general purpose journal and it does contain private information. wiki.js seemed like a good solution, and it had good mobile support, or, so I thought. + +wiki.js works great on desktop, and you can read pages easily on mobile. The editor on mobile is horrendous. It does not use native editor elements, and so there are many race conditions when typing with a mobile keyboard. It is so laggy and characters do not show up correctly. I have to type very slowly for things to actually work. + +My solution to this problem was creating wikijscmd, which is a command line interface for wiki.js. wiki.js has a graphql API with no documentation, but after spending some time figuring out how to use it, I was able to send these queries from python. I wrote a simple wrapper to create, edit, and view single pages, and also get the path tree. It works very well, and I am actually using it right now to draft this post. It opens your VISUAL editor if set (like how git commit does) for editing, and I do prefer to write things in vim. While it still nice to have the wiki on the web where the formatting is nice and browsing is easy, but I like having a command line version too. In the future, I'm planning on writing some email scripts so that I can send new pages via email, which would make mobile editing very straightforward. diff --git a/content/blog/youtube_alternatives.md b/content/blog/youtube_alternatives.md new file mode 100644 index 0000000..a223799 --- /dev/null +++ b/content/blog/youtube_alternatives.md @@ -0,0 +1,29 @@ +--- +title: "A Journey into YouTube Alternatives" +date: 2020-09-11T21:23:46-05:00 +--- +I watch more YouTube videos than I care to admit. YouTube's site is addicting and distracting. It is so easy for me to spend hours watching videos. I don't want to quite YouTube entirely, but over the last few years I've been trying to find ways to still watch some YouTube videos, mainly from my subscriptions, without getting sucked into the recommendation vortex. On top of this, there is the privacy implication and the act of building up Google's internet empire, but this is for another post. + +## youtube-dl + +If you are techy, you can use the command line tool youtube-dl to download all videos you want to watch and then open them in your media player. This is a fairly annoying workflow in my opinion, and it still requires you to go to unfettered youtube.com in order to find video URLs. I personally find this workflow to be too abrasive to use. + +## youtube-xspf + +Many media players (VLC, MPV) can play from a YouTube URL directly. They can also do this from a playlist (xspf) file. So I created youtube-xspf which will take the generated XML file of your subscriptions from the subscriptions manager and generate a playlist file of videos for you to watch, which you can open in your media player of choice. This actually is a pretty nice way of browsing YouTube, but I still find it a bit clunky. Sometimes the VLC stream doesn't open either, and so you can't watch a video. + +## NewPipe + +The android app NewPipe (available on f-droid) has a pretty similar workflow to the above method, but it uses its own format for feeds rather than xspf. It is a great app, but since its mobile only, I don't see it as a proper solution. NewPipe does a lot more than the xspf solution, like showing comments, descriptions, and some recommendations. + +## Invidious + +This is an alternate frontend to YouTube that recently shut down its main instance (though there are still more listed here https://invidio.us/). It allowed for a YouTube experience on the web without the bloated website. I had issues with running my own instance and managing subscriptions, and so I had to switch to the next solution for my needs. + +## RSS feeds + +YouTube provides RSS feeds for each channel automatically. So one option is to use this in your feed reader of choice. This is my preferred way of managing YouTube currently. I can use my feed reader to sort these items, and I save the feed entries to watch later. I can watch either in my media player or on youtube.com. I've been using this with extra UBlock filters to block out most parts of the website that aren't just the video to keep me focused. This isn't as dogmatic of blocking out YouTube as using a media player, but it does help me change my habits. Instead of going to the home page of YouTube to check for new videos, I just go to my feed reader. It helps me stay less distracted. + +## Peertube + +Alternative video sites seem really cool, but there just isn't enough content at the moment. Perhaps there is, but another problem with these sites is discoverability. It is so easy to find niche interests on YouTube, they are practically shoved down your throat with repeated recommendations. I do follow a few Peertube RSS feeds, but I have not found myself able to rely just on these for entertainment. diff --git a/content/index.md b/content/index.md new file mode 100644 index 0000000..4603676 --- /dev/null +++ b/content/index.md @@ -0,0 +1,19 @@ +--- +title: "Mark's Kitchen" +date: 2022-07-18T20:37:25-05:00 +--- +Welcome to my website! + +Software Projects: +- [Gitweb](https://git.marks.kitchen) +- [GitHub](https://github.com/Mark-Powers) +- [Games](https://games.marks.kitchen/) +- [All projects](/projects) + +Writing +- [Blog](/blog) +- [Wiki](https://wiki.marks.kitchen/public) + +Follow: +- [Mastodon](https://fosstodon.org/@markp) +- [RSS feed](/index.xml) diff --git a/content/projects.md b/content/projects.md new file mode 100644 index 0000000..4a1f480 --- /dev/null +++ b/content/projects.md @@ -0,0 +1,169 @@ +--- +title: "Projects" +date: 2022-07-13T21:26:49-05:00 +--- +# A collection of my projects, mostly programming + +## [Daily RSS Server](https://git.marks.kitchen/?p=daily_rss_server.git;a=summary) + +A server that just hosts an RSS feed. This feed is populated daily with items +that change based on the day, such as upcoming holidays, links to newspaper +comics, and fetching journal entries from historical ebooks. + +*2022-02* + +## [wikijscmd](https://git.marks.kitchen/mark/wikijscmd) + +I use wiki.js for my personal wiki. I wanted a simple client I could use for it +and a command line one would also allow for me to script it. The wiki comes built +in with a GraphQL API, so I learned some GraphQL and created a python wrapper that +allows for managing and editing of wiki.js content over this API. + +*2020-10* + +## [Pi Weather Station](https://git.marks.kitchen/mark/pi-weather-station) + +I set up a sensor on a raspberry pi zero to measure the temperature, pressure, and humidity. +This project is a web site that runs on the pi that plots the data over time. In the +future I'd like to make the plots nicer, and include outdoor temperature data as well. + +*2020-09* + +## [Local Podcast Generator](https://git.marks.kitchen/mark/local-podcast-generator) + +I had some audio files on my phone I wanted to listen to like a podcast. My podcast app is way +better for this type of content than a general purpose media player. So this app will locally +create a web server that serves an rss feed generated from a directory on your phone. This can +be added like any other podcast in your favorite app. + +*2020-09* + +## File Feed + +I found myself wanting to browse social feeds a lot, and wanting new content. +I have a lot of documents on my file of things I haven't explored yet. So this program +tries to merge the two: a generated feed of files on my computer. + +*2020-08* + +## [Games](https://games.marks.kitchen) + +A collection of HTML5 games that I've made. When I have some fun idea, +I'll host it here. It has high scores for some games too, and a scoreboard. +I am pretty proud of how this website turned out, it is what I wanted +to have when I was a kid. + +*2020-04* + +## Backdoor Learning on Models of Code + +A class project where I studied how to poison training datasets of source +code to create backdoors in a model predicting a function name based on +a code body. A backdoor is an inocuous feature that will force a prediction +to a target label. By modifying a small proportion of training data, with +something like adding an unused variable declaration, the backdoor will be +successfully learned. I implemented the Sever algorithm which attempts to +find and remove poisoned data, but it was unsuccessful at doing so on the +code2seq model architecture. + +*2020-04* + +## Multi-level Wavelet-CNN HDR Image Reconstruction from Single Exposures + +A class project that used MWCNNs to reconstruct images. On HDR single exposure +images, white balancing often clips values. The novel wavelet approach was able +to reconstruct image detail in a realistic way. + +## Budget + +My website I made to host manage my budget. It functions a lot like a spreadsheet, +with some more advanced features and an easier interface to use. It is multiuser, +and if you are interested in using it send me an email. + +*2019-12* + +## Synthesis Refactoring + +For class, I did a project using program synthesis to refactor programs. The program tried to +find areas inside source code that could be extracted into methods. It sort of works, and +in the future it could really be improved by using compilers techniques. I also made +web frontend for it. + +*2019-10* + +## Cosmic-Cargo + +A game I worked on with some friends for GBJAM 2019, and is Oregon Trail, in +space. This game was made over the course of a week, and can be played at +[this_link](https://seafarerscafe.itch.io/cosmic-cargo) + +*2019-08* + +## Telegram Plugin Bot + +A custom Telegram bot I wrote in python that allowed for custom plugins. +This made it super easy to add functionality to a bot, and it made +my group chat with friends lively. This project has now been suceeded by a +[rewrite](https://github.com/Mark-Powers/Telegram-Response-Bot-Java) +in Java. It was difficult to manage loading and unloading in Python, and +wrapping the API by hand made it difficult to expand beyond basic messages. + +*2017-11, then 2019-10* + +## Telegram Arcade + +A general purpose bot and web server to play Telegram HTML5 games. +I couldn't find any existing solutions that allowed me to deploy +these games easily, so I wrote my own. The API is not well documented, +and I wrote a bit about it in a blog post. + +*2019-05* + +## marks.database + +A personal database management system I wrote in order to keep track +of a lot of things. I use this as a bookmark manager, a recipe and pantry +organizer, and a way to store lots of other things too. + +*2019-03* + +## Read-Length + +A firefox extension that adds the reading length of a website to the +title of a page. This was my first web extension, and its technique +for finding paragraph content doesn't work great. It works well in +firefox on Ubuntu, as the window bar will display the title with +the updated reading time. + +*2019-02* + +## marks.kitchen + +The engine behind this website. I wanted to learn more about +back-end servers, and creating a way to me to update this +website dynamically. I wrote a blog post about the making. + +*2019-01* + +## Compiler + +A compiler I worked on as an indepedent study during undergrad, +implementing techniques from "Compilers: Principles, Techniques, and Tools". +I also wrote a small stack based [virtual machine](https://github.com/Mark-Powers/stackvm) +that runs the generated code + +*2018-10* + +## Streetcard + +A general purpose card game engine. I wanted to test out some strategies for +card games, so I tried to write an engine for it. I didn't finish it, but +you can play some basic card games in this engine. + +*2017-10* + +## Roguelike + +A rogue-like demo game I made just for fun while I was on winter break one year. + +*2017-01* |