Monitor your cron jobs with Jenkins
by Fred on Feb.02, 2013, under Uncategorized
Have you found yourself having some cron jobs failing for a while before you realize it when checking the user’s mailbox on that machine? How about having a web dashboard that will give you an “at a glance” status of these?
Here comes Jenkins — http://jenkins-ci.org . The tool is java-based. It is a tool that actually monitors automatic builds of java code for example, or watch over cron jobs. It is meant to be part of the Continuous Integration concept.
Let’s create a simple example; We will use this job to capture the console output of a trivial command, ls -l. This is on mac OSX.
Download jenkins from the homepage. Installation is fairly straight forward, and on mac anyway, your browser opens up automatically with http://localhost:8080 to present you with the Jenkins dashboard.
Let’s create a new job in this interface. Select “Monitor an external job” and give a meaningful name. Press OK.

On the next screen, enter a description then save.
If you go back to the dashboard, your newly created job appears and do not present any data yet.

- Open a terminal.
- Set JENKINS_HOME
export JENKINS_HOME=http:/@localhost:8080/
- Find out where your “jenkins-core” file is. The exact name depends on the version you downloaded.
On Max OSX, and in my particular case, it is located at
/Users/Shared/Jenkins/Home/war/WEB-INF/lib/jenkins-core-1.500.jar
Now, we will prepend the actual command we want to monitor with the jenkins java command, and associate it with the job name we created above.
java -jar /Users/Shared/Jenkins/Home/war/WEB-INF/lib/jenkins-core-1.500.jar "List home directory" ls -l

If you now go back to the dashboard and hit refresh, you will see the status change.

Click on the job, and then on the permalink “last build” (if you hover the link, a small pop-up appears)

And there you can see your console output

Therefore, if you were to have a cron jobs that you want to monitor you would just have to follow the same steps, making sure JENKINS_HOME is exported, and the output under the right job name.
And you have it all in a web dashboard!
If you want an example of a well fed dashboard, you can visit apache’s at Apache’s builds website
Netgear WNR2200: firmware upgrade makes bonjour/AFP shares unusable
by Fred on Jan.14, 2013, under Network
For those having a Netgear WNR2200 router and using Apple stuff at home such as AFP shares for your TimeMachine backup needs, please be aware that updating your firmware from 1.0.0.32 to 1.0.1.x will likely make that unusable. It seems that the bonjour discovery is not coming across anymore.
After reverting back to 1.0.0.32 (the actual original firmware), everything came back on.
Your mileage may vary. I’d be interested if you’re impacted or not. Please comment either way, if you have a few spare minutes, and if you were impacted, were you able to fix it? If so, how?
Cheers.
Flash crashing? Possible workaround
by Fred on Jun.10, 2012, under Linux, openSUSE
Flash crashing in FF or GC after some update? (To me, namely flash-player-11.2.202.235-21.1 on my opensuse 12.1 64bits).
Try to edit /etc/adobe/mms.cfg
and change
1 | EnableLinuxHWVideoDecode=1 |
to
1 | EnableLinuxHWVideoDecode=0 |
Restart your browser, and try again.
Install NetApp onCommand on Linux 64bits
by Fred on Feb.16, 2012, under Linux, Netapp
Linux users wanting to use the NetApp onCommand tool on 64bits are granted with the fact that it is not possible to do so.
Since it is a java application, here is a simple workaround that worked for me (opensuse 12.1 64bits – sun’s java).
- Download the linux rpm package.
- Install rpmrebuild
- Launch the following command:
rpmrebuild -e -p sysmgr-setup-2-0R1-linux.rpm
- Edit around l.3726, comment out the line that says exit, something like:
then
echo "ERROR: NetApp OnCommand System Manager 2.0 is not supported on 64-bit Linux"
echo "OVERRIDING !!"
#exit 1;
fi
- Continue and install the rpm.
Go to /opt/NetApp/on_command_system_manager_2.0. If running KDE, start typing ‘netapp’ in your krunner. You should also find it in your menu.
or launch:
java -jar SystemManager.jar
DLNA server with Linux
by Fred on Feb.05, 2012, under Linux
uShare does a great a simple job in quickly setting up a dlna server under Linux.
Under opensuse 12.1:
Update: ushare is available via software.opensuse.org.
Edit the /etc/ushare.conf file, at least these 2 options:
USHARE_DIR=/path/where/you/hold/your/movies ENABLE_DLNA=yes
Then, you can try with an dlna application and you should see a ‘uShare’ share that you can browse and play movies from!
Configure Linux for your OSX Time Machine needs
by Fred on Feb.05, 2012, under Linux
Have a Linux around with some free storage space, and you want to backup your Mac? You can configure your Linux box to just appear in your Mac OSX Time Machine configuration.
I am using Opensuse 12.1 (64bits) here, and the setup is nearly done. Here are just the few extra steps you need to take in order for your Mac to see your storage space and use it as backup. Note that I have done no effort whatsoever to secure the configuration as of now. It functions, but you may want to take it the extra step for added security. This is just a basic setup.
First, let’s tell avahi that you want to advertise a new service. Create a new file, called afpovertcp.service in /etc/avahi/services:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>548</port>
<txt-record>model=PowerMac3,5</txt-record>
</service>
</service-group>
Install the netatalk package, and go configure the afpd.conf file. Go to the end of this file, and uncomment the default line. I had to pass it my actual IP address, because it was not advertising on the right one.
# default: - -tcp -ipaddr 192.168.1.48 -noddp -uamlist uams_dhx.so,uams_dhx2.so -nosavepassword
The rest of this file is commented on my box.
Then, go edit the AppleVolumes.default file in that same folder. At the end, I simply added the path where I wanted my Time Machine backups to go:
/home/fblaise/mnt/WD15/time_machine "tm_backups" options:tm,ea:auto volcharset:UTF8
At this point, you can start your netatalk service:
service netatalk start
(Edit /etc/init.d/netatalk at l.71. The -n switch takes mandatory parameters apparently, but we’re not using the atalk stuff)
if [ x"${AFPD_RUN}" = x"yes" -a -x /usr/sbin/afpd ] ; then
echo -n " Starting afpd ("
echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
-c ${AFPD_MAX_CLIENTS}
#-c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
echo -n ")"
startproc /usr/sbin/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
${AFPD_OPTIONS} \
-c ${AFPD_MAX_CLIENTS}
#-c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}"
rc_status -v
fi
or just start the afpd daemon with no option, just by typing
afpd
as root in a terminal.
You may want to reload the avahi configuration as well with
avahi-daemon -r
Then, go to your Time Machine preferences, and your Linux box should now show up as an option with the path defined above!
Disabling USB in BIOS, but still interrupts?
by Fred on Jan.30, 2012, under Uncategorized
Disabled USB in bios altogether to try to get rid of high interrupts, making computer nearly unusable:
%CPU PID USER COMMAND
6.5 11361 root [kworker/0:0]
4.6 11479 root [kworker/1:0]
2.9 2727 fblaise /usr/lib/thunderbird-9.0/thunderbird-bin
2.2 10609 root [kworker/0:2]
1.8 2301 fblaise /usr/bin/knotify4
1.6 10025 root [kworker/1:3]
1.0 8615 root [kworker/1:1]
10.5 1373 root /usr/bin/X :0 vt7 -nr -nolisten tcp -auth /var/run/xauth/A:0-CDTMZa
0.9 9577 root [kworker/0:1]
(see http://ironman.darthgibus.net/?p=153#comments)
but procinfo still shows interrupts on usb? Is it not honoring the BIOS settings?
irq 0: 23907 timer irq 21: 0 uhci_hcd:usb4
irq 1: 171 i8042 irq 22: 2 ehci_hcd:usb1
Kernel is 3.0.0-13-generic-pae.
Any feedback welcome.
Update: From powertop:
Top causes for wakeups:
47.0% (359.8) PS/2 keyboard/mouse/touchpad interrupt
20.5% (156.8) [Rescheduling interrupts]
It’s driving me nuts… Now on opensuse 12.1 64bits.
btrfs consuming lots of sys cpu time
by Fred on Jan.28, 2012, under btrfs, Linux
fblaise@snowball ~ $ ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
%CPU PID USER COMMAND
7.4 2591 root [flush-btrfs-1]
5.9 905 root [btrfs-endio-0]
4.4 2907 root [btrfs-endio-wri]
4.3 1314 root /usr/bin/X :0 vt7 -nr -nolisten tcp -auth /var/run/xauth/A:0-VjxI1a
2.7 900 root [btrfs-worker-0]
1.7 2106 fblaise /usr/bin/knotify4
1.4 2094 fblaise kwin
0.6 10 root [kworker/0:1]
0.5 3643 fblaise top
And it is only on my /home filesystem… system is currently sitting idle. Wow.
This is on a Linux Mint laptop with 3.0.0-13-generic-pae.
Anyone experienced this?
Talend Studio on Linux: making it look nicer
by Fred on Dec.06, 2011, under Data integration
Doesn’t look like on Mac on Win32, does it?
You can find several howto around, the GTK+ reference here, a GTK+ theme how to.
Create a .gtkrc-eclipse in your home directory, with the following inside:
style "eclipse" {
font_name="Droid Sans 9"
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkExpander::expander_size=10
GtkExpander::expander_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::expander-size=8
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "eclipse"
Then, export the GTK2_RC_FILES variable. Example:
export GTK2_RC_FILES=/home/fblaise/.gtkrc-eclipse
And launch talend or any eclipse-based program. It should look much better.
You will notice that the palette font size doesn’t change, and remains big… I don’t know why it is not changing with the rest. If you have a clue, please post a comment! Thanks.
Fed up of re-opening your ssh sessions after suspend?
by Fred on Nov.29, 2011, under Code and scripts
Every morning, when I come to work, there are a set of machines I need to get connected to. Of course, since I s2d or s2r my laptop overnight, the previous day ssh sessions are lost. Even worse, they take time to actually kick me out to my local prompt.
If you’re using gnome-terminal, you can write a small shell script that will open up these sessions for you. All my servers use private/public keys as login method, so with the help of the ssh-agent, it is a straight through login for all servers.
#!/bin/bash
GT=`which gnome-terminal`
$GT --window --maximize --profile=prod --title="serverprod" -e "ssh server1" \
--tab --profile=prod --title="serverprod2" -e "ssh server1" \
--tab --profile=dev --title="serverdev1" -e "ssh server2" \
--tab --profile=dev --title="serverdev2" -e "ssh server2" \
--tab --title="servertest1" -e "ssh server3" \
--tab --title="servertest2" -e "ssh server3"