Skip to content

Instantly share code, notes, and snippets.

@k-nowicki
Created June 15, 2012 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k-nowicki/2938451 to your computer and use it in GitHub Desktop.
Save k-nowicki/2938451 to your computer and use it in GitHub Desktop.
Linux Lexmark demon killer
#!/usr/bin/env ruby
#puts 'Linux Lexmark demon killer by knowicki'
loop do
ps = `ps aux`.scan(/^\S*\s+.*demond.*lexm.*$/)[0]
if ps
pid = ps.split(' ')[1]
`kill #{pid}`
end
sleep 30
end

Lexmark demon killer

The problem with linux lexmark driver described here frequently causes my Ubuntu to freeze. While I need to use my printer I can't just remove that crap. But there is a solution- killing the demon automatically every time it runs. Don't worry, printer works even if you kill the demon.

##If you have the same problem follow the steps below:

after download move the script to more appropriate location:

sudo mv lex_killer.rb /usr/local/bin/

then give executable permissions:

sudo chmod +x /usr/local/bin/lex_killer.rb

Now you can add this to Startup Applications* by simple GUI (i'm still writing about Ubuntu). The most important field is "Command" of course, so put there:

/usr/bin/lex_killer.rb

You should also fill other fields and name it clearly so you can recognize what is this in the future.

And that's it. After restart everything should be alright.

Requirements

  • Ruby [for root user]

License

Released under the MIT license. Copyright (C) 2012 Karol Nowicki ####*) Note that you need a system-wide ruby installation (or just ruby available for root user) for autorun. If you have not, it will be necessary to call

lex_kill.rb &

from terminal each time you login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment