Updates from December, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • Dark Liquid 5:34 pm on February 24, 2009 Permalink | Reply
    Tags: liquid, ,   

    Accessing Context in Liquid Drops 

    Have you ever thought it would be nice to be able to access the context from within a custom Liquid::Drop when using the Liquid template system?

    Turns out, you can.

    On Drops there is a method ‘context=’ which gets set by the parser when it comes across a Drop object. From within the drop, all you need to do is access the @context variable and you’re away.

    Why this isn’t advertised more is beyond me, or maybe I’m just an idiot and missed it, but I couldn’t see how to do this at all until I decided to sit down and essentially try and write it myself and delved into the code in Liquid that deals with processing variables. Turns out it’s already there and it works a charm. Nice for writing Drops that behave differently in different contexts, depending on register settings and the like.

    Anyway, I thought it was useful, hope this helps someone else before they pull all their hair out.

     
    • Mike Larkin 3:37 pm on July 28, 2009 Permalink

      I was halfway bald when I found this. Thank you!!

    • Dark Liquid 3:41 pm on July 28, 2009 Permalink

      No problem, I know how you feel. Lack of documentation is the bane of my existence!

  • Dark Liquid 6:58 am on February 23, 2009 Permalink | Reply
    Tags: , dreams,   

    Dream 

    Normally, I don’t dream, or more accurately, I never remember my dreams. But last night, that changed.

    I had a really bizarre dream, the specifics of which I can’t remember but generally it involved a christmas party at my home (which wasn’t the flat but some kind of 70s style semi-detached house) and someone we invited ended up breaching our trust when Dru and I went out to get something by inviting tons of people we didn’t know, making a huge mess and pimping out our bedroom to these horny strangers she invited.

    I was so incredibly angry in the dream because I knew regardless of what she said, Dru and I would be the one to clean things up, plus we had a bunch of strangers in our home we didn’t trust.

    I kicked people out and yelled at everyone, then her Dad came to back her up and threatened me, not in a physical way, but a kind of warning of ‘you really want to do this?’ mode. I did want to do it, and somehow we ended up in a paint-fight (weirdos had been painting crap all over the bedroom walls while they were having sex on Dru and I’s bed).

    Eventually the dream ended up with me killing the kill and her Dad, setting it up to look like her Dad and sexually assaulted her (by faking evidence) and then burying the body of the girl and dumping the body of her Dad in a lake somewhere, as if he’d deliberately drowned himself for shame of “what he’d done”.

    After that, there was much cleaning and hunting down stolen items that strangers had taken when we kicked them out.

    It was all very odd and very disturbing, especially since I have only ever been as angry as I was in the dream once in real life, and then I had three people to hold be back when I wanted to go kill someone with rage. Maybe that’s the root of the dream – the fear of my own rage. I don’t really get angry any more, frustrated and annoyed sure, but angry isn’t something that really happens to me much any more and when it does, I hate it and feel really bad and sick about it. Maybe my brains just cleaning up some old issues I have while doing it’s nightly defrag and maintenance?

     
    • Devo 8:48 am on February 23, 2009 Permalink

      Woah, that is messed up. o.o

  • Dark Liquid 10:54 am on February 4, 2009 Permalink | Reply
    Tags: memes   

    25 Things Meme (reposted from facebook) 

    Well, the meme bug has bitten again! But this time it’s 25 things instead of seven. Here we go…

    1) I’m an avid Linux user and have been since Redhat 4.2, which I think was released in ’96
    2) I can bring my arms from in front of me to behind me without parting my hands
    3) I did beastly things as a child, such as turning lawnmowers upside down and throwing frogs at the whirring blades.
    4) I also used to make elaborate snail races and obstacle courses. How did I make the snails compete? Salt for the track markings.
    5) I find extreme amounts of fictional gore hilarious
    6) I’ve been playing roleplays for quite a long time too. I play D&D mostly but find I enjoy White Wolf’s offerings much more and rather enjoy Shadowrun too.
    7) I’m incredibly lazy, though I prefer to think of myself as ‘efficient’, littlest effort, maximum gain and all that. 8) I can’t remember a thing. People, places, events, what I was talking about in the middle of a conversation. I’m terrible, what am I writing about again?
    9) I’m normally very hard to rile up, being the embodiment of calm.
    10) During a rather nasty incident, I kicked and door and damaged the hinges in blind rage while trying to get to someone so I could kill them. Two people needed to hold me back.
    11) The same incident involved me and some others running away from home, but it lasted all of an hour or so before one my fellow runaways got hungry. It turns out people at gas stations get concerned about a bunch of children turning up at 3am.
    12) I’m messy and my desk looks like a landslide of paper.
    13) Ironically, despite my messiness I really like minimalism.
    14) I can digest metal and glass
    15) I have 2 more ribs than most people.
    16) I once cracked my head open on a rocking horse when I was a kid and still have the scar.
    17) My long hair and beard are mostly the result of the aforementioned laziness rather than a concerted effort to look this way.
    18) I have size 13.5 feet, quite narrow and can’t wear anything but boots because anything else always seems to cut up my feet.
    19) When I don’t wash I think my armpits sometimes smell like ham and pineapple pizza.
    20) I love meat. I love it so much I once tried making a meat-shake. Word of advice – don’t try that, ever, you will not enjoy it. It comes out much the way it goes in – through the mouth and lumpy.
    21) While on a caffeine high, I once swung a shopping trolley around my head while sprinting down the road.
    22) I think I’m an incredibly boring person and always find these lists incredibly difficult to populate.
    23) I hate travelling or going anywhere. I don’t really feel much benefit from paying to go somewhere and see something, I nearly always happier to see pictures on the computer for free.
    24) Before I got into computing, I wanted to be a psychologist but a teacher told me not to bother because it was a saturated job market. So I went into IT. Doh!
    25) I basically don’t watch TV, listen to radio or even go outside that often. I have adblocker installed on my browsers so I basically have no exposure to adverts at all. It really freaks me out seeing them because to me, adverts are really rare. Saying that, I also seem to have adblock in my head, so my brain rapidly tunes them out anyway.

    Right, I’m not going to tag many people (the ‘rules’ state you should tag 25) because anyone I know who would actually carry this on will read this eventually and do so anyway. In fact, when thinking about tagging people I was amazed I actually had 25+ friends on facebook, especially since I deliberately try and keep my list of friends on here sparse. Amazing.

     
    • Devo 8:42 am on February 22, 2009 Permalink

      3) I don’t actually remember seeing any such acts of wanton destruction of amphibious life. :P

      4) Now that, I do remember. You sick fuck! XD

      5) *happy sigh* Y’know, I wish I had Angel Cop on DVD.

      7) Bro, you are the embodiment of sloth.

      10+11) I remember it well. It was a daft plan, though, one we didn’t really have any hope of accomplishing. Still, got us out of the house and gave us a taste for adventure. X3

      20) ROFLMAO XD

      22) If you’re that boring a person, you wouldn’t have as large a circle of friends as you do. :)

  • Dark Liquid 1:23 pm on February 1, 2009 Permalink | Reply
    Tags: phew,   

    EVE 

    Well, I avoided joining my friends in consigning my soul to oblivion today. Today, I was sufficiently bored that I decided I’d try out EVE-Online, a game that until now I’ve avoided like the plague because I know it will consume my soul.

    I used to be a massive Frontier: Elite II junkie on the Amiga and spent unhealthy amounts of time on that game. I suspected EVE would do the same, so I made sure to avoid it because I rather like my life as it stands and that will rapidly evapourate to be replaced by all-consuming obsession.

    I lucked out though. Running on Linux with a dual-screen set-up has always been a bit of an arse when it comes to games, especially when you are also running compiz. Combined all together, the app wouldn’t run at a reasonable resolution, neither their Linux client, which is actually just the windows one with a crippled version of cedega bundled, nor their Windows version through WINE. The game constantly insisted it had to run at my full desktop resolution (3360×1050) regardless of whether or not I ran it in window mode, in fake fullscreen-in-a-window mode or anything else, making it somewhat unplayable – I couldn’t even log in because due to it’s stupid resolution screwup I couldn’t see the login box to enter stuff into and click login.

    Oh well, I am saved at least until I get bored enough to try it again and it happens to be fixed.

     
  • Dark Liquid 7:44 am on January 20, 2009 Permalink | Reply
    Tags: update   

    Minor update 

    I’ve been getting back into my writing again lately and so I’m slowly picking up the pace on Protagonize again. There are some really awesome stories on there that I’m proud to say I’m a part of.

    Speaking of creativity, things are slowly being put in motion for HappyFunGeekTime, though I’d never have thought doing something like it would require so much organisation. I’m not good at organisation and consequently haven’t really done any. Hopefully things will pan out.

    Things seem to be going fairly well at work, we’re big on gems at the moment and boy does it make a difference having a nice, tested, gemified library at your back when developing apps. Gems make things so much easier because with later rails version you get all the benefits of plugins with the additional benefits of a decent versioning and freezing system as well.

    Well, that’s it for now.

     
    • Dru 9:46 am on January 20, 2009 Permalink

      No, you’re not good at organization. It’s a good thing I’m doing all the hard work then isn’t it? :P

  • Dark Liquid 10:58 pm on January 5, 2009 Permalink | Reply
    Tags:   

    7 Things (Meme Attack!) 

    The memes have attacked and once again my blog is another casualty! This time the onslaught was led by Bytey, supreme commander of the 7 Things meme army division.

    Well, as part of my surrender treaty, I’m doing the meme, spreading it further. It’s like aliens implanting their eggs in you, except instead of aliens bursting out of your chest, memes burst out of your blog.

    1. I was once a temp waiter at the Southport Flower Show. It was my first real job (I went to the job centre for it and everything!) and I earned about a seventh of what I earn a month now for three days work.
    2. I had an absolutely terrible attendance rate at school and at college. In all cases I have felt justified. At school I felt everything was too easy and I got bored easily. I didn’t bother turning up because I felt endlessly practising the same things over and over was a waste of time. I’d rather stay home, pretending to be ill and teaching myself matrix math so I could code mods for Quake 1. There were threats of legal action from the government against my mother so I had to go back and keep up my attendance rate. It was much the same with college, but at least I was allowed not to turn up, within reason, and at worst I would have been kicked from the course rather than suffer legal action.
    3. I thought I was the coolest kid on the block for having an Amiga 1200 with a MASSIVE 20MB hard drive!
    4. I have to have cold drinks in a glass and hot drinks in a mug. I feel really wrong drinking something like squash or cold milk from a mug.
    5. I have two extra ribs.
    6. I’ve actually been roleplaying for a really long time since I was around 12 I think when I was doing freeform, no-dice, speech only roleplay in the playground at a school in Bournemouth when I was living in Pokesdown. I’ve lost contact with the guys I played with then, Richard (last name of Hohne I think) and Dominic (whose last name I can’t remember at all).
    7. I’ve always wanted to live in a house like the one from M. C. Eschers House of Stairs, minus the weird bug things.

    And tagging. This is the hard bit, I’m not sure I actually know seven people that have a blog and actually use it.

    1. DruidX – my darling wife
    2. Bytey – right back at you (yes, it’s a cop-out I know, give my antisocial arse some slack)
    3. Lost Process – one of my best friends and my best man
    4. Devo – my brother
    5. Bloodred1889 – my friend Jade
    6. Urbanvoodooman – another long time friend of mine
    7. Dan Wentworth – a cool guy I met at LUGRadio Live that turned out to hail from Dorset as well!

    And now the rules:

    • Link your original tagger(s), and list these rules on your blog.
    • Share seven facts about yourself in the post – some random, some weird.
    • Tag seven people at the end of your post by leaving their names and the links to their blogs.
    • Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.
     
  • Dark Liquid 11:23 am on December 31, 2008 Permalink | Reply
    Tags: , , suse   

    Arrrrrgh!!! 

    I’ve not been a great fan of SUSE but for some reason I installed it on my media box – all the other boxes in the house have Ubuntu on them. I wish hadn’t decided to try out something different, it’s been a nightmare.

    SUSE, quite frankly, is shit. I’ve had no end of problems. When I first installed it it managed to fuck up it’s own update repository info so I couldn’t update anything. after fixing that it was a massive bunch of jumping through hoops to get media working properly, fucking around with enabling and disabling various repos and then having to reinstall packages multiple times so it would actually use the correct (read: packman) ones. Then that broke sound-juicer which I discovered (after looking through the source of sound-juicer and the /usr/lib/gstreamer-0.10 directory) as due to giosink missing. You’d think sound-juicer’s fucking error message would say that, but no, all it says is the plugin or file access is not installed – check the documentation. What plugin? How am I meant to know what that is? There is a metric fuck-ton of gstreamer plugins that deal with file access as far as I can tell, which one do you want that isn’t there? And what documentation? The sound-juicer docs? The gstreamer docs? And where would I find either of these?

    FUCK YOU sound-juicer! You vague, mocking bastard!

    So, I googled to find where to get the giosink plugin. It’s in the ‘base’ set of plugins, or should be but apparently not in the packman version. Fuck. So I downloaded the original SUSE version, extracted the giosink .so file out of it using a horrible bunch of rpm2cpio and cpio commands and copied that into my systems gstreamer plugin dir.

    Thank you so much SUSE, sound-juicer and packman for wasting my time.

     
  • Dark Liquid 9:11 pm on December 21, 2008 Permalink | Reply
    Tags: fixes, hdmi, , installation, , opensuse, pulseaudio, troubleshooting, upgrades   

    Ohhhhh Yeeeaaaahhh! 

    This is why I love Linux. When you have a problem, research and perseverance will get you through. You aren’t stuck because everything is some stupid proprietary driver or because the various subsystems of your OS don’t provide any logging or configuration.

    Today, Lostprocess and I upgraded my mediabox to OpenSUSE 11.1. Installing the fglrx drivers was a bit of an arse but eventually we got it working. Then, we decided to try to setup the HDMI.

    Now, I’ve always had a problem with this. I have an Asus P2A something or other which has a M2R68L motherboard. It’s always had some issue or other with it and has never worked properly.

    Getting the video to work was easy enough, but the sound was fucked. Nothing would come through.

    Eventually we solved it.

    First of all we set some module options, like so:

    But restarting the module with the new settings didn’t help. Eventually it came to light that the problem was to do with pulseaudio.

    Pulseaudio was auto-detecting only some of the cards and refusing to send data to the HDMI output. We disabled the hardware auto-detection and forced it to setup the HDMI output as it’s sole audio sink. That sorted it and we were hearing audio via the HDMI! Woohoo!

    Basically we commented out the load-module module-hal-detect and module-detect lines and then added a new line something like: load-module module-alsa-sink device=hw:1,3

    That sorted it out. There is probably a better way to set the default audio sink of pulseaudio, but I don’t know what it is so disabling every sink except the one I want works out too. Lostprocess actually found the pulseaudio lines required to hack this up, so kudos to him.

    VLC seems to have issues with pulse audio or something. Playback with VLC was really juddery consistently but Totem (and anything using gstreamer as well) seems to playback everything fine. Even 720p stuff plays quite nicely (my TV is a 1080i but 720p plays better on it really) which is something that’s always been crappy before.

    Overall I’m rather pleased, both with OpenSUSE 11.1 (which is miles better than 10.3 which I had upgraded from – no more waiting for ever for bloody zypper to update the repo caches!) and with the nice, shiny HDMI output. Ohhhhh yeeeeaaaahh!

     
  • Dark Liquid 9:03 am on December 8, 2008 Permalink | Reply
    Tags: friends,   

    Of Epic Win and Epic Fail 

    Well, this weekend was Epic. Bytey and Andrea came down and we hung out, did some geocaching and nearly made Bytey asphyxiate due to laughing on several occasions. It’s so awesome to be able to hang out like that, something we must do more often. Unfortunately, there was a tiny taint of fail. Dru had to work all weekend and Lost was broken on Sunday. We were also going sit down and so some reverse engineering but it was just too much hassle setting up wireless packet sniffing so couldn’t be bothered in the end. We found a cache in Poole Park but failed finding one at Blake Hill Viewpoint but to be honest that was all part of the fun.

    Overall, much awesomeness and randomness ensued. We watched films, played Guitar Hero World Tour (and Bytey was bitten by the drumming bug) and hacked at some android code.

    Mmmmmm, geeeksto….

     
  • Dark Liquid 7:46 am on December 5, 2008 Permalink | Reply
    Tags: , hacking, server, ssh   

    Kick-arse SSH authorised_keys tricks 

    SSH is awesome. Not only is it a package of a secure remote shell, secure remote copying and secure FTP-ing, there are a whole bunch of extra features hidden away that allow you to do lots of cool things, like key-based authentication.

    Now, key-based authentication has some pretty cool extra features as well. By using some of the options it provides, you can make your own authentication scheme and restricted shell on top of a single user. What that means is that several people can log into the same user, but depending on their keys, you can give them different permissions to do different things or no any number of cool things based entirely on the unique identity given to them by the key they are logging in with.

    It’s this way that gitosis, a git repository management system works, and probably how gitorius and github work too.

    Here is a simple example (DISCLAIMER – no idea if this exact code actually works, writing stuff made up from memory here, but you should get the idea):

    And you can provide different commands for different keys. What you can do is write a more complicated script to run as the command and give it arguments to identify the key that is running it for example. That script can then look at the original command request and do all sorts of things, like check a database to see if this particular key is authorised to run that command with those arguments or any number of things.

    At the office, we’ve written a simple git repository authentication system where we can all login as the same user, but a script will authenticate us against a configuration file to work out whether we have read and/or write permissions against whatever repo we are trying to access. It’s awesome and there is so much more you can do with it.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel