Skip to content

Instantly share code, notes, and snippets.

View laurelmay's full-sized avatar

Laurel May laurelmay

  • 20:46 (UTC -04:00)
View GitHub Profile
.data
n: .word 8
.text
main:
la t0, n
lw a0, 0(t0)
jal ra, factorial
addi a1, a0, 0
Index: src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
===================================================================
--- src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (revision 76826)
+++ src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (working copy)
@@ -66,7 +66,11 @@
RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr)
{
IPRT_LINUX_SAVE_EFL_AC();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+ bool fRc = access_ok((void *)R3Ptr, 1);
Index: src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
===================================================================
--- src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (revision 76826)
+++ src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c (working copy)
@@ -66,7 +66,7 @@
RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr)
{
IPRT_LINUX_SAVE_EFL_AC();
- bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
+ bool fRc = access_ok((void *)R3Ptr, 1);

CDC Linux Intro

When it comes to competitions, several of the machines the team will be responsible for will running Linux. Often it's older versions of common of Linux distros such as Ubuntu 14.04.

Getting Around

There are very basic commands that will be necessary in order to navigate your machine.

#!/usr/bin/env bash
# Get the info about the current distro
source /etc/os-release
if [ -z $UBUNTU_CODENAME ]; then
echo "Not on Ubuntu."
exit 1
fi
@laurelmay
laurelmay / test.py
Last active December 24, 2017 04:27
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')
from gi.repository import Gtk, Vte
from gi.repository import GLib
import os
import platform
import re
@laurelmay
laurelmay / travis-demo-snippets.txt
Last active February 14, 2017 22:16
Snippets for use during the Travis demo
For this, copy everything BETWEEN (NOT including) the --- BEGIN --- and --- END --- for each section.
--- BEGIN Pelican File Header ---
Title: POST TITLE
Date: 2017-02-14 10:56
Modified: 2017-02-14 10:56
Category: CATEGORY
Tags: TAG1, TAG2
Slug: slug-url
Authors: NAME
/**
* Represents a 10-digit North American phone number.
*
* @author Kyle
* @version 1/20/16
*/
public class PhoneNumber {
private int areaCode;
private int exchange;
private int extension;
/**
* A list of all 50 states (plus DC) and their abbreviations.
*
* @author kyle
* @version 1/20/16
*/
public enum State {
ALABAMA ("Alabama", "AL"),
ALASKA ("Alaska", "AZ"),
ARKANSAS ("Arkansas", "AK"),