Computers – blog.ryara.net http://blog.ryara.net/ Wed, 03 May 2017 18:52:17 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.1 PuTTY-url 0.62 https://blog.ryara.net/2011/12/17/putty-url-0-62/ https://blog.ryara.net/2011/12/17/putty-url-0-62/#comments Sat, 17 Dec 2011 04:13:09 +0000 https://blog.ryara.net/?p=226 The PuTTY patch with clickable URL support has been updated for PuTTY 0.62.

You can find the patch (and a binary) on the new web site for the patch at http://ryara.net/putty-url/.

]]>
https://blog.ryara.net/2011/12/17/putty-url-0-62/feed/ 2
PuTTY 0.61 with clickable links https://blog.ryara.net/2011/07/14/putty-0-61-with-clickable-links/ https://blog.ryara.net/2011/07/14/putty-0-61-with-clickable-links/#comments Thu, 14 Jul 2011 21:23:08 +0000 https://blog.ryara.net/?p=178 Continue reading PuTTY 0.61 with clickable links ]]> The patch now has a web site at http://ryara.net/putty-url/, where all future updates will be posted.

Since PuTTY tray (which I have been using for this functionality so far) has been discontinued, I decided to port its clickable link functionality to PuTTY 0.61 myself.

For some reason the code (which originally comes from Nutty) was written in C++ while PuTTY is written in C, so I rewrote the C++ parts in C at the same time. This means it should be at least a little bit closer to a possible inclusion in PuTTY.

What I’ve done:

  • Ported C++ parts to C
  • Launching the URL now uses ShellExecute directly, meaning any type of URL should work (e.g. spotify) when using an appropriate regex.
  • Set default font to Consolas and enable ClearType on Vista and later (kept from PuTTY Tray)
  • Change icons to the ones from PuTTY Tray (I like them better)
  • Patch the build Recipe so that you can make a patched build using PuTTY’s build system
  • Bugfix: Clicking a wrapped link with the window scrolled up should now work as expected

To build it yourself (using mingw on linux):

  1. Download the PuTTY source and the patch
  2. Unpack the source and apply the patch: tar xzf putty-0.61.tar.gz; cd putty-0.61; patch -p1 < ../putty-tobbez-0.61-r1.patch
  3. Drop the replacement icons into the windows/ subdirectory if you want them.
  4. Generate build files: ./mkfiles.pl
  5. Export the TOOLPATH variable so that the variables CC and RC in windows/Makefile.cyg to point to your tools (for me it was export TOOLPATH="i686-mingw32-")
  6. Build it: cd windows; make -f Makefile.cyg
  7. The executable has been created in the same folder.

Download:
Executable: putty.exe (Only if you trust me)
Patch: putty-tobbez-0.61-r1.patch putty-tobbez-0.61.patch
Icons: putty.ico, puttycfg.ico

]]>
https://blog.ryara.net/2011/07/14/putty-0-61-with-clickable-links/feed/ 10
Patch for FiSH for irssi with recode https://blog.ryara.net/2010/06/14/patch-fish-irssi-with-recode/ Mon, 14 Jun 2010 20:37:47 +0000 https://blog.ryara.net/?p=154 Continue reading Patch for FiSH for irssi with recode ]]> This patch fixes a buffer overflow (causing a segfault) that would happen if an ISO-8859-1 client sent a string consisting of many instances of a single extended character (å, ä, ö etc).

The patch is against FiSH v1.0-RC5, and is only relevant if you use the recode support in FiSH.

The side effect of this patch is that lines that would previously make irssi segfault will now be cut off (due to limits with the structure of irssi modules).

You can download the patch here: FiSH-irssi.v1.00-RC5-recode-segfault-fix.patch

]]>
libucfg https://blog.ryara.net/2010/04/29/libucfg/ Thu, 29 Apr 2010 18:07:42 +0000 https://blog.ryara.net/?p=150 I just released libucfg, a small configuration library in ANSI C. You can find it here.

]]>
ld-preload-reverse https://blog.ryara.net/2009/12/22/ld-preload-reverse/ Tue, 22 Dec 2009 03:27:17 +0000 https://blog.ryara.net/?p=141 Continue reading ld-preload-reverse ]]> I thought I would post this piece of code since it has been laying around for quite a while.

ld-preload-reverse is a LD_PRELOAD library that overrides the most common
functions for writing text to a terminal, and reverses their output:

Looks like this:


tobbez@sagiri ~/dev/ld-preload-reverse $ LD_PRELOAD=./ld-preload-reverse.so bash
 $ esrever-daolerp-dl/ved/~ irigas@zebbotls
GNIYPOC  elifekaM  EMDAER  c.esrever-daolerp-dl  os.esrever-daolerp-dl
 $ esrever-daolerp-dl/ved/~ irigas@zebbotcat Ma elifek
os.esrever-daolerp-dl :lla

c.esrever-daolerp-dl :os.esrever-daolerp-dl
c.esrever-daolerp-dl os.esrever-daolerp-dl o- derahs- CIPf- ldl- llaW- ccg

:naelc YNOHP.
os.esrever-daolerp-dl f- mr
 $ esrever-daolerp-dl/ved/~ irigas@zebbottixe

It’s licensed under the Eiffel Forum License 2, and you can find the code here.

]]>
lighttpd rewrite rules for Symphony CMS https://blog.ryara.net/2009/12/05/lighttpd-rewrite-rules-for-symphony-cms/ https://blog.ryara.net/2009/12/05/lighttpd-rewrite-rules-for-symphony-cms/#comments Sat, 05 Dec 2009 16:46:08 +0000 https://blog.ryara.net/?p=135 "$0", "^/symphony/symphony/(assets|content|lib|template)/.*$" => "$0", "^/symphony/workspace/[^/]+/.*$" => "$0", "^/symphony/image/(.+\.(jpg|gif|jpeg|png|bmp))$" => "/symphony/extensions/jit_image_manipulation/lib/image.php?param=$1", "^/symphony/symphony/?(\?(.*))?$" => "/symphony/index.php?mode=administration&$2", "^/symphony/symphony(/(.*/?))?(\?(.*))?$" => "/symphony/index.php?symphony-page=$1&mode=administration&$4", "^/symphony/([^?]*/?)(\?(.*))?$" => "/symphony/index.php?symphony-page=$1&$3" ) Replace the first occurrence of ‘symphony’ on every line with the location of your Symphony installation.]]> For Symphony 2.0.6.

url.rewrite-once += ( "^/symphony/favicon.ico$" => "$0",
                      "^/symphony/symphony/(assets|content|lib|template)/.*$" => "$0",
                      "^/symphony/workspace/[^/]+/.*$" => "$0",
                      "^/symphony/image/(.+\.(jpg|gif|jpeg|png|bmp))$" => "/symphony/extensions/jit_image_manipulation/lib/image.php?param=$1",
                      "^/symphony/symphony/?(\?(.*))?$" => "/symphony/index.php?mode=administration&$2",
                      "^/symphony/symphony(/(.*/?))?(\?(.*))?$" => "/symphony/index.php?symphony-page=$1&mode=administration&$4",
                      "^/symphony/([^?]*/?)(\?(.*))?$" => "/symphony/index.php?symphony-page=$1&$3" )

Replace the first occurrence of ‘symphony’ on every line with the location of your Symphony installation.

]]>
https://blog.ryara.net/2009/12/05/lighttpd-rewrite-rules-for-symphony-cms/feed/ 1
Ebuild for libsummer https://blog.ryara.net/2009/03/28/ebuild-for-libsummer/ Sat, 28 Mar 2009 17:48:36 +0000 https://blog.ryara.net/?p=93 =dev-libs/glib-2.18.4 >=net-libs/libsoup-2.24.3 dev-libs/libxml2 python? ( >=dev-python/pygobject-2.15.4 ) bittorrent? ( … Continue reading Ebuild for libsummer ]]> I wrote an ebuild for the broadcatching library libsummer, that recently released version 0.1.0:


# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="A broadcatching library"
SRC_URI="http://flukkost.nu/libsummer/${P}.tar.bz2"
HOMEPAGE="http://wrya.net/services/trac/summer/"
KEYWORDS="~x86 ~amd64"
SLOT="0"
LICENSE="LGPL-2"
IUSE="bittorrent doc python"

DEPEND=">=dev-libs/glib-2.18.4
        >=net-libs/libsoup-2.24.3
        dev-libs/libxml2
        python? ( >=dev-python/pygobject-2.15.4 )
        bittorrent? ( >=net-libs/rb_libtorrent-0.14.1 )
        doc? ( dev-util/gtk-doc )"

RDEPEND="${DEPEND}"

RESTRICT="mirror"


src_compile() {
        econf $(use_enable bittorrent) $(use_enable python) $(use_enable doc gtk-doc) || die "econf failed"
        emake || die "emake failed"
}

src_install() {
        emake install DESTDIR="${D}" || die "Install failed"
        dodoc ChangeLog NEWS README AUTHORS
}

Download available here. To use unpack directly to your portage overlay.

Note: If you want the bittorrent functionality you will have to unmask net-libs/rb_libtorrent-0.14.1. It’s hard masked because it breaks a lot of packages relying on 0.13. Libsummer, however, was built on 0.14.

]]>
Mailman with lighttpd and Postfix on Gentoo https://blog.ryara.net/2009/03/27/mailman-with-lighttpd-and-postfix-on-gentoo/ Fri, 27 Mar 2009 00:38:41 +0000 https://blog.ryara.net/?p=67 Continue reading Mailman with lighttpd and Postfix on Gentoo ]]> This post details how to setup mailman using lighttpd and postfix on gentoo.

Before starting I assume that you have:
* Lighttpd setup and working
* Postfix setup to handle mail from one domain
* MX records setup for the subdomain you want to use for lists

First, we need to install mailman, but before we do that we need to make sure it uses the right UID and GID (lighttpd) instead of apache, which is the default. To do this append

MAILMAN_CGIGID="lighttpd"
MAILMAN_CGIUID="lighttpd"

to /etc/make.conf and then proceed to install mailman:

# emerge mailman

Now it’s time to configure lighttpd. This we do by adding the following to /etc/lighttpd/lighttpd.conf:

alias.url += (
          "/services/mailman/mailman-icons" => "/usr/lib64/mailman/icons/",
          "/services/mailman/pipermail" => "/var/lib/mailman/archives/public/",
          "/services/mailman" => "/usr/lib64/mailman/cgi-bin/",
)

$HTTP["url"] =~ "^/services/mailman" {
        cgi.assign = (
                "/admin" => "",
                "/admindb" => "",
                "/confirm" => "",
                "/create" => "",
                "/edithtml" => "",
                "/listinfo" => "",
                "/options" => "",
                "/private" => "",
                "/rmlist" => "",
                "/roster" => "",
                "/subscribe" => "")
        server.indexfiles = ("listinfo", "index.html")
}
$HTTP["url"] =~ "^/services/mailman/pipermail/" {
             dir-listing.activate = "enable"
             dir-listing.hide-dotfiles = "enable"
             server.follow-symlink = "enable"
}

I choose not to serve mailman from a vhost, if you want to do that you’ll need to change the above accordingly. Otherwise you’ll just have to change the url matches and aliases to reflect from where you want to host mailman. You will also need to make sure that the alias and cgi modules are enabled (located at the top of lighttpd.conf).

The next thing to configure is mailman itself. Append the following to /etc/mailman/mm_cfg.py:

MTA = 'Postfix'
DEFAULT_EMAIL_HOST = 'lists.example.tld'
DEFAULT_URL_HOST = 'example.tld' 
DEFAULT_URL_PATTERN = 'http://%s/services/mailman/' 
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) 
IMAGE_LOGOS = '/services/mailman/mailman-icons/' 

POSTFIX_STYLE_VIRTUAL_DOMAINS = [DEFAULT_EMAIL_HOST]

PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/services/mailman/pipermail/%(listname)s'

You should set DEFAULT_EMAIL_HOST to the subdomain you want your lists to use, DEFAULT_URL_HOST to the host from which you will serve the mailman web pages, and change DEFAULT_URL_PATTERN, IMAGE_LOGOS, PUBLIC_ARCHIVE_URL so that they are consistent with your settings in lighttpd.conf. The call to add_virtualhost is need when you change either of the _HOST variables like this.

Continuing, there is a few things we need to do as the mailman user. First install the cron jobs:

# su - mailman
mailman $ cd cron
mailman $ crontab crontab.in
mailman $ cd ..

Then set the site password:

mailman $ bin/mmsitepass

The site password works instead of any other password in the mailman installation, and is used to adminstrate it.

Next we create the site-wide mailing list, which is needed for proper operation of mailman:

mailman $ bin/newlist mailman

And logout from the mailman account and continue…

…with configuring postfix. This is as simple as adding the following two lines to /etc/postfix/main.cf:

virtual_alias_domains = lists.example.tld
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman

Once again replacing lists.example.tld with the subdomain you want your lists to use.

Now we only need to reload postfix, start mailman and add it to the default runlevel:

# /etc/init.d/postfix reload
# /etc/init.d/mailman start
# rc-update add mailman default

Congratulations, you should now have a working mailman install!

]]>
Ebuild for yubikey pam auth https://blog.ryara.net/2009/01/13/ebuild-for-yubikey-pam-auth/ Tue, 13 Jan 2009 20:09:49 +0000 https://blog.ryara.net/2009/01/13/ebuild-for-yubikey-pam-auth/ Continue reading Ebuild for yubikey pam auth ]]> (If you don’t know what a yubikey is, have a look here)

So I wrote up ebuilds for yubico-pam and its dependency yubico-c-client. You can get them here.

Just extract the tarball into your portage overlay and emerge pam_yubico. If you don’t have an overlay, then just do this (as root):

mkdir /usr/local/portage/
echo 'PORTDIR_OVERLAY="/usr/local/portage/"' >> /etc/make.conf
tar xvzf pam_yubico-ebuildstar.gz -C /usr/local/portage/
emerge pam_yubico

For myself I configured sshd to be able to login using either my yubikey or a normal password. I will describe how to do that – if you need some other configuration have a look at the PAM module’s site (mentioned above).

  1. You will need to get your yubico client id. The only way I know of to do this is through the YMS.
  2. Configure PAM to make ssh use the newly installed module. This by prepending auth sufficient pam_yubico.so id=16 try_first_pass to /etc/pam.d/sshd. Be sure to change 16 to the ID you aquired in step 1.
  3. Add your yubikey id to the file pam_yubico looks in, namely ~/.yubico/authorized_yubikeys. Create the file with and add the line user:yubikey_id. The yubikey id is the first 12 characters from the OTPs it generates.

And that’s it. You should now be able to log in over SSH using either your regular password or your yubikey.

]]>
Flash cycler https://blog.ryara.net/2008/06/15/flash-cycler/ https://blog.ryara.net/2008/06/15/flash-cycler/#comments Sun, 15 Jun 2008 00:22:14 +0000 https://blog.ryara.net/2008/06/15/flash-cycler/ Continue reading Flash cycler ]]> Since I had a some time on my hands I decided to make a web page that cycles through a collection of flash movies and shows each one for a specified amount of time.

It should work in most modern browsers – I’ve verified with Opera and Firefox (Internet Explorer doesn’t work).

You can find the source of the page here, and a sample of it in use here.

]]>
https://blog.ryara.net/2008/06/15/flash-cycler/feed/ 1