summaryrefslogtreecommitdiff
path: root/md/writeup/linux_keyboard_led.md
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2021-05-28 09:23:32 +0100
committerFreeArtMan <dos21h@gmail.com>2021-05-28 09:23:32 +0100
commit0ab4ab1ef46d6696243ce5a57a4008eebfde1b20 (patch)
treefc539fcc5061aa682c35a8077f80dbc2168005fa /md/writeup/linux_keyboard_led.md
parentefa24b220d9633d5d7bfef632b33df180dcb0e74 (diff)
downloadmd-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.tar.gz
md-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.zip
Update last articles
Diffstat (limited to 'md/writeup/linux_keyboard_led.md')
-rw-r--r--md/writeup/linux_keyboard_led.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/md/writeup/linux_keyboard_led.md b/md/writeup/linux_keyboard_led.md
new file mode 100644
index 0000000..7217244
--- /dev/null
+++ b/md/writeup/linux_keyboard_led.md
@@ -0,0 +1,43 @@
+title: Linux keyboard LED
+keywords: linux,keyboard,led
+
+# Linux keyboard LED
+Send some bytes and flash LED on you keyboards.Run it under root.
+There will no be any errors if something happens.
+
+Usage:
+```
+./kbled [NumLock] [CapsLock] [ScrLock]
+```
+```
+./kbled 0 0 0
+```
+
+```c
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/syscall.h>
+#include <linux/kd.h>
+
+int main( int argc , char **argv )
+{
+ int rc,i;
+ if (argc != 4) exit(0);
+
+ rc = syscall(SYS_open,"/dev/console",O_WRONLY,7*64+7*8+7); //open cosole
+ if (rc == 0) rc = 1;
+
+ i = (argv[1][0]-'0')*2+(argv[2][0]-'0')*4+(argv[3][0]-'0');
+ ioctl( rc , KDSETLED , i );
+
+ return 0;
+}
+```
+
+
+
+
+## Downloads
+kbled.tar.gz -
+1KiB - http://archive.main.lv/files/writeup/linux_keyboard_led/kbled.tar.gz
+