Lähtökohtana Joelin visio, joka laitettiin Alteille. 2x2m pöydällä on neljä näyttöä vierekkäin ja vastakkain, niin että kaksi tyyppiä tekee jollain tavalla luovaksi katsottua tekemistä niin, että se näkyy koko ajan myös käytävälle. Mahdollista luovaa on esim. grafiikan piirtäminen, kummallisen algoritmin vääntäminen jne. Ständille otetaan mukaan myös valopöntöt, jotka voisi avata Alttien lähiverkkoon samaan tapaan kuin Instansseilla.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- |Parses log file for network card ups and downs. In Liittovaltio we | |
-- have a switch which shuts down all electric equipments in our | |
-- living room, including our network switch. I accidentally | |
-- discovered that when this button is pressed, the intranet interface | |
-- of Moskova is put offline, too. Moskova writes it to kernel log as | |
-- any good server should. The reverse happens when the power is | |
-- resumed. Some example log lines: | |
-- | |
-- > 2011-10-04T23:46:04+0300 eth0: link up, 1000 Mb/s, full duplex, ... | |
-- > 2011-10-05T02:20:42+0300 eth0: link down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TransactionalMap where | |
import Control.Concurrent.STM | |
import Control.Monad (unless) | |
import Data.Map (Map) | |
import qualified Data.Map as M | |
type TransactionalMap k a = TVar (Map k a) | |
newEmptyTransactionalMap :: STM (TransactionalMap k a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- |Pseudorandom generation for ensuring entropy and distribution of | |
-- the bit map. | |
module SlowResponse where | |
import System.Random -- Requires 1.0.1.0 | |
import Data.Word | |
import Data.Bits | |
-- import Data.Tuple (swap) -- Requires base 4.3 | |
import Data.ByteString.Lazy (ByteString) | |
import qualified Data.ByteString.Lazy as B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# | |
# Runs a process for given time (timeout format is same as in | |
# sleep(1)) and terminates it with SIGTERM after timeout occurs. | |
# | |
# Author: Joel Lehtonen <joel.lehtonen@iki.fi> | |
# Keeps some parameters and alters positional parameters | |
TIMEOUT=$1 | |
PROG=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- |Animation file and LED cube definition. This contains the internal | |
-- representation of the animation. The file format is defined | |
-- elsewhere (TODO). The actual implementation is free to stop if it | |
-- can not scale the data when animation file dimensions differ from | |
-- the LED cube. But you may also implement a scaler, if you will. | |
module Animation where | |
import Data.ByteString (ByteString) | |
-- |Animation file, contains animation dimensions, led counts for each |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SYMBOL TABLE: | |
00800100 l d .data 00000000 .data | |
00800126 l d .bss 00000000 .bss | |
0080012c l O .bss 00000004 last_time.1765.1859.1606 | |
00800129 l O .bss 00000002 ticks_volatile.1761.1613 | |
0080012b l O .bss 00000001 cron_running.1629.1753.1604 | |
0080010a l O .data 00000004 next | |
00800738 g O .bss 00000001 brown_x | |
00800739 g O .bss 00000006 worm_pos | |
00800112 g O .data 00000001 playlists_len |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generates 1 second (cont 25 times) long animation of effect number 5 | |
# On background | |
simulavr -G -d atmega328 & | |
# On foreground | |
avr-gdb -batch -x simulator_commands.txt >simulator_output.txt | |
# Stop simulavr | |
kill %1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module KeyValueStorage where | |
import Data.Functor | |
import Control.Concurrent.STM | |
import Data.Text (Text) | |
import Data.Text.Encoding (encodeUtf8) | |
import Data.ByteString.Lazy (ByteString) | |
import qualified Data.ByteString.Lazy.Char8 as B | |
import qualified Data.ByteString.Char8 as BS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Generates email reports from any SQL query. Usage: | |
# | |
# ./mail_sql_report config_file | |
# | |
# This script is not SQL injection safe script and should be run only | |
# with read-only credentials if you want to play sure. This just runs | |
# the SQL as-is. |
OlderNewer