whird.jpope.org cover image

mkgif

Earlier today, I posted this post: Listening to Mike Oldfield - Tubular Bells currently. The gif in that post I created from a video taken with my phone using ffmpeg and I really wasn't happy with the result. Which caused me to post this post: I need some better settings to create a #gif from a #video… ffmpeg does alright but, just doing the ffmpeg -i video.mp4 -r 10 video.gif that I’ve been doing makes for some grainy gifs sometimes. It’s a simple and easy to remember command but, I know there has to be a better looking output… After a bit of searching, I ran across this example and I wrote a bash script so I wouldn't have to try to remember the actual ffmpeg commands. It's still a work in progress but, I think the end result is somewhat better than the basic command I was using. See the end of this post for a couple of examples. #!/bin/bash # mkgif # v 0.1 - 2016.03.08 # # License: WTFPL2 # # From example found here: http://superuser.com/a/556031 # also: http://blog.pkh.me/p/21-high-quality-gif-with…

Podwrapper v1.5.1 (...errr make that v1.5.2)

EDIT: I found a bug and fixed it with v1.5.2, the links below have been changed to point to the new version. I released v1.5.1 v1.5.2 of my podwrapper script and until the WIP D* API is further along, I think this is where the script will be for a bit. Since my last post concerning the script, I've done a little refactoring and streamlining along with adding a few more options. If you have multiple D* accounts, you can now specify a config file with the -c flag. Also, when initially setting up the script, you choose a default aspect that your posts will go. You can now override this with the -a flag. If when setting up the script you choose to post privately (i.e. 'All aspects') and you'd like to make a public post, you can add -a public when running the script. You can also override the default with a specific aspect however, at the moment, the API doesn't provide a way to pull your aspect names. You can still post to an aspect with the aspect id number. To get the number, navigate to your contacts page wit…

Posting to Diaspora* via API

In the land if Diaspora*, the news of the work being done on the API yesterday was huge. The lack of a proper API has been a thorn in the side of many people. But, it's finally happening, the API is on it's way. Still, it's a ways off from being complete but, just posting a simple text post is currently doable, at least with cURL. Of course, it's quite a handful of commands to type but, that's easily fixed with a shell script. So, I set about on writing that script. The following was initially posted on D*: Ok, I think this is all working pretty well. Here is my bash script that is basically a wrapper for the steps outlined here. You can check it out at https://code.jpope.org/jpope/podwrapper. Be sure to look over the README. And yes, this post was posted via the script. :D podwrapper A bash script to post to Diaspora* via the WIP API. The API will need to be enabled on the pod you are attempting to post to. See these posts: https://kentshikama.com/posts/6c4b0ff01c090133da7b04015765ae01 https://kentshikam…

Script for mysql backups

Here is my quick mysql backup script that I have used for a couple of years. Posting it here for reference sake... #!/bin/bash ## if run daily (say, via cron) you will end up with a tar file that contains ## a mysqldump of each database on your server. ## the script will also delete backups that are older than two weeks ## ## jpope <jpope at jpope dot org> ## licensed under WTFPL http://www.wtfpl.net/ ## EDIT OPTIONS ## workingdir=/path/to/mysql/backups dte=$(date +%Y%m%d) dbuser=username dbpass=userpassword dbhost=localhost tmpfile=/tmp/databaselist ## END EDIT OPTIONS ## dblist=$(mysql -u$dbuser -p$dbpass -h$dbhost -e"select distinct t.TABLE_SCHEMA \ from information_schema.tables t WHERE t.TABLE_SCHEMA NOT IN ('information_schema','mysql','performance_schema');" \ | grep -v "^+" | sed "s,\t,.," | grep -v TABLE_SCHEMA > $tmpfile) cd $workingdir mkdir $dte cd $dte databases=$( cat $tmpfile | wc -l ) i=1 ## backup databases $dblist while [ $i -le $databases ] do db=$(cat $tmpfile | sed -…

Weather Bots

This has been me off and on the past couple of days: Playing with bash and the wunderground api. Jeremy Pope (jpope)'s status on Sunday, 02-Sep-12 10:13:33 CDT - micro.jpope.org My Matrix bots have been providing me with a few weather details ever since I set that StatusNet instance up. I have a little bash script that will pull the data on a set schedule via cron. Previously, I had been using google's "secret" weather api as it pulled quickly, is easily parsed, didn't require an account and had just the few details that I wanted. Judging from the error message I get when attempting to open the xml feed in my browser, they've blocked my IP and or domain: After a quick search, it turns out the api was shut down. This has also had an effect on my XMPP jsonbot as it uses the google feed for it's weather as well. :( So, now it was time to find another place to pull from. I prefer to pull from an api as opposed to scraping a page somewhere. I really hate having a script fail due to the page being scrape…

Weather Archive

Some time back, I had an archive of the full resolution National radar images. This had started because of me having a script to update my OpenBox desktop wallpaper with the current image every 10 minutes. At one point, I had over 6 months worth of images (at ten minutes apart) which made for a quite cool slideshow. Anyway, at some point, I decided to stop archiving those images and even deleted the whole archive. I recently decided to start this up again but, this time to keep them available for anyone else to (maybe) find some use out of. First things first, I wanted a super simple dynamic photo gallery that I could set up on my web server and came across Bizou. For the most part, this gallery is perfect for this archive due to the fact that the gallery 1) has minimal setup and config 2) is dynamic. I did load a couple of the plugins available for the gallery. Aside from that, it maintains itself. Perfect. Now to populate the gallery. Bash scripts galore to pull the images down, convert the images (if neces…