elly was written during the holidays, it will probably get fixes/features after some real world usage. A small retrospective:
/decisions
folder)
<dialog/>
.
Amazing that this now exists. No deps/configuration needed, and ::backdrop
is a perfect partner.Prior art: Gitlab variant (gitlab-mr-bot)
gitlab-mr-bot
was used as a one-off script, storing state in SQLite, for
others to query.
To set up Neovim as the default reader for when you invoke man apropos
etc., place the following code in your ~/.bashrc or such:
export MANPAGER="nvim -c 'set ft=man' -"
There are some more pointers in the short and readable section of the Neovim manual on viewing man pages.
]]>You can login at the regular web application at https://instagram.com and right-click/inspect your way to the actual URI of the image file. Manually downloading one photo at a time soon becomes boring though, let’s look for other alternatives.
There are a couple of sites that promote applications that does the job for you. The ones I saw wanted my username and password, which is out of the question.
Let’s try to do download the images ourselves instead, from an environment we control, our desktop.
The rest of this blog post assumes that you are using Linux or macOS (for cron
and regular CLI tools), and have python installed (for the scraping program).
There’s an easy to use scraper by Richard Arcega called Instagram Scraper that we will use (version 1.5.18 at the time of writing). The scraper is available on pypi, and you install it with:
The next thing we are going to do is to configure who you are and which profiles you want to download. You do that by creating a text file:
Let’s try it out:
If you’ve got image files in the folder referred to by --destination
, you are home free.
To avoid executing the above command manually, we use cron to fetch new images for us.
This is what a my crontab looks like:
To edit your own crontab, use the command crontab -e
.
If you need to learn the syntax of cron, there’s a handy form at https://crontab.guru/ that could help you.
I use a minimal image viewer called sxiv which is available in the default repos of, at least, Fedora.
The following command let’s you view all recently downloaded images:
where the first argument to find
is the value of --destination
in your configuration, and -10
let’s you view images from the last ten days.
All images uploaded to Instagram, even by those with their profiles set to private, are publicly accessible. Getting to know the URI is the only problem, that’s why we use the scraping application, to find the correct URIs. Even though the URIs themselves do not require being authenticated to download, there may be rate limits or other counter measures against downloading images in bulk.
pip install --user
instead.cd
-ing!$
and !!
expansion before execution**
virtualenv makes sure you lockdown your project’s main directory and all subdirectories of it. This ‘lockdown’ means that you never touches your global python binary, or any globally installed libraries (like “sudo pip install flask” ).
Once locked down, you install all packages again, even those you have globally installed. This enables you to have one version of flask globally installed, but another version in your project. All dependencies can be listed in a separate file and validate a precise environment for you to work with. Tightly controlled dependencies is key to a deployment without surprises.
Jenkins is a CI server which means it does a lot of repeating stuff so you can focus on doing more important stuff. More specifically, it listens for changes to your project’s version control system (like git).
When changes are detected, the project is built and the test suite is executed. If any step fails, the CI server tells you that it did.
Jenkins needs some massaging before it handles the hijacked environment of virtualenv. This is how I did it for my local git repository:
and
You need to add a git hook which triggers a Jenkins build:
Add an erroneous test, this will do:
You should see a new build being queued up in Jenkins within a minute. If that doesn’t work, execute the hook and watch the output for error messages:
Now, Jenkins should try to test your project but fail, and report the failure through the GUI. Tada.
]]>On OS X, you’ll find youtube-dl through homebrew.
]]>Have a scope and tell me what it is in a couple of sentences.
Let me learn the general approach and edge cases via a concise and result oriented documentation.
Scream at me when I did something wrong and, if I was close enough (and you have a lot of time), point me in the right direction.
For example, when treating errors you shouldn’t alternate between simultaneous ways of telling your users something went wrong. Pick one and go with it.
If there’s a parameter that can be made abundant - toss it away or promote all other parameters before that one. Read John Resig’s post that led to jQuery for a good monolog.
Likewise, when your interface really depends on something, say so up front. Be it a library, variables or authentication - requirements can’t show up five pages into the documentation or client code.
]]>I think the syntax is much cleaner than that of getopt’s as well – that is, if you’ve even got a bash version supporting getopt.
Edit: Thanks Willem D’Haese for pointing out the missing esac
.
nohup
with the additional possibility of attaching to the terminal session again, once your ssh session was aborted (or equivalent).
screen | Create a new screen |
screen -S name | Create a new screen named "name" |
screen -ls | List screens |
screen -D | Detach from screen |
screen -r | Attach to the single existing screen |
screen -r 4262 | Attach to the detached screen with pid 4262 |
screen -x 4262 | Reattach to the attached screen with pid 4262 |
ctrl+a c | Create a new terminal in the current screen |
ctrl+a H | Log all output of current screen to a log file |
ctrl+a space | Change terminals within current screen |
ctrl+a :sessionname name | Rename current screen to "name" |
ctrl+a d | Detach from current screen, like exit but keeps the terminal for reattaching later on |
My solution to getting an overview was to setup gitweb locally, which makes for a very fast solution. This is how you do it on your OS X-machine:
Find where git’s installed at. I use homebrew, which means git (by default) resides in /usr/local/Cellar/git.
Grab the gitweb cgi, copy it to where your local Apache server can find it:
Now, visit & bookmark http://localhost/cgi-bin/gitweb.cgi in your browser and you should be good to go.
]]>