(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| 1. Execute make first. This will result in a netlinkKernel.ko output among many others. | |
| 2. Execute $ gcc netlinkUser.c -o netlinkUser | |
| 3. Insert kernel module by :$ sudo insmod netlinkKernel.ko | |
| 4. Run ./netlinkUser to see message and run dmesg to see debug messages | |
| 5. Remove module by : $ sudo rmmod netlinkKernel | |
| 6. Finally make clean to remove output files. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #include <linux/serial.h> | |
| #include <stdio.h> | |
| #include <fcntl.h> | |
| #include <errno.h> | |
| #define TIOCGRS485 0x542E | |
| #define TIOCSRS485 0x542F | |
| int main(void) { | |
| struct serial_rs485 rs485conf; |
A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.
As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| # Find your micro SD card using lsblk - you're going to want to set your DISK parameter to it. | |
| export DISK=/dev/mmcblk0 | |
| sudo dd if=/dev/zero of=${DISK} bs=1M count=16 | |
| sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__ | |
| 1,48,0xE,* | |
| ,,,- | |
| __EOF__ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000libnfc supports UUID writable cards and even has some dedicated tools for them.
However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.
Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.
The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):
// Try to write the trailer
| #include <linux/module.h> | |
| #include <linux/kernel.h> | |
| #include <linux/workqueue.h> | |
| static void mykmod_work_handler(struct work_struct *w); | |
| static struct workqueue_struct *wq = 0; | |
| static DECLARE_DELAYED_WORK(mykmod_work, mykmod_work_handler); | |
| static unsigned long onesec; |