Wednesday, April 24, 2013

Apache reverse proxy to redmine

I had all kinds of issues trying to get this to work. I'm trying to proxy from my servers /redmine folder to a container VM running redmine. The problem has been that the container was running redmine in its root folder.

The solution was to tell the container to run redmine in a /redmine folder, from http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI

Simply had to add:
Redmine::Utils::relative_url_root = "/redmine"
to the end of Redmine's environment.rb and restart Apache

Recording test audio

Linux distros I have used have no built in record software which I have wanted in order to test microphone levels before creating screencasts.
In Arch, install the "alsa-utils" package, then you can record/play with the following utilities:

$ # Record 5 seconds of audio, then play it back.
$ arecord -d 5 test-mic.wav
$ aplay test-mic.wav

Thursday, April 18, 2013

VMWare player in Arch Linux

I don't use vmware too often, I prefer VirtualBox, but when I went to start it, it couldn't find kernel headers, I found what looked to be a solution in the Arch wiki (https://wiki.archlinux.org/index.php/Vmware#VMware_module_patches_and_installation) but still had issues. I finally installed the package mentioned in the wiki "wmare-patch" from the AUR repositories and everything was fine.

I will simply need to remember to re run this program each time I have the issue.

# vmware-patch

Wednesday, April 17, 2013

Using netstat

I use
# netstat -pant4
all the time to see what is listening/connected to my computer.
I found some other useful commands I didn't know about at http://openmaniak.com/netstat.php

To display all the opened network sockets (extended informations):
#netstat -aute
-a: All
-u: UDP
-t: TCP
-e: Extended
To display the summary statistics for each protocol
#netstat -s
-s: Summary statistics for each protocol.
To display the extended interfaces statistics:
#netstat -ie
-i: Interface
-e: Extended information

Thursday, April 4, 2013

Parsing columns in BASH

I sometimes need "cut" functionality that works for fields with more than a single space. For instance, I sadly have a script just to kill nepomukindexer because it constantly goes berzerk and uses all my 8gb of ram. 
So I need to parse the process IDs of all the processes that contain the word nepomukindexer (there are hundreds at times).

First try

I figured cut would do the trick.
ps -ef | grep nepomukindexer | cut -d " " -f 5 
This only works if there are exactly 4 spaces between the two fields, and that isn't always the case.

Second try

I still don't understand why sed doesn't seem to work with the "+" regular expression symbol the way I expect. The following seems like it should replace all instances of one or more spaces with a single space, but it does nothing.
ps -ef | grep nepomukindexer | sed 's/ +/ /g'
Edit: I just found a workaround for this. I changed this to
ps -ef | grep nepomukindexer | sed 's/  */ /g'
                                      ^^ two spaces
and it worked, the only difference being the matching part which says match a single space followed by 0 or more additional spaces, and replace the whole mess with a single space.

Third try

The solution I found is to use awk.
ps -ef | grep nepomuk | awk -F" " '{print $2}'
Using this command, I pipe the results through kill and all is well.

Tuesday, April 2, 2013

Blogilo take 2

I've had no luck at all with Blogilo over the past month or two. But I just noticed an item in the Arch AUR called "python-gdata-svn". After installing it, I got a test post to work, so this is my second try. If you see this, then this may be something that needs to be installed in Arch (64 bit anyway) in order for Blogilo to work.

Edit: Seems to work, even allowed me to update my original post. Though truthfully I can't say for sure that its because I installed python-gdata, but it did work immediately afterwards...

Non-blogilo-edit:
Apparently Blogilo is trying to upload some HTML elements that Blogger doesn't care for.
The problem returned so started Blogilo from command line and saw the following output:

blogilo(7501): Could not regexp the id out of the result: "The element type "br" must be terminated by the matching end-tag "</br>"." 
So I switched to HTML view and removed the <div><br></div> but still had issues:
blogilo(7501): Could not regexp the id out of the result: "The element type &quot;br&quot; must be terminated by the matching end-tag &quot;&lt;/br&gt;&quot;."
But I didn't see any "&nbsp" so I quit and restarted and saw a hitherto invisible "&nbsp;" that I removed at which point the post worked. 

Blogging clients: Blogtk, Drivel

After the issues with Blogilo, I installed BloGTK and Drivel. I'm making this post from BloGTK. Setup was similar to that of Blogilo. The interface is pretty similar. There is a place for "tags" but it won't allow me to enter anything.

I have not been able to get "drivel" to successfully log in as of yet.