Main >

Viraptor's dev-log

Your mind-fluffer hopefully

C# shell

on December 21st, 2006

C-sharp shell? Great!

Although my friend, when asked whether he would like to have a shell with bindings to Java, replied “System.out.println(”NO”);”… I was playing around with different shells. Zoidberg (perl), psh (perl), zsh (almost normal), etc.

Power shell would be nice, if it didn’t try to export objects into some strange new shell language constructs (cmdlets). If the thing they wanted to achieve was similarity to shell, then normal stripping of “()” and “,”, that can be deduced from context would be enough… Of course making some namespace default for searching objects (Cssh.Something), would be appropriate. “Var” keyword from C# v.3 can also come handy.
I haven’t tried cssh yet, but I can’t wait to do it! Downloading as I write it.

Just downloaded… It’s probably NOT what you’d like to use - it’s just for files, but a good start anyway.

PowerShell port was already proposed, but author doesn’t respond to emails, so project was probably dropped. Still - it’s nice to see, that some people want to get the same things I do…

As most people shout “Yet another shell and object one? NOOOOOOOOOO!!!!!!!” while reading this, I’ll tell what I want in a real linux object shell and why I’d like it to be there:

  1. foreach(i in Interfaces) if(!i.IsAlias) echo Format(”interface {0}: {1}”, i.Name, i.Ip);
  2. echo Partitions[”/dev/hda”].Capacity
  3. echo new Ping(”10.1.1.29″).GetAverage(5)
  4. prcs = Processes.Get(”terminal-name”)
    foreach(prc in prcs) if(!Processes.Current.IsChildOf(prc)) Kill(prc);
  5. Iptables.Add(”Input”, new Iptables.SourceFilter(”127.0.0.1″), Iptables.ACCEPT)
    (even if that doesn’t seem that nice in this case - think about creating one SourceFilter (or some complex ‘pseudo-query’ object) from other sources (network monitoring?) and using it to create rules in real-time.
  6. Autocomplete objects through Reflection with tab button - easy

You know what processes are there - no need to grep ps. You get numbers you want - no need for awk. You know what was the problem, because of exceptions - no need to browse man for return code listings. You want to run commands - there are no problems with quotes in command / quotes in your command line / quotes in file arguments - there are only Strings.

PS1: I only found original post by google alerts - try it out :)
PS2: There was a c# shell - discontinued unfortunately :( But in case it disappears, I’ve got sources… in case…

Mono-1.2.2.1 is out for Ubuntu

on December 14th, 2006

Mono version 1.2.2.1 is already in source repos for feisty, so it’s time to upgrade it in edgy also.

As usual: get mono .deb packages. This time if you want sqlite*.0-cil, you’ll also need new libsqlite itself. It’s provided along with main packages.

For those suspicious - yes - 1.2.2.1 exists officially, but the main www.mono-project.org page is a bit laggy with updates lately. I told that to mono guys yesterday, so there may be some update in a short time.

Dependencies provided: sqlite (with lemon), libgdiplus, cli-common.
Additional stuff: prj2make-sharp.

I’ve noticed some search hits for ubuntu and mono from google, so I’ll probably keep the tradition of posting new debs ASAP (that means as soon as they’re in feisty and if I’m still stuck with edgy).

Finland is Winland

on December 12th, 2006

… and official stats on last.fm (or lack of them) are lame. But I like stats, because stats are fun.
20 min. of mono coding and 6 hours of profiles indexing later results came. So what’s interesting in last.fm profiles? Mostly country and sex profiles. Every country has similar number of users hiding sex, but m/f ratios are very different. Mainly:

  • Finland is Winland: 29.4118% M <-> 70.5882% F
  • Switzerland is a don’t-go-there-man country: 92.8571% M <-> 7.14286% F
  • General proportion is about 60% M <-> 40% F

Per age: (% of M) minus (% od F):

  • unknown = 20.9581
  • 13: -5.26316
  • 14: -13.3333
  • 15: -11.5385
  • 16: -4.89914
  • 17: -1.96937
  • 18yo: 7.89981 (google spam ;)
  • 19yo: 22.7621
  • 20: 17.5758
  • 21: 23.8994
  • 22: 32.0197
  • and grows… 30: ~70

Young girls like last.fm? Per number of friends:

  • 00-05: 25.2016
  • 05-10: 22.0175
  • 10-15: 8.92857
  • 15-20: 15.5963
  • 20-25: 8.49673
  • 25-30: -10.1449
  • 30-35: 7.54717
  • 35-40: 6.52174
  • 40-45: 5.61798
  • 45-50: 9.52381
  • >50: -23.0769

Girls have more friends. Splitting friends by country gives nothing and is more useless than this whole post. More stats will follow, if there’s more stuff found.
C# library for interacting with last.fm will be published as soon, as I change separator to something other than “,” (thanks “Taiwan, Republic of China”). Currently it can poll profile details, friends lists, feeds, shouts and aggregate that in db4o.

Mono-1.2.2 is out for Ubuntu + packages

on December 8th, 2006

Hello again!
Mono-1.2.2 is ready for downloading! Making packages for edgy is as easy as always, but anyway - this time instead of deleting .deb’s, I’ve uploaded them for so called “community”.

Go - get it: mono-1.2.2 deb packages for edgy. It includes newest cli-common, mono and libgdiplus from feisty, so you probably don’t need anything else. Have fun.

Post update: what’s the minimal mono toolchain? Hard question - but I’ll just list dependencies of mono-mcs and mono-gmcs. That’s all you need to create console “Hello world”. Even winforms one in 2.0, as there is mono-gmcs -> libmono-microsoft-build -> libmono-winforms dependency. Just get everything else when needed.
For those developing 1.0/1.1:

  • libmono0
  • libmono1.0-cil
  • libmono-corlib1.0-cil
  • libmono-data-tds1.0-cil
  • libmono-peapi1.0-cil
  • libmono-relaxng1.0-cil
  • libmono-security1.0-cil
  • libmono-sharpzip0.84-cil
  • libmono-system1.0-cil
  • libmono-system-data1.0-cil
  • libmono-system-runtime1.0-cil
  • libmono-system-web1.0-cil
  • mono-common
  • mono-gac
  • mono-jit
  • mono-mcs
  • mono-runtime
  • mono

For those developing 2.0:

  • libmono0
  • libmono2.0-cil
  • libmono-accessibility2.0-cil
  • libmono-corlib1.0-cil
  • libmono-corlib2.0-cil
  • libmono-data-tds2.0-cil
  • libmono-microsoft-build2.0-cil
  • libmono-peapi2.0-cil
  • libmono-security2.0-cil
  • libmono-sharpzip2.84-cil
  • libmono-system2.0-cil
  • libmono-system-data2.0-cil
  • libmono-system-web2.0-cil
  • libmono-winforms2.0-cil
  • mono-common
  • mono-gac
  • mono-gmcs
  • mono-jit
  • mono-runtime
  • mono

And general crowd will probably just want to join both lists together. I’ll create “basic-{1|2}” folder with proper links… one day. Maybe on 1.2.3, maybe when I’m bored.

Security hole in .NET 2.0

on December 7th, 2006

Jeroen Frijters discovered lately a bug in .NET 2.0 on Windows platforms, that allows to execute any code from a “verifiable and partially trusted C# application“. That sucks really. Now every .NET code running from browser can also exploit the system. Ok - security problem - that happens to everybody and we should’ve already learnt to forgive that.

Not this time. Bug was known already, as it was “reported by someone else in August” and “bug was subsequently fixed in September“. Patches only made it to Vista and rest will get patches through Windows Update “sometime in the next few months“. Only thing you can really say is WTF? Two guys independently reported this bug already.

Who knows, how many know about it, but didn’t report it and how many run into it and know they can crash the system with that, but can’t make a real exploit? Once again I think POC should be released now. Seriously - one month was enough to patch it in Vista and 4 months weren’t enough for XP? MS - you don’t release patches when you like it - you release them, when they’re needed. What can change this policy? Someone owning MS developer’s machine with this bug and stealing Vista code? Owning Balmer’s desktop with 0-day and publishing his private mail?

It’s a pity that this exploit would be too valuable in real-world to waste it on “it’s a bad patching cycle” propaganda. Maybe one day…

Browsing session

on December 7th, 2006

I was just looking for stuff about Singularity, when I learned some new informations:

  1. NEVER, EVER name your project .net, .com, .org or anything like this. Also applies to common words as tea, cup, cat, whatever (actually “whatever” may be a good name). Nobody will be able to find information they want. Anyone who suggested “.NET” name, should now search “.NET operating system” on google -> results entropy goes through the roof.
  2. Managed OS? Java’s done it already: JX, JOS, JNode, e-leos, JSYS. I wonder which will survive to be a real system one day? JSYS for some reasons looks like it’s going to be similar to Hurd - nonexistant. e-leos is not professional. Rest is doing “something”. 5 separate projects, trying to build 5 OSes, doing the same things, but with different implementations… strange. (no - it’s not similar to distros in any way, unless they’ll agree on some common interface to kernel)
  3. The only really working Managed OS right now is Inferno, which I’d really like to test some day. Limbo language and possibility to run it as guest OS under other systems make is really nice.
  4. Through some links, I’ve hit a nice blog JMPinline, which is a real pleasure to read. If you want a good programmer’s blog - go there.
  5. And on JMPinline I’ve read something about smartphones and CE .NET. That reminded me once more, how badly I want to own a Linux Phone. Nothing special - just phone + bt / wifi / whatever there is + Linux. Why isn’t there any of those in normal price in my part of the world? Do I really have to go back to Siemens firmware hacking to get one? :) Not, that it wasn’t interesting… but Siemens didn’t want to help anybody and we had to have fun in our own sandbox.
    We’ve already found gfx, sound, card reading, serial interface and many other modules - is it that hard to publish at least a .h file with addresses, Siemens? Even for some old phone!

That’s all for strange links from today.

PS. CommunityServer doesn’t support trackbacks… that’s all for community…

Oh my god - it’s full of stars!

on December 5th, 2006

Based on “The Spinning Cube of Potential Doom” and many other similar projects - I present Spam Cloud. What’s Spam Cloud about? It’s just pretty visualisation of spamming areas of internet. It shows hosts as blinking points for each spam record in your log. Recipe to make Spam Cloud:

  1. Get your /var/log/maillog.
  2. grep all lines with “Rejected: you’re in (hostname) rbl list”
  3. Get source ips.
  4. Map a.b.c.d address into 4d space: a->x, b->y, c->z, d->time
  5. Hack a short program in C / OpenGL and take screenshots:

Read the rest of this entry »

GtkRegexTest

on December 3rd, 2006

New project has just been launched - “GtkRegexTest“. Name is pretty much self-explanatory. It’s a program for editing and testing regular expressions (RE / regex / regexp / whatever). It’s written in C#, developed on mono, but should also work under MS.NET without any problems.

Read the rest of this entry »

Mono-1.2.1 is out for Ubuntu

on December 3rd, 2006

If you’re using Ubuntu, then mono-1.2.1 is available already. How? Easy as 1-2-3 on edgy (and previous probably too). Add:

deb-src http://se.archive.ubuntu.com/ubuntu/ feisty universe multiverse main restricted

to /etc/apt/sources, run:

apt-get update
apt-get build-dep mono
apt-get source mono –build

And install all the .deb-s that were created. That’s all! Really.