Skip to content

Instantly share code, notes, and snippets.

@irl
irl / setup.sh
Last active November 3, 2024 15:32
Setting up a Python environment with ECH
# Download and install the OpenSSL fork and CPython fork
PROJECT_DIR=$HOME/code
mkdir -p $PROJECT_DIR
cd $PROJECT_DIR
git clone https://github.com/defo-project/openssl.git openssl-defo-src
pushd openssl-defo-src
./config --libdir=lib --prefix=$PROJECT_DIR/openssl-defo
make -j8 && make install_sw
popd
#define zenburn_fg #dcdccc
#define zenburn_bg_1 #282828
#define zenburn_bg #3f3f3f
#define zenburn_bg_01 #4f4f4f
#define zenburn_bg_02 #5f5f5f
#define zenburn_black #000000
#define zenburn_blue_01 #94bff3
#define zenburn_blue #8cd0d3
#!/bin/ksh
set -e
[ $# -ge 1 ] || (echo "usage: $1 [update|kernel]"; exit 1)
function update {
echo "Updating xenocara..."
(cd /usr/xenocara && cvs up -Pd)
}
@irl
irl / scramble.c
Created October 31, 2019 20:51
file scrambler
#include <stdio.h>
int
main(int argc, char **argv)
{
int c, r;
r = 0;
while ((c = getc(stdin)) != EOF) {
r = (13 * r + 249) & 0xff;
putc(c ^ r, stdout);
@irl
irl / helper.py
Created January 16, 2015 23:46
BeamerBot
# Import some necessary libraries.
import socket, collections
lines = collections.deque(maxlen=10)
for x in range(0, 10):
lines.append("")
# Some basic variables used to configure the bot
server = "irc.freenode.net" # Server
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option drop_invalid '1'
option synflood_protect '1'
option synflood_rate '200/s'
option synflood_burst '500'
option tcp_ecn '1'
/*
* Copyright (c) 2014, Iain R. Learmonth.
* All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@irl
irl / ab24-plot-temps-machine.r
Created May 2, 2013 06:12
Honours Project Data Analysis in R
library(rrdf)
g <- load.rdf("sparql.rdf")
rs <- sparql.rdf(g, "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX qudt: <http://qudt.org/1.1/schema/qudt#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ssn: <http://purl.oclc.org/NET/ssnx/ssn#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?temperature ?time WHERE {
?sensor rdf:type <http://uktemp.net/ont/#WundergroundTemperatureSensingDevice> .
?observation ssn:observedProperty <http://uktemp.net/dataset/temperature/AB24> .
@irl
irl / .zshrc
Last active November 11, 2021 00:08
My .zshrc file
#!/usr/bin/env zsh
### Fix rxvt to work on machines that don't know about
### the 256color variant
if [ $TERM = "rxvt-unicode-256color" ]; then
export TERM="rxvt-unicode"
fi
### History settings