Skip to content

Instantly share code, notes, and snippets.

View rizo's full-sized avatar

Rizo rizo

  • Porto (Portugal)
View GitHub Profile
@rizo
rizo / type.d
Last active December 18, 2015 08:09
Each entry in the knowledge processing engine is called a 'document'. Each document may be composed of multiple data objects, such as images, embedded audio files or text fragments, to list a few. Although the engine is fully content agnostic the official environment system distribution includes some fundamental types that are used internally to…
module core.data.type;
// Enumeration of the core hierarchy types.
enum : string
{
item = "core.item", // Abstract item.
list = "core.item.list", // Abstract List of items.
file = "core.item.file", // Filesystem object.
link = "core.item.link", // A reference to an item.
data = "core.item.data", // Binary data object.
@rizo
rizo / colors.py
Created June 20, 2013 20:26
Small python module for terminal colors usage.
__all__ = [
"color", "black", "dark_gray", "light_gray", "blue", "light_blue",
"green", "light_green", "cyan", "light_cyan", "red", "light_red",
"purple", "light_purple", "yellow", "brown", "white"
]
import os
# --------------------------------------------------------------------------- #

Installation

FreeBSD

portmaster irc/irssi
portmaster irc/irssi-xmpp

OS X

brew install irssi

@rizo
rizo / om.d
Last active December 22, 2015 22:39
//! An abstract object.
class object_t
{
id_t id;
}
//! Ececutable object.
class code_object_t
@rizo
rizo / info-agent.md
Created October 5, 2013 19:29
Essay on Information Agents.
  • info agent is a semantic assistant that manages user's data. It collects data from a large variety of sources and tries to understand it by identifying objects and defining relations between them.
@rizo
rizo / plist-util.md
Last active August 27, 2024 03:41
Convert new plist files between XML and binary

Apple has introduced a new .plist file format in 10.4. You'll notice that you can no longer just edit a .plist file in TextEdit or other text editors. The reason for this is that the files are now binary rather than raw XML.

Luckily for us, there is a command line utility called plutil that can convert back and forth between the two formats. You can convert the .plist file you want to edit to XML format, edit it in TextEdit, then convert back to binary for use. To convert a binary .plist file to XML format for editing, type this in the Terminal:

plutil -convert xml1 some_file.plist

To convert an XML .plist file to binary for use:

plutil -convert binary1 some_other_file.plist
@rizo
rizo / gist:7517044
Last active December 28, 2015 14:49 — forked from idan/gist:3135754

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

What about some Ruby code:

rb() {
  if [[ $# -lt 1 ]]; then
 rbenv shell --unset
@rizo
rizo / ola2
Created December 9, 2013 10:27
#!/bin/bash
ssh $1@$2 mkdir -p .ssh
cat /Users/luiscorreia/.ssh/id_rsa.pub | ssh $1@$2 'cat >> .ssh/authorized_keys'
printf "Host %s\n" "$3" >> /Users/luiscorreia/.ssh/config
printf "\tHostName %s\n" "$2" >> /Users/luiscorreia/.ssh/config
printf "\tUser %s\n" "$1" >> /Users/luiscorreia/.ssh/config
printf "\n" >> /Users/luiscorreia/.ssh/config
@rizo
rizo / offend.pl
Created December 9, 2013 10:28
Remove offending key from known_hosts.
remove() { perl -i -NE "print unless $1 .. $1" ~/.ssh/known_hosts; }
@rizo
rizo / nn.py
Last active January 3, 2016 06:28
Simple experiment with nanomsg.
# -- server.py --
from datetime import datetime
import nanomsg as nn
import time
ADDRESS = 'tcp://*:5556'
socket = nn.Socket(nn.REP)
socket.bind(ADDRESS)