Welcome to my blog!

 

March 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  

Archives

Annoying Windows Update restart popup

I was working away on my PC today and was getting bugged by the Windows Update restart reminder, having been bitten by its restart in the past I wanted it to leave me alone.

I had stacks of SSH sessions open, web sites and files, it was not the time for a reboot and I didn’t want it to decide to restart when I got up to make a drink.

A quick google search helped me out!  Running this command (from a run prompt or from within a command prompt) will stop the message appearing and allow you to continue working, uninterrupted and reboot when your good and ready.

sc stop wuauserv

Source: Lifehacker

Building RPMs

Here is some advice I found useful when setting up my RPM build environment, and building a basic RPM.  The main source I used, to save reading my book again or the man pages, was Linc Fessenden’s blog and some of Linc’s blog is repeated here for completeness. Thanks Linc!

These instructions should work fine on any CentOS / RHEL / Fedora system.

First off, we need the rpm-build package to be installed. Check and install if needed.
yum install rpm-build

Login to the system as your user account, then make the following directories:


mkdir -p ~/rpm
mkdir -p ~/rpm/BUILD
mkdir -p ~/rpm/RPMS
mkdir -p ~/rpm/SOURCES
mkdir -p ~/rpm/SPECS
mkdir -p ~/rpm/SRPMS
mkdir -p ~/rpm/tmp

And create an ~/.rpmmacros file with the following in it:


%packager Your Name
%_topdir /home/YOUR USERNAME/rpm
%_tmppath /home/YOUR USERNAME/rpm/tmp

Now you need to create a package source code ditectory in the ~/rpm/SOURCES directory. You should name it package name – major revision number. Eg: ~/rpm/SOURCES/robspackage-1. In that directory place all the files that you wish to package in the RPM. I have put “script.sh” in mine.

Once that is done, make a tarball of that directory in the ~/rpm/SOURCES directory named programname-revision.tar.gz. Eg:

cd ~/rpm/SOURCES
tar -czvf rob-1.tar.gz rob-1/

In the ~/rpm/SPECS directory, create a packagename.spec file for your package.
Eg: rob.spec:

Summary: My first rpm package
Name: rob
Version: 1
Release: 1
Source0: rob-1.tar.gz
License: GPL
Group: CustomGroup
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-buildroot
%description
Relevant package description
%prep
%setup -q
%build
%install
install -m 0755 -d $RPM_BUILD_ROOT/opt/rob
install -m 0755 script.sh $RPM_BUILD_ROOT/opt/rob/script.sh
%clean
rm -rf $RPM_BUILD_ROOT
%post
echo ” ”
echo “This will display after rpm installs the package!”
%files
%dir /opt/rob
/opt/rob/script.sh
%changelog
* Wed Feb 24 2010 Rob Jervis
- added something or fixed a bug

* Tue Feb 23 2010 Rob Jervis
- First RPM package of the rob application for EL5

Direct Quote from Linc:
“The install lines tell rpm what to install where and with what permissions. You also have to do any directory creation there as well (the one with the -d in the line).”

“The things after %file are similar in that this tells rpm’s database which files are attached to this package. The %dir signifies a new directory, otherwise the files are listed with their complete paths.”

Now you need to create the package, go to ~/rpm and do “rpmbuild -ba SPECS/rob.spec”.
If your package builds ok, it will end up in the RPMS directory, in this case: ~/rpm/RPMS/noarch/rob-1-1.noarch.rpm.

If it fails to build, first check your spec file carefully. Enjoy!

Video Test!

Here is a test video file, best viewed full screen. This will show you how you can check which release of CentOS your running.

Get the Flash Player to see this player.

Server Upgrade

Having just upgraded the server, JERVIS DOT WS will be back soon!

DNETC System V init Script

This week I was looking into init scripts again, its been a while… Anyhow, I remembered that I had written one for distributed.net’s client app.

I thought I would share it, place in “/etc/init.d/dnetc”. It should work fine on current releases of Fedora, RHEL and CentOS. Its designed for the sysadmin to configure dnetc for that system and then manage its start up and shutdown. (Not a script for end users to be using. )

You will need to change the application path to be the directory you have extracted the into.


#!/bin/bash
#
# dnetc This shell script takes care of starting and stopping distributed.net client
#
# chkconfig: 345 90 12
# description: distributed.net client program, a \
# distributed computing project. The program \
# uses only the computers idle time.
# processname: dnetc

# config: /etc/dnetc/dnetc.ini
# pidfile: /var/run/dnetc.pid

# Get function from functions library
. /etc/init.d/functions

start() {
echo -n “Starting DNET client: ”
/custom/dnetc/dnetc -quiet
touch /var/lock/subsys/dnetc
success $”DNET client startup”
echo
}

stop() {
echo -n “Stopping DNET client: ”
killproc dnetc
rm -f /var/lock/subsys/dnetc
echo
}

# —————————————————————–
case “$1″ in
start)
start
;;
stop)
stop
;;
status)
status dnetc
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $”Usage: $0 {start|stop|restart|reload|status}”
exit 1
esac

exit 0

This script could do with some more work, I did put it together quickly, but this page helped me get it going and its worth looking at if you want to write a System V init script of your own.

Looking forward to Fedora 12!

Fedora 12 release countdown!

Fedora 12 is here!

Wordpress Upgrade 2.7 and 2.7.1

Going back to late last year, I upgraded WordPress to 2.7. It all went will apart from some issues with the TinyMCE visual editor. I read a number of articles including Troubleshooting TinyMCE in WordPress 2.7 and http://wordpress.org/support/topic/224121 with no luck. With no plugins and the default theme, i could not get my editor to run correctly. I decided to put up with it, till i had some more time to investigate.

I found that v2.7.1 has now been released, so I rushed to upgrade. I used the new options in the admin section, “Tools > Upgrade > Automatically Upgrade”. The auto upgrade went briliantly and afterwards my TinyMCE visual editor also started working! Great!

Firefox SSH protocol handler (Linux)

I have a web page that lists servers I need to connect to. This page has several hyper links for each server to key webpages on that host. I wanted to be able to connect using ssh too, at the click of a link. (eg: ssh://myserver.example.com and ssh://user@myserver.example.com)

I started doing a bit of research into this and have been able to set it up!

On Fedora 10:
1. Open Firefox and go to: about:config.
2. Right Click > New > Boolean > Enter the following name “network.protocol-handler.expose.ssh” and then “true”
3. Right Click > New > Boolean > Enter the following name “network.protocol-handler.external.ssh” and then “true”
4. Right Click > New > Boolean > Enter the following name “network.protocol-handler.warn-external.ssh” and then “false”
5. Right Click > New > String > Enter the following name “network.protocol-handler.app.ssh” and then “firefox-ssh.sh”
6. Close Firefox
7. Create a script here (/usr/local/bin/firefox-ssh.sh) with the following in it:

#!/bin/bash
gnome-terminal -e “ssh `echo $1 | sed -e “s/ssh:\/\///”`”
8. Run chmod +x /usr/local/bin/firefox-ssh.sh
9. Open Firefox and go to a link like ssh://myserver.example.com

Fedora 10 boot graphics

Fedora 10 has a nice new boot screen. However, I found that I could only see a basic text loading bar at the bottom of the screen. This is due to graphics card support and from what I have read there will be many more cards supported in F11.

If you can’t wait that long, you can try it out. This does not work on all systems, some systems don’t boot when this parameter is present, but if you would like to try it out, and you know what your up to, add “VGA=0×317” to your boot loader kernel line (at boot time to start with).

Mine looks like this “kernel /vmlinuz-2.6.27.5-117.fc10.x86_64 ro root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rhgb quiet vga=0×317“.

I tried this on my F10 x86_64 system and it looks great, so I have added the change to /etc/grub/grub.conf.

Good work Fedora!

Happy New Year!

Well, better late than never. I thought I would take this chance to set myself some ‘open’ goals for the New Year.

First off I hope to get involved in more FOSS advocacy projects, there are a few about which I hope I can contribute too. As part of this, I am going to get involved with or run a Software Freedom Day Event in September so I will be working towards that over the coming months.

I am also hoping to setup a local user group that can help support and guide people through the world of free software. The aim would be to have the group setup before the software freedom event so that it can be promoted as a source of help and further information. This group would help to form a team to run the event, and would enable people to drop in afterwards to learn more, get help and build a local community that can sustain future events.

Migrate another system. I have two systems at work, (two of many overall) one that runs Windows XP, the other Vista. Well it did until I took a Fedora 10 disk to it.

I do run Linux on some of my desktops and its not my first attempt to migrate this poticular one. Its the easier of the two work systems to do so i decided to give it another go. I am hopeful there will be more success this time. I know of 1 or 2 applications that will require Windows so I am going to build a get out of jail free card Virtual Machine on it. This should allow me to use workarounds if needed rather than to revert the system.

My goal is to have it running Fedora all year, even if I have a Windows VM on it.

I am going to try to blog more this year. It will hopefully be a good way of me to give information to the community that has helped me, and howto’s i have completed things or details of how I have over come issues etc.

So now I guess I should get to it, hope you have a Happy New Year!