Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created June 14, 2015 23:22
Show Gist options
  • Save gr33n7007h/a2ec3593d8a9c72f5a75 to your computer and use it in GitHub Desktop.
Save gr33n7007h/a2ec3593d8a9c72f5a75 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# man ioctl_list | grep KDSETLED
KDSETLED = 0x00004B32
begin
# needs root privs
loop{ open('/dev/console').ioctl(KDSETLED, rand(0..8)) }
rescue Errno::EACCES
STDERR.puts "needs root privs to run"
exit -1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment