The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,842 other followers

Archive for the ‘C’ Category

Building OpenSSL on Windows

Posted by jpluimers on 2017/10/03

Some very interesting links:

–jeroen

Posted in C, C++, Development, Software Development, Visual Studio C++ | Leave a Comment »

MAC-Telnet: Open source MAC Telnet client and server for connecting to Microtik RouterOS routers and Posix machines via MAC address.

Posted by jpluimers on 2017/08/22

Found out about this a while ago:

MAC-Telnet – Open source MAC Telnet client and server for connecting to Microtik RouterOS routers and Posix machines via MAC address.

Source: haakonnessjoen/MAC-Telnet: Open source MAC Telnet client and server for connecting to Microtik RouterOS routers and Posix machines via MAC address. [Fork]

Background:

Earlier, I wrote about a Wireshark plugin for dissecting Mac-Telnet packets. Now I have created an open source application for connecting to a RouterOS router.

Source: RouterOS Mac-Telnet application for Linux users | Håkon Nessjøen [WayBack]

My previous post was about RouterOS Mac-Telnet application for Linux users where I talked about the MAC-Telnet client I created for Linux users.

Source: MAC-address based Telnet server in Linux | Håkon Nessjøen [WayBack]

–jeroen

Posted in C, Development, Internet, MikroTik, Power User, Routers, Software Development | Leave a Comment »

What is the right way to convert into UNIX timestamp from the date and time in C/C++? – Stack Overflow

Posted by jpluimers on 2017/08/16

Thanks R.. for answering this:

POSIX has a formula for exactly what you want:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_15 [WayBack]

tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
    (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
    ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400

This works whenever you have a broken-down time in GMT, even if the underlying system’s mktime, etc. functions do not use the same format time_t as “Unix timestamps”.

If your original time is in local time, you can use mktime and gmtime to convert it to GMT using the system’s notion of timezone rules. If you want to apply your own timezone offset rules, just do that manually before using the above formula.

Source: What is the right way to convert into UNIX timestamp from the date and time in C/C++? – Stack Overflow [WayBack]

For testing and more examples: Epoch Converter – Unix Timestamp Converter [WayBack]

Hopefully this will help me getting better implementations for these:

–jeroen

Posted in Algorithms, C, C++, Development, Software Development | Leave a Comment »

wintee/wintee at master · jpluimers/wintee

Posted by jpluimers on 2017/03/28

I salvaged one of the many incarnations of wintee: wintee/wintee at master · jpluimers/wintee

So I’ve another tee implementation apart from my C# port of tee.

–jeroen

via: cmd – Displaying Windows command prompt output and redirecting it to a file – Stack Overflow

Posted in C, Development, Software Development | Leave a Comment »

Bash on C steroids… Tavis Ormandy: Just when you thought we couldn’t take this any further…

Posted by jpluimers on 2016/11/12

Calling C libraries from bash with virtual automatic data conversion based on symbol info in the .so files.

Source: Tavis Ormandy: Just when you thought we couldn’t take this any further…

Via: From the I wish it was PHP Dept: Calling native C functions from arbitrary shared libraries, using auto-generated marshaling relying on implementation details of bash associative arrays for member order preservation. “There’s enough data in the compiler debugging data for us to reconstruct the original types, so we parse it and translate it into a format that can be used in bash – It’s surprising how well this works!” The surprising thing is that works at all. – Kristian Köhntopp – Google+

–jeroen

Posted in bash, C, Development, gcc, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: