Search Results

Search found 5 results on 1 pages for 'mathijs'.

Page 1/1 | 1 

  • Managing multiple ssh keys

    - by Mathijs Kwik
    I have a lot of ssh keys, they are all passphrase protected and managed by ssh-agent. As a result of this, I am now getting "Too many authentication failures" on some connections. As has been explained on this site before, this is because ssh will try all keys the agent throws at it. The proposed solution is to use IdentitiesOnly in the config, together with an IdentityFile. While this indeed stops offering wrong keys, it seems it completely disables the agent in full, so now I have to type the passphrase on every connection. I could not find clear info about this. Does IdentitiesOnly just disable getting keys from ssh-agent in full? Or should it just block out the keys that aren't mentioned? Thanks, Mathijs # here's my config ~% cat .ssh/config Host bluemote HostName some.host.com IdentitiesOnly yes IdentityFile /home/mathijs/.ssh/keys/bluebook_ecdsa # I had the key loaded into the agent, shown here ~% ssh-add -L ecdsa-sha2-nistp521 SOME_LONG_BASE64_NUMBER== /home/mathijs/.ssh/keys/bluebook_ecdsa # but it doesn't seem to get used ~% ssh bluemote Enter passphrase for key '/home/mathijs/.ssh/keys/bluebook_ecdsa':

    Read the article

  • Dynamic menu items (change text on click)

    - by Mathijs Delva
    Hello, i need some help with a menu. See the following menu: menu The code for this menu: <div id="menu"> <ul> <li class="home"><a href="#home" class="panel">home / <span class="go">you are here</span></a></li> <li class="about"><a href="#about" class="panel">about / <span class="go">go here</span></a></li> <li class="cases"><a href="#cases" class="panel">cases / <span class="go">go there</span></a></li> <li class="photos"><a href="#photos" class="panel">photos / <span class="go">maybe here</span></a></li> <li class="contact"><a href="#contact" class="panel">contact / <span class="go">or even here<span></span></a></li> </ul> </div> What i want to do: onclick a menu item: 1. change the red text to yellow 'you are here' 2. change the previous menu item back to its original state (eg red and "go here"). The 4 values "go here", "go there", "maybe here", "or even here" are the 4 values that should be assigned to the other menu items (like the example). This is the code i already have: $('#menu ul li.home').addClass('active') $('#menu ul li.active a .go').html("you are here"); $("#menu ul li").click(function () { $('#menu ul li.active').removeClass('active'); $(this).addClass('active'); $('#menu ul li.active a .go').html("you are here"); }); var arr = [ "go here", "go there", "maybe here", "or even here" ]; var obj = { item1: "go here", item2: "go there" ,item3: "maybe here", item4: "or even here"}; $('#menu ul li').click(function () { var str = $('#menu ul li.active a .go').text(); $('#menu ul li.active a .go').html(str); }); As you see, it's incomplete. I don't how to get the values from the array and assign them too a menu item. The replace text works, but not the change-back-to-original-state. Also, right now, for some reason i can't click ONTO the list item itself in order to activate the jquery code. I need to click just a few pixels under it. But i guess that's a css issue. If anyone can help, i'd be super thankful! Regards, Mathijs

    Read the article

  • Convert a byte array to a class containing a byte array in C#

    - by Mathijs
    I've got a C# function that converts a byte array to a class, given it's type: IntPtr buffer = Marshal.AllocHGlobal(rawsize); Marshal.Copy(data, 0, buffer, rawsize); object result = Marshal.PtrToStructure(buffer, type); Marshal.FreeHGlobal(buffer); I use sequential structs: [StructLayout(LayoutKind.Sequential)] public new class PacketFormat : Packet.PacketFormat { } This worked fine, until I tried to convert to a struct/class containing a byte array. [StructLayout(LayoutKind.Sequential)] public new class PacketFormat : Packet.PacketFormat { public byte header; public byte[] data = new byte[256]; } Marshal.SizeOf(type) returns 16, which is too low (should be 257) and causes Marshal.PtrToStructure to fail with the following error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I'm guessing that using a fixed array would be a solution, but can it also be done without having to resort to unsafe code?

    Read the article

  • Protocol specification in XML

    - by Mathijs
    Is there a way to specify a packet-based protocol in XML, so (de)serialization can happen automatically? The context is as follows. I have a device that communicates through a serial port. It sends and receives a byte stream consisting of 'packets'. A packet is a collection of elementary data types and (sometimes) other packets. Some elements of packets are conditional; their inclusion depends on earlier elements. I have a C# application that communicates with this device. Naturally, I don't want to work on a byte-level throughout my application; I want to separate the protocol from my application code. Therefore I need to translate the byte stream to structures (classes). Currently I have implemented the protocol in C# by defining a class for each packet. These classes define the order and type of elements for each packet. Making class members conditional is difficult, so protocol information ends up in functions. I imagine XML that looks like this (note that my experience designing XML is limited): <packet> <field name="Author" type="int32" /> <field name="Nickname" type="bytes" size="4"> <condition type="range"> <field>Author</field> <min>3</min> <max>6</min> </condition> </field> </packet> .NET has something called a 'binary serializer', but I don't think that's what I'm looking for. Is there a way to separate protocol and code, even if packets 'include' other packets and have conditional elements?

    Read the article

  • Responsive: two different toggles on same element

    - by Mathijs Delva
    I'm having difficulties with the following problem. For a responsive website, i need to use the same toggle element for both a toggle system for one window width, and another toggle system for a second window width. I have the following snippets: 1.A simple hover for a language dropdown, which should be executed for resolutions greater than 980px. $('#clickme').hover(function() { $(this).parent().find("#select-language").show(); $(this).find("> a span").css({"opacity":"0.5"}); }, function() { $(this).parent().find("#select-language").hide(); $(this).find("> a span").css({"opacity":"1"}); }); 2.A simple click for the same language toggle, which should be executed for resolutions smaller than 980px. jQuery('#clickme').click(function() { jQuery("#select-language-mobile").slideToggle("fast"); }); I need to nest these two, so that when the user is viewing the website in one resolution, the click function with be fired, and in the other case the hover function. Can anybody help me with this? PS: I'm sorry, but the code blocks don't seem to work at the moment.

    Read the article

1