Demo Singularity Server

development, microsoft, network, services-servers, singularity — art on June 7, 2009 at 5:26 pm

I’ve setup a Singularity web server here: http://93.97.43.210:82/index.html.

This machine demonstrates Singularity (RDK 2.0), running cassini web server with a few customizations.

Scared yet?

Compiling, Using and Developing on Microsoft Singularity

development, microsoft, singularity, software — art on June 3, 2009 at 6:24 pm

I’ll be adding more to this post quasi-frequently.

This post is based on the Singularity RDK 2.0 images and source, which are available here: http://www.codeplex.com/singularity.

Singularity can be run fairly easily. You can also roll your own, and compile Singularity from source.

What you will need:

  • Singularity RDK 2.0 ISO image.
  • Singularity RDK 2.0 sources: if you wish to compile from source.
  • A machine: physical, or virtual*.

* I’ve used Microsoft Virtual PC Beta on a Windows 7 7100 x64 host machine. I’m told it works for Virtual PC 2007. I was unable to get it working with VMWare Server 2.0.

Running Singularity

  • Download the ISO image.
  • Burn it to a CD, or save to a location mountable for your VM.
  • Boot the ISO.

You now should have Singularity running, using the default build. If you just wanted to look gangsta–mission accomplished, take your screenshots and begin bragging to on web forums:

singularity_vm

However, if you want to explore the OS (such as it is), read on.

What the Hell is This, Min?

OK, don’t panic. Looks daunting, I know. Acquaint yourself with this little gem, for starters: “Singularity_RDK_2.0_Source\docs\Design Notes\SDN87 RDK Applications Guide.pdf“. It is from the RDK 2.0 source download, and will give you a good idea of how to use Singularity commands.

Some commands:

  • help: display all commands.
  • dir.
  • start.
  • ipconfig @show: display status of all NICs.
  • dns @show: display DNS settings.
  • seditor: an EDLIN-like editor.
  • sc @show: show status of all services.
  • tasklist: show list of all tasks.
  • jobs: show a list of all jobs.
  • fg n: foreground job number n. Use ^C to quit the job.
  • shutdown.

Backgrounding:

Use & to run programs in the background. You can ^Z halt processes, then use bg n to background it.

Compiling From Source

The source comes with a PDF: Building and Running Singularity RDK 2.0.pdf. Read it.

Essentially you follow the instructions as given in that document:

  • Get the prerequisites for the environment.
  • Run “configure.cmd”.
  • Delete/rename the directory “Singularity_RDK_2.0_Source\base.obj”, if it exists.
  • Run the “Singularity RDK 2.0” desktop icon which will bring up a command line prepped for building Singularity or debugging it.
  • At the prompt, type as below to build Singularity World distro:
    …\base> msb Distro\World.proj
  • If it dies saying it couldn’t find a directory within “Singularity_RDK_2.0_Source\base.obj\MSBuildLogs\6\…”, don’t worry. Go into that MSBuildLogs directory and create the 6 directory. Now the MSBuild should work.

image

image

  • You can find generated ISO image for your build in “Singularity_RDK_2.0_Source\base.obj\Distros”.

If you modify any .scripts, for example, you may wish to recompile to include the modifications on an ISO; you just repeat the above process after making your changes to “C:\src\Singularity_RDK_2.0_Source\base\Distro\Scripts\startup.script”, for example.

As a rough benchmark, it takes me 10-15 minutes to build World on a quad core with 8 GB memory.

Networking

Aye, it works.

If you’re ultra-lazy, just do the following:

Singularity>ipconfig @dhcp /dev/nic0 start

This should get you going with DHCP. It’ll poll the DHCP server for DNS servers too.

You can set a static ip thusly:

Singularity>ipconfig /dev/nic0 192.168.1.99 255.255.255.0 192.168.1.1

The format is ipconfig <device> <ip> <netmask> <gateway>.

Remember that if you set a static IP using ipconfig, you will need to tell Singularity which DNS servers to use, check the dns command.

Enabling VESA

Edit the file “Singularity_RDK_2.0_Source\base\Distro\LegacyPCDistro.xml“.

Enable the line:

<driver name=”S3Trio64″ />

Recompile, and you’ve got VESA.

image

I prefer without VESA as it has a handy thread statusbar at the top of the blue screen, which is apparently gone in VESA mode. Pity.

FAT drives

For FAT support open your Distro build file (i.e., “Singularity_RDK_2.0_Source\base\Distro\World.proj“), add the following line:

<Application Include=”$(SINGULARITY_ROOT\Services\Fat\Control\FatControl.csproj”/>

Recompile, and you’ve got FAT support.

Make sure you’ve partitioned your FAT drive beforehand. You should be able to see it listed in the /dev tree.

Now, you can @format, @mount and @unmount your FAT drive using fatcontrol.

image

.script files and customizing startup.script

If you are serious about using Singularity, you will likely want to modify your init/startup.script. The best way to do this is to edit this on your host machine, then msb.

Note that you will have to put ‘single quotes’ around all arguments. For example, the shell command hostname -n=paddington (this changes the machine’s hostname to “paddington”) would be put in startup.script as:

hostname ‘-n=paddington’

There are plenty of examples in the RDK for you to get started with. Here is Singularity booting up, setting hostname, a DHCP connection, a static IP, and mounting a FAT drive:

image

Jobs

If you try to reboot or shutdown while there are jobs, Singularity will freeze. Nice. For now, just remember to kill all your jobs by foregrounding them (jobs, fg n, ^C).

Developing in Singularity

Read this thread which discusses the best way to develop for Singularity: http://singularity.codeplex.com/Thread/View.aspx?ThreadId=23669.

A quote:

copy an existing project like …\base\Applications\Hello\

to …\base\Applications\MyProj\

cd …\base\Applications\MyProj\

rename .cs and .csproj files, edit them for content.

msb MyProj.csproj (until it compiles)

back to …\base

edit distro\tiny.proj and add a line for your app

<Application Include=”$(SINGULARITY_ROOT\Applications\MyProj\MyProj.proj”/>

msb distro\tiny.proj

In general, I’ve found the process to be fairly straightforward, once you get the hang of it. I would recommend you compile a World distro, and keep the base.obj directory. Now, go into the base directory, and edit your sources/files.

The next time you msb the distro, it will only recompile/update the changed files. This is a pretty quick way to edit the scripts, and not too long if you are coding.

As a benchmark, it takes less than a minute for me to msb world, if I’ve made changes to 1 or 2 code projects within the source tree:

image

Debugging with WinDbg

Create a named pipe to COM2, and you can call the debugger using “dbg.cmd /pipe”.

image

Now, when you start up your Singularity VM, it will automatically output the debug to WinDbg:

image

Caveats

  • Some example applications are buggy/not working.
  • US keyboard layout only? I couldn’t find a way to change this anywhere in the source.
  • Couldn’t get the /dev/audio device with Virtual PC Beta.

Demo Server

I have set up a demo Singularity web server, details here.

if (dd-wrt + xbox 360 == fail) then tomato;

hardware, network, works-for-me(tm) — art on April 21, 2009 at 12:27 pm

tomato_bwrt

Having had problems with my ISP’s modem/router/firewall/wireless device, I wanted to bridge to a separate device to handle the routing, firewall and wireless.

I have been using a Linksys WRT54G version 1 for this task. The firmware had to be flashed with DD-WRT, which is a pretty good firmware all in all, but seemed to be stretching the limits of the version 1 WRT54G.

The vintage DD-WRT build, which is the appropriate flavour for the WRT54Gv1 is a stripped-down version of DD-WRT which doesn’t contain some of the newer features. Although it was fairly stable, it got slow and unresponsive at times over wireless, and had some trouble maintaining long-term RDP sessions over wireless, dropping the connections maybe twice an hour for a minute or so each time. Although QoS may have been an issue, my clever rebuttal is that “it doesn’t work for me out of the box”: I’m lazy as fuck, what do you expect?

All in all, DD-WRT worked better than the Speedtouch 780 as a router, and better than the stock Linksys or OpenWRT firmwares. My main problem with DD-WRT was that for some black magic voodoo reason, the XBox 360 was unable to join the wireless network. It could detect it, discover encryption method, but was unable to connect to the network no matter how hard I tried, no matter how hard I cried into my pillow.

After acquiring some expert/professional advice (i.e., googling the interwebs), I installed tomato the other day, and lo and behold—the XBox was able to connect without problems. Tomato seems more responsive than the DD-WRT thus far, which is another bonus.

I’m not sure about the newer WRT54G models, but if you have a version 1, you may want to consider using tomato rather than the stock Linksys, DD-WRT or OpenWRT firmwares.

 

Chinese New Year celebrations in London 2009

woe-is-me — art on February 1, 2009 at 8:55 pm

They decided to change the format of the annual CNY celebrations this year, I think it turned out for the worse. Chinatown was literally blocked up with people, and old people were pushing us quite ferociously—it was quite a trauma, tbh.

The fireworks used to go off in Leicester Square every few hours, and the police would control the number of people in the area. This year, they decided to do only one show of fireworks, right before the end at 6pm.

The Dragon dancing through Chinatown had babies and we ended up seeing 3 or 4 different dragons, each causing a human traffic jam… pretty well planned guys.

 

cny1
Pure quality shot.

cny2
Mad mafia boss protection.

Installing Debian 40r6 for Sparc

sparc, unix — art on February 1, 2009 at 7:57 pm

If your Sparc is not set to automatically boot from CDROM, you might find the following handy.

Requirements:

  • Sparc (tested on UltraSparc 10)
  • Debian image
  • ISO burning software
  • Monitor and keyboard for Sparc (alternatively, run from serial terminal—serial cable required for this).

Instructions:

  1. Download the debian sparc netinst iso image.
  2. Burn the image to CD.
  3. Put the CD into your Sparc.
  4. Power off the Sparc.
  5. Plug in keyboard, mouse, and monitor.
  6. Power on the Sparc, you should see the POST and the machine initializing memory check.
  7. Hit STOP-A. You will be brought to the “ok” prompt.
  8. type “boot cdrom”.
  9. Run through regular Debian setup process.

That’s it.

You may want to read this previous post for installation caveats regarding MBR, SILO, and serial terminal install.

The Genius

lulz, streaming-media, video — art on January 20, 2009 at 6:26 pm

Poet, wrestler, manager, a true renaissance man in his bloom.

Back to basics…

woe-is-me — art on January 14, 2009 at 9:11 pm

Welp, that was fun. I guess it’s time to use this thing again.

Now that WordPress has a decent CAPTCHA facility for comments, maybe I’ll stop getting blasted with Viagra ads by robots—we’ll see… it’s a new year, full of incredible possibilities…

Woe is me.

woe-is-me — art on April 4, 2008 at 5:18 pm

Hi guys, this site is not going to be updated anymore, for now. I have opted to use Windows Live Spaces instead. Why? To be honest, I don’t have time/any desire to maintain WordPress anymore. Lazy as fuck, I know, I know.

So long csoft blog, and thanks for all the phish(ing).

dadadodo for lulz and profit

lulz, science, software, woe-is-me — art on March 1, 2008 at 12:26 am

Ok, so I reckon my first attempt at dissociation wasn’t so great. Recently, I compiled all my IRC logs from 2004 to current, and ran it through for some better results (having pored through the other 99.9% utter mumbo-jumbo it generates).

Three hundred odd megabytes of IRC banter…

-rw-r–r– 1 art art 332202514 2008-02-20 23:50 irc.log.2004.2008

… which is a mere 6.74 million lines …

6747292 lines

… process wildly for about an hour at gas mark 6 …

real    62m19.124s
user    10m46.532s
sys     0m9.589s

And out come a few tasty treats:

Buy a gay Gangsta / The ass down; dead sexy G / arfer gotta reboot computer / Well you don’t have a beard! / Lisa is not too, unstoned / im jackie chan takeover never even if u want / Aftermath, prevention.  Full paychecks Fraggle. / Cnn, was real sickening robcool. / hehe stupid cockos stupid calculus? / Elm: what he came to finish your asscrack / A Leetle HAHHHHHHSSSHHH! / digit null: has attained level in stupid / more in theory of my fire slowing the connection / I can shoot it fack / Its fuckin gets your fuckin nick now / Next level Next year Robcool.  Badapbapbapbap / …

Kinda bit depressed; unwanted

… / And all go once and bait, etc, clarkee. / stripey fuq all of idlerpg. / Unf Unf unf unf centry tastes arf clean it appears / Though.  Fighting kobi: pescado namssa. Crazy, weepy tooof; / die, jimmy. / ubuntu linux is now online stuff / Fncypntz: hotboxing the face (off signoff Vision and: a bowl accidental / the Worst thing is Seafood its a: depressed Robcool. / Bobsaget, the Council isn’t gay. / Might be about a south america asia jerk striphy / arf; damns i m fakeidler. / long Faggot taking picz unstoned unstoned imvfpisssed unstoned just communicate with you do my vibrator hookup. / Baub you’re tainted authority / i would be satisfied!  Fncypntz. / Yeah good luck to verruca / Rofl plus extras / I have to the bottom of the lunch time you can carry around with your cock in day making snickers / Look like having arf call you biatches has ill give; / I don’t support arfyarf: bbiaf / got in Iraq, Us the Connection reset by peer, Voltron got it rst / Those hot like a Differential equation / Deuce. / Three words you fixed zombie / Heheh pescado es bueno hay mucho Infamous / This world is first. / Tuck Tuck was like fuck / Ok enough of lies. / Well lookie IMPOTEEEENNNNCEEEE arfyarf. / penis join join to somewhere But I dont I suppose the americans smegma Rampage / Superfriends is you / But it’s crack house once i have corn flakes / there is arfer: ban him / Fag?  Werent lyin tumble.  Jimmy he could find anyone Want me / Bsd is now known as bloated / Lol meiso its tea joint lush and you enjoyed use Maxells flame flame, again did! / Gonna go for this brand of english men / It’s offical reunification was for valentines?  Whooo wouldnt smoke man! / tomorrow most of that be something Robcool; grapenuts; gooses. / Apmannen (reaches next level next level aznsensation)! / hahaha arf it’s arf so it sucked, apparently / Gay arf: arf. / Get laid tonight.  Oh my account. / So many many girls mad glad to the answer (these dried saliva produced stripey). / Aye man, this that was kicked from vagina?  Haha / girlies are into to stripey. / The level procrastinator, is supposed to tear down arf / …

I’m beginning to learn a few things more about my Sparc based on these scientific findings. I do believe he’s a raging homosexual, and a drug addict. Fascinating.

Some peace and quiet

conspiracy-theory, woe-is-me — art on February 26, 2008 at 8:02 pm

It’s nice to get along with your neighbours. Yesterday I spent 2 hours listening to one of ours–again. He is a 3-time ex-convict, recovering crack addict, formerly homeless, used-to-be-gangsta, etc.. Ever met those types of people who just have to talk loudly, no matter what? How about those types that can’t stop spitting little bits of saliva when they speak? Nice one. Mad nice to meet you.

This guy has lately become so paranoid that he’s convinced that a neighbour nearby is actually a prison guard, and that everyone in our neighbourhood is conspiring against him.

He’s “caught” our neighbours talking to each other–obviously about him, what else could they possibly be talking about? The other day, he realized that they had trained all their cats and dogs to shit and piss on his garden. Also, apparently they wait for him to clean his garden, then throw junk into his lot.

They have also used pre-emptive strikes to “mess up” 5 chances he had with women (all of whom he seemed convinced he would marry). They also know when he is doing his Islamic verses and prayers (he’s trying to convert into the faith), and deliberately make things “unclean” for him, breaking in and touching his Koran, and so forth.

Also, the neighbours listen to his phone conversations, plan when he’s out to burgularise his flat up, and don his hoodie and track pants. He caught someone wearing his track suit once, yelled and threatened them until they ran off. When he got back home, he discovered that his place had been apparently entered into, and it seemed as if the clothes were put back hastily. No joke.

From what I know, our neighbours seem to be mostly families. This guy is a single thirtysomething spazz who can’t hold an honest job down for the life of him. Makes sense that they’d be mad envious and want to mess him up.

… did I mention he consistently reeks of burger grease smell?

Pure “I C, I C… /me nods head and looks at his watch repeatedly.” Woe is me, for I can’t be rid of dickheads.

Next Page »
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | art’s abode