Skip to content

Instantly share code, notes, and snippets.

@tonyho
tonyho / openwrt-qemu.md
Created Jun 6, 2020 — forked from extremecoders-re/openwrt-qemu.md
Running OpenWRT ARM under QEMU
View openwrt-qemu.md

Environment

The steps shown below are done on a Ubuntu VM using Qemu 3.0

$ qemu-system-arm -version
QEMU emulator version 3.0.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

To quit Qemu at any time press Ctrl+a x, i.e. Ctrl+a and then x

View Instructions
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.
@tonyho
tonyho / showForegroundNotification.java
Created Aug 15, 2016 — forked from kristopherjohnson/showForegroundNotification.java
Shows a foreground notification for an Android service. Tapping the notification will display the app as if it was tapped in application launcher
View showForegroundNotification.java
private static final int NOTIFICATION_ID = 1;
private void showForegroundNotification(String contentText) {
// Create intent that will bring our app to the front, as if it was tapped in the app
// launcher
Intent showTaskIntent = new Intent(getApplicationContext(), MyMainActivity.class);
showTaskIntent.setAction(Intent.ACTION_MAIN);
showTaskIntent.addCategory(Intent.CATEGORY_LAUNCHER);
showTaskIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);