whird.jpope.org cover image

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…

Diaspora* Too many open files

For a little while, I have occasionally noticed that my pod will not send emails out when it's supposed to. If I navigated to the Sidekiq monitor in the admin area, and reprocessed all of the Dead jobs (or at least the email related jobs), the emails would come through. Upon further inspection, I found that it was due to a 'Too many open files' error. This post originally started as a post on my pod so, I'll quote that first: I kept finding ‘Too many open files’ in my Sidekiq dead jobs and in the logs. They were mostly related to getaddrinfo (169 entries) or sendmail (223 entries). Also, emails would fail to send somewhat often from my pod. Took a look at this wiki entry (and the linked article) and hoping I will stop seeing those ‘too many open files’ entries in the logs. Side note, I didn’t find any ‘…open files’ entries in sidekiq.log itself, I ended up running grep "Too many open files" log/*.log to find the entries. Wiki entry: Check for out of open files errors In the dias…

Simple Nodejs Express Server

Just for fun (and because I mentioned to @jonkulp that I would), here is a quick (plus slightly extended) write up on how to spin up a simple nodejs server with express.js. First, install nodejs and npm, it's bundled together in ArchLinux, not sure about other distros. In Debian, it looks like they are split. Also, in Debian, they have decided to rename the node executable to nodejs, which breaks some things. This is due to a package for a Ham Radio program being called node. If you don't have this node installed, you can "fix" nodejs by creating a symlink. $ sudo ln -s /usr/bin/nodejs /usr/bin/node At the time of this writing, here are the versions that I have installed: $ node -v v0.10.22 $ npm -v 1.3.14 Once these are installed, we'll install express globally with: $ sudo npm install -g express Next we need a directory where you would like to run the server so, create a directory where ever and navigate into it. $ mkdir express_server $ cd express_server Express has a built in function to set things up for…

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…

Writing Blog Posts from the Commandline

I ran across a program that will allow you to manage your wordpress posts and pages from the commandline. Enter blogpost. I’m not sure just how often I may need or want to write blog posts from the commandline but, it’s nice to have the option. I can really see it being useful for scripting. Also, this post is more or less me just playing around since this simple test didn’t really let me experience it much. Blogpost uses AsciiDoc as it’s backend for the html formatting for the text that gets sent to WordPress. AsciiDoc has a specific markup syntax that I currently have no experience with but, cheat sheets such as this should be quite helpful. At least I’ve figured out how to emphasize and bold and even monospace as needed. The following image was even uploaded through blogpost. Pretty sweet, eh? The following artist list was added via a script and piped to this post. This list is the top five artists that I’ve listened to in the past seven days. The Walkmen,Bob Marle…

KDE on my Eee

The second stop of my DE/WM hopping found me with KDE on my EeePC as previously stated. The only other time I've actually run KDE installed was for about five minutes before I realized that it just wasn't going to run on my netbook. I can't quite remember when that was but, it had to have been nearly 2.5 years ago. So when I decided to give it a spin this time, I expected much the same. I was extremely surprised to find that not only did it run, it has run quite well on this little box. It's run so well that I may have to come back to KDE on here after all of the hopping is done. I started with another clean install of Arch so that there wouldn't be any conflicting configs laying around from my previous Gnome3 install. And then, I just took the lazy way out and installed the full KDE group. This followed much the same path as I did with the Gnome3 install, providing me with the full KDE experience. After the install and initial configuration, I had the base, base-devel and kde groups installed out of the ma…

DE-WM Hopping

As I stated in my last post, I started doing some Desktop Environment/Window Manager hopping. This started as an urge to do some distro hopping but, seeing that I feel quite at home with Arch, I figured that all I really just wanted to see some other DE and/or WM's. Most everything I'll need will be available in the official Arch repo's or the AUR so, there's no real need to do the distro hopping side of it. Plus, I've already got the Arch dual architecture netinstall on a USB drive, might as well give it something to do. I started using Linux with Ubuntu (8.04) until I started looking for a lighter setup. I then found CrunchBang and switched to it for my main distro. About the same time CrunchBang was moving to a Debian base, I was getting quite tired of the Ubuntu base that I'd always been using and started looking at the mothership, Debian. Somewhere in there, I installed Fedora on my EeePC and ran that for some months. Also, I did quite a bit of distro hopping with a spare partition on my EeePC throughout…

Gnome3 Revisit

I've recently revisited Gnome3 on my EeePC. The last time that I had checked it out was not long after it was initially released with Fedora. Now that version 3.4 was out, and I've gotten a distro hopping urge suddenly, I figured that it was time to see how it's coming along. Also, to be honest, it's not really distro hopping that I want to do as much as it is Desktop Environment/Window Manager hopping. I'll be sticking with Arch for all of my upcoming experiments. In the end, I decided that it's still not for me. It's certainly quite a bit more polished than the initial 3.0 release, still needs quite a few extensions to agree with my workflow and still dogs down my EeePC too much. Last time, I left Gnome3 on it for quite some time. This time, I wasn't planning on leaving it on for very long at all. For this install, I simply installed these three groups: base, base-devel and gnome. I also installed a few items from gnome-extra as well as a few of my favorite/needed applications. This setup could easily be li…

StatusNet - ArchLinux rc.d scripts

This is a quick post to put my rc.d scripts that I use for my StatusNet instances. Both of these scripts, one for micro.jpope.org and the other for matrix.jpope.org, have been working great for me for the past few months. I also have Monit monitoring the daemons and restarting them as necessary via these scripts. My micro instance has four daemons running: queuedaemon, imdaemon, twitterstatusfetcher and synctwitterfriends for the queue, XMPP and the Twitterbridge. The init script for it has a each of these listed just so that I can easily check the status of them. The matrix script only has one daemon, queuedaemon, as that instance is setup much lighter than my main instance. If someone is looking for a quick and simple script, the matrix one will probably be the better choice to start with. Both scripts are pretty much the same aside for the extra few lines to capture the pid's of the extra daemons running For both of these scripts, there are the main config settings at the beginning for StatusNet install p…

Firefox Sync on Arch

As part of my desire to reduce my usage of third parties concerning my online data, I've always wanted to get my own sync server going for Firefox. I had tried this a few different times and had been unsuccessful each time until today. I've mostly been wanting to have one going to further reduce my dependence of third parties in regards to my online data. Of course, this has been mostly been directed at Google but I have extended it to Dropbox and now Mozilla. I don't really have any reasons to dis-trust Mozilla but, the Degooglify attitude shouldn't stop with just Google. If you have the option of fully taking control of your data, I feel that you should. ;) So, looking at starting a FF Sync Server leads to this documentation that Mozilla has. After reading over it again, I realized that the dev setup is very similar to the basic setup of MediaGoblin that I currently have running here. My MediaGoblin setup is using a python server, running on a port which is then redirected to the sub-domain in the Apache…

MediaGoblin - ArchLinux rc.d scripts

I recently moved my MediaGoblin instance from an Amazon EC2 instance (Debian, Nginx) to my server at home, which runs ArchLinux and Apache. After getting my data moved home and the instance up and running, I really needed to create some init scripts. For a bit, I was being lazy and running the separate server pieces in tabs in screen. Which works fine until you reboot and forget to restart the services. Finally, I got around to writing those scripts. The MediaGoblin built in server setup consists of two parts, Python Paste for the basic http serving and Celery for the task processing. You can run these parts as a single process or separately. For the best performance, they should be run as separate processes, especially when you upload video, large images and (in the future) audio. Having these processes separate (along with running Paste in CELERY_ALWAYS_EAGER=false mode) will allow uploads to be processed asynchronously. And from experience, having MediaGoblin running synchronously can kinda drag. Of course…

MySQL Took Over My Hard Drive

Yeah, so it's probably due to misconfiguration on my part but, I ran across an issue where the MySQL binary logs soaked up 83% of the disk space on my server. Of course, at first I didn't realize that was the issue. After looking through various system logs, I moved on to the MySQL logs since I was having issues shutting down and starting MySQL. In the error log found in /var/lib/mysql, I noted that it said something about not having disk space. Wait a minute, the last time I checked I was using well under 5GB of my 20GB partition on my server. A quick 'df -h' confirmed that my root partition was completely full. :/ So to figure out what was using all of my hard drive space, I used this command that will list any files it finds that is over 50MB. # cd / # find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' And that showed me that over 2 dozen files were in the /var/lib/mysql dir, all with filenames like mysql-bin.000001 mysql-bin.000002 mysql-bin.000003 mysql-bin.000004 ... mysql-bi…

Postfix and Dovecot

For future reference, I don't want to loose track of this tutorial for setting up Postfix and Dovecot in Debian. This particular tutorial has been constantly updated over the years, and is currently on the sixth edition. It's wrote very well and does a decent job at explaining the different steps. Unlike most of the how-to's on the same subject that I've read recently... :/ Anyway, here's the link: https://workaround.org/ispmail/squeeze Comments: Ed Recently I setup a homemade e-mail server and wrote a full detailed tutorial that you can find in http://cosmolinux.no-ip.org/raconetlinux2/mail.html using Debian Squeeze, Postfix, Dovecot, SASL, Spamassassin and Squirrel (and a Google account for SMTP relay). I wish it is helpful to someone. D’acord a la llei de propietat intel·lectual, els textos, fotografies, dibuixos, etc. d’altres autors que apareixen en aquesta web tenen únicament finalitat educativa. 2013-08-14 06:42:18 jpope Thanks E…

Curse the Weather - weather for your terminal

Stupid F#@%!n weather… Recently, on a fresh install of <Debian, Fedora, … , was prior to my Arch install> I went on a search for a lightweight weather program. After some time with the Google search box, I came across Curse the Weather. CTW is basically a set of python scripts that pull the weather from weather.com and feed the output to a ncurses frontend. Not much to it but it works great. Just fire up your preferred terminal and you’ve got a nicely formatted weather forecast and current conditions. And seeing that the project doesn’t seem to have any activity since 2004, it’s nice to see that everything still works. Well, not initially if you’ve got python3 installed as I do in my Arch install. But, I ran each of the python scripts through the 2to3 converter and voila, it now works with python3. For 2to3 usage, check this page at python.org. I also created a .desktop file so I’ll show in my menu and/or use as a launcher from the panel. My .desktop file (which uses a faenza-dark icon for t…

Hints on how to check your Linux machine for intrusion

This post is mostly so I don’t lose track of this info. I’ve seen all these listed before but, after any fresh install, I seem to forget them. It’s easy to fall into the ‘I run Linux, I’m safe.’ mindset. The successful attack on kernel.org is a perfect example of why we, as Linux users, are not immune. Anyway, Thanks Greg. I copied and pasted this directly from the source: https://lkml.org/lkml/2011/9/30/425 The compromise of kernel.org and related machines has made it clear that some developers, at least, have had their systems penetrated. As we seek to secure our infrastructure, it is imperative that nobody falls victim to the belief that it cannot happen to them. We all need to check our systems for intrusions. Here are some helpful hints as proposed by a number of developers on how to check to see if your Linux machine might be infected with something: 0. One way to be sure that your system is not compromised is to simply do a clean install; we can all benefit from a new start sometimes. Befor…

Conky Cairo Sidebar

Here is a new conky setup I've put together. Being that I've recently started transitioning my machines to XFCE from OpenBox, I quickly found out that my typical conkys didn't look quite right in XFCE. This is due to the compositor in XFCE not showing transparent backgrounds in conky with the 'own_window_transparent' setting, requiring the 'own_window_argb_visual' and 'own_window_argb_value' settings instead. The argb settings are problematic in conky when you have images in it as it causes the images to have some odd transparencies added to them. Either way, my setups like my LED Sidebar just end up looking like crap. :/ But, this really isn't a problem for a conky hackin' addict like myself. The majority of the credit for this setup goes to londonali1010 as all I did was manipulate her code. :) On EeePC: On laptop (resolution 1024x768): Download archive Click the following links if you want to take a look at the individual files. conkyrc sidebar.lua Here's how to set this up (from the included README fi…

Conky LED Sidebar

Recently, my CrunchBang system (which I have based on Debian testing) had an update for Conky, bringing it up to version 1.8.1. From running this version on my Fedora install on my EeePC and previously building this version from the git repo, I knew that it was going to break my current setup. Since I’ve been running that setup for quite some time, I figured that it was time to create something new anyway. The result is this, a ‘LED’ sidebar: This setup started from my Conky Clock Widget (link) and a system stats widget styled to match the clock. The first row of LED’s signify the day of the week. The second row is the month of the year with the colors of the LED’s roughly representing the northern hemisphere seasons. Blue == Winter, Green == Spring, Red == Summer, Yellow == Autumn. The next two lines are the date, first line being the first digit and the second line being the second digit. I opted to go with the first LED being 1 as opposed to it being 0 as it makes more sense in my brain. The CPU1, CPU2,…

Google Music Beta Review

Here’s the #ToThePoint review: It works really damn well. And here’s the “Would he just get to the damn point” review: Yes, I know. This is a review of a beta product. Many things may change. Many people cannot access it yet. So sue me. Look at this as a point in time overview. Now that there is a proper Linux client for Google Music, I can finally properly use the service. Prior to the Linux client release, the only option to run it on Linux was under WINE. And I find that running anything under WINE to be quite #suboptimal.1 The complete service consists of a desktop client, a web-app and an Android app all designed to move your music collection to the cloud and be available anywhere you happen to find yourself. On the Desktop: The Linux version of the Music Manager comes in both .deb’s and .rpm’s, x86 and x86_64 flavors. My initial install was on my CrunchBang desktop machine, as this is where I’ll be doing the majority of the uploading from. I also installed it on my EeePC, both under CrunchBang…

Gnome Shell Screenshots

Still rockin' the Gnome Shell on my EeePC. Well, at least part time, CrunchBang never leaves my harddrive. ;) I'm using the excellent Atolm Gnome Shell theme by half-left with some extra tweaks by myself to add in some transparency. Also using the Atolm-gtk3 theme by TheDeviantMars and the wallpaper is Road at Dusk. And of course, what would a Linux desktop be without some Conky love, the two Conky widgets are by myself which the clock I have released. I've also got quite a few Gnome Shell extensions installed... Here's a few recent screenshots of my setup: As requested, I have made my tweaked Atolm theme available. In order to use other Gnome Shell themes be sure to have these installed: gnome-shell-extensions-user-theme gnome-tweak-tool You can either use the zip and install it with the tweak tool or extract the tar.gz to ~/.themes/ and use the tweak tool to change the theme. See bottom of post for the file attachments. Enjoy. :D Comments: omns Very nice. I still can't get my head around Gnom…