Skip to content

Instantly share code, notes, and snippets.

View wmealing's full-sized avatar
💭
Take me home, country roads

Wade Mealing wmealing

💭
Take me home, country roads
  • Brisbane
View GitHub Profile
#include <linux/slab.h>
void *ptr1;
void *ptr2;
int init_module()
{
ptr1 = kmalloc( (size_t)255,GFP_KERNEL);
ptr2 = kmalloc( (size_t)255,GFP_KERNEL);
Firstly, imagine every time within a day that football is mentioned by someone else. Secondly, replace it with something that you don't want to hear about every day. Say... Archaeology. Then, think about how an average day would pan out.
So, you awaken to the clock radio. It's 7AM. Just as you awaken, it's time for the news and archaeology already. Not news and other historical investigations, like library restorations or museum openings (unless there's another event happening), but just the news and archaelogy. Malaysian plane is still missing. Pistorius is still on trial. New dig announced in Giza. Ancient Mayan temple discovered. Exciting stuff.
Time for a bite to eat over the morning TV. More news. More archaeology. Yes, you are aware of what is up with the missing plane. Fine. Now the archaeology in video format. Video of people dusting off some skulls and bits of pottery. All well and good, but archaeology isn't your thing. It would be nice to hear about something else. Even when it isn't archaeology
#include <SM.h>
#include <SoftwareSerial.h>
// These are required by the shield in use.
#define BT_RX_PIN 2
#define BT_TX_PIN 3
// Aliases for the PINS that control power to each of the valves
#define CLEAN_WATER_VALVE 4
defmodule Upnpsd do
@inaddr_mcast {239,255,255,250}
@ttl 4
@port 1900
defp setup_socket() do
options = [{:reuseaddr, true}, {:as, :list}]
Socket.UDP.open!(1900, options)
end
#!/bin/bash
# Fedora dependencies: yum install qrencode caca-utils
# Ubuntu dependencies:
# Example: http://i.imgur.com/o8E0D3k.jpg
TMPFILE=`mktemp`
qrencode -m 1 -s 1 "$1" -o $TMPFILE
FILESIZE="$(file $TMPFILE | cut -d, -f2 | cut -d' ' -f2)"
@wmealing
wmealing / gist:ece2a08d3077cbe75d45
Last active August 29, 2015 14:07
Using node_package with relx.
Add node_package to rebar.config
{deps, [
....
{node_package, ".*",
{git, "https://github.com/wmealing/node_package.git", {branch, "develop"}}}
]}.

It may be possible to mitigate by enforcing bash to use privledged mode.

install the bash debuginfo

$ sudo debuginfo-install bash

install systemtap

$ sudo yum install systemtap
@wmealing
wmealing / C-states.md
Last active May 17, 2024 07:53
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

diff --git a/fs/proc/array.c b/fs/proc/array.c
index 25b1ebc..300f52d 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -155,11 +155,27 @@ static inline const char *get_task_state(struct task_struct *tsk)
return *p;
}
+static int count_open_files(struct fdtable *fdt)
+{
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 25b1ebc..3f9de99 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -155,11 +155,27 @@ static inline const char *get_task_state(struct task_struct *tsk)
return *p;
}
+static int count_open_files(struct fdtable *fdt)
+{