WordPress Password Resets via MySQL

I have not completed the switch away from WordPress completely, (as this site and the justCheckers site show). I might switch to using something like Django CMS or Wagtail. Unfortunately I have not had as much time as I’d like to, to work on Rookeries, my own Flask based CMS

Still in the meantime, I managed to accidentally lock myself out of my own WordPress sites. Thankfully there are a few ways to reset passwords in WordPress. The most surefire way I found was to reset the password using MySQL. (Using the wp-cli tools looks interesting, but I didn’t feel like setting up get another PHP tool.) Most of the time you don’t need to do this. However if you’ve managed to forget your only admin password… well this will get you out of that problem. So what does resetting a WordPress password via MySQL, you ask?

  1. Log into your server via SSH (or to MySQL via a SSH tunnel if you have that enabled)
  2. Login into MySQL: mysql -u $MY_DB_USER -p
  3. Get the username if you have not already. You can look those up in the ${MY_WP_SUFFIX}_wp_users table.
  4. Finally reset the password, using the MD5() function and an update SQL statement: UPDATE "wp_users" SET "user_pass" = MD5('new_password') WHERE "wp_users"."user_login"= "username";
  5. Log in with the user using the regular WordPress login (e.g. https://my-wordpress.example.com/wp-login.php). Remember to change the password, as that will use a stronger hash than MD5 internally and is more secure.

And there you go!

Notify Me when Done “X” in KDE

One of the few Java webapps I work on at work, has a very long startup time. Unfortunately since the server startup code is proprietary and owned by the vendor, there is not much I can do about that. However it is easy to forget to check if the server has started up, I decided to that I needed a way for my computer to notify me that the webapp was up. Here is how I came up with a simple and quick way to do just that in KDE.

So my webapp has an health endpoint that can be easily queried via HTTP. With httpie the HTTP query was very easy, however to script httpie to keep querying until the result came back, meaning the server was up. At first I tried do a while with negation of the return code, and then I found on StackOverflow that the bash until command will do just that. (Without needing to figure out the appropriate negation).

The second part was figuring how to create notifications in KDE via the console. Turns out that kdialog will create both notifications and general popup alerts.

Putting the two together I came up:

until http :8080/my_health_endpoint; do echo 'Waiting...'; sleep 10; done; kdialog --passivepopup "Ready to go!" 10`

I added a sleep in there, to throttle the number of times that httpie would run. The second parameter on the kdialog dictates how long the notification popup will be around. Alternatively I could of used --msgbox if I wanted a dialog that I had to press ‘OK’ on.

Resources

Approaching Inbox Zero in Gmail

Earlier this year (yes I meant to send this out much earlier) I went to a meetup hosted by my local PyLadies group. There Tracy Osborn of Wedding Lovely and Hello Web App fame gave an amazing talk about marketing for developers. I was truly inspired by the talk, and I feel it was very relevant for me, especially as I try to launch my first product and startup Amber Penguin Software. I could write a series of blog posts just on the content from this one meetup alone, and I probably will over time. But today I’ll focus on one thing in particular that I’ve learned from Tracy.

Getting to Inbox Zero

Nowadays I try to not organize my day to day tasks, by either my inbox or even one of my many, many Trello boards. Rather I try to bite off a few urgent and important tasks each day. Still I end up spending time on tasks initiated from emails in my email inbox. Unfortunately my inboxes seems to fill up faster than I can manage them at times. I would love to have a clean inbox as in Inbox Zero technique but more importantly I want to be much more responsive to the emails I get. Also opening up my email can be overwhelming when I see the number of emails in my inbox.

Using Multiple Inboxes in Gmail

One of the things I learned after the meetup, while browsing Tracy’s site was a technique to get my inbox under control at least in Gmail. In essence, you need to enable the “Multiple Inboxes” lab experiment in the Gmail Labs settings. Then you need to write a few filters such as is:drafts || label:follow-up (which happens to be my filter for follow-up emails) for each particular inbox. Et voilĂ ! You have a much more manageable inbox that is subdivided into categories, and the actions you need to take.

Where it works and where it doesn’t work

Unfortunate this technique only works in Gmail at the moment. Some other webmail providers maybe have a similar multiple inbox solution, but unfortunately ProtonMail does not but it is a suggested feature. So my ProtonMail will probably lag behind in terms of how quickly I respond, unless I or someone else implements the multiple inbox feature in ProtonMail.

However where I can use multiple inboxes like in my Amber Penguin Software email (managed by Gmail) it has drastically improved my email experience and my own responsiveness. My Gmail still needs some love to get everything under control, but once I do I will be much better at replying to emails. Ultimately this technique helps you become more confident in categorizing your email, and then acting up on it when the time comes.

Post PyCon, ebook and Freelancing Plans

PyCon US 2017 has come and gone, and the past few weeks have been busy with renovations and family related activities. So I have not been able to write as much as I’d like to. But now life is starting to gain some normality, and I look forward to more regular blogging.

I really enjoyed PyCon this year. I ended up spending a lot of time in the so-called hallway track, meeting old friends, new folks and learning about interesting projects and companies. I still have quite a large queue of talks to watch on Youtube on the PyCon 2017 channel. I did get to talk to Guido, and ask him about how one should approach development with the new async/await functionality in Python 3. In general, I am floored how friendly everyone was, and how many amazing conversations I had.

I stuck around for the coding sprints, as I try to for every PyCon. I worked on APIStar (a cool new simple Python 3 web framework that uses type annotations), Paramiko and Ansible, and managed to be fairly productive. A bunch of PRs were addressed in the docker_* modules for Ansible. Paramiko finally got some Flake8 love. And APIStar now has better support for reverse routing.)

Aside from meeting with people, I enjoyed spending time in and around Portland. I do have to hand it to Portlanders, they have a lot of great restaurants and micro-breweries. Some of my friends involved in Fabric fact got me on the Untappd app just to keep track of the various brews I got a chance to try out. Another pleasant surprise was the swing dancing scene in Portland, especially everyone involved with Stumptown Dance. But definitely the most fun I had was visiting some friends I made in Portland, and also hiking outside of Portland. (Namely going to the Pacific Coast, and the various falls around Multnomah Falls.)

I do miss Portland, and I do hope to be back there sometime in the near future. In the meantime, I plan on trying something new. While my attempts at building a product have been informative, they have stalled simply because of the amount of work and long time of getting to market. So I’ll be trying something new: I’m open to working freelance on mobile (Kivy), Python web app and API projects through my startup: Amber Penguin Software. Feel to contact me if you have an interesting projects that you’d like me to work on.

More important I will be working on an ebook about two modern web dev tools that I use: (jq and httpie). If there is interest in this ebook, then I have ideas for other ones on Kivy, Ansible and Docker. If you are interested, please subscribe to the mailing list using the form below and I’ll keep you up to date on my progress. I will also be doing this through my startup just to keep things organized, and to enable me to bring on people as needed.