Painful lesson learned a while ago: In operations, code is not your friend. Make things simple, make them boring and make them obvious, and keep an eye on the configuration complexity cloc… – Kristian Köhntopp – Google+
In operations, code is not your friend. Make things simple, make them boring …
Posted by jpluimers on 2018/11/21
Posted in Cloud, Development, DevOps, Infrastructure, Software Development | Leave a Comment »
Date and time conversion is hard in databases: `conversion error from string “30-12-1899″`
Posted by jpluimers on 2018/11/21
Converting string literals to to date/time/timestamp related data is always tricky in many Database environments.
Firebird is no exception, especially because sometimes it truncates a zero time portion from a date-time/timestamp.
So you can get this:
select cast('30-12-1899' as TimeStamp)
from rdb$databaseThrowing an error:
conversion error from string "30-12-1899"
And this:
select cast('30.12.1899' as TimeStamp)
from rdb$databaseReturning
CAST
30-12-1899 0:00:00
–jeroen
Posted in Database Development, Development, Firebird, Software Development | Leave a Comment »
A repository with a hierarchy or modules referencing each other might not be a good idea
Posted by jpluimers on 2018/11/20
When creating a library of libraries where the libraries use parts of the other libraries creates a mess when organised as a repository with subrepositories having other subrepositories.
It might be better to have one big repository containing a suite of functionality. This is why darkThreading became part of darkGlass: [WayBack] Why no git submodules for the libraries it depends on? · Issue #1 · chapmanworld/darkThreading · GitHub:
You might want to maintain that suite as one big versioned repository, with a different means of structuring it than a tree of submodules. That way you can keep the more complex interdependencies between the parts you have now.
Example of the mess: [WayBack] Duplicate submodules with Git – Stack Overflow
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Where does my git question go? – Programmers Meta Stack Exchange
Posted by jpluimers on 2018/11/20
StackOverflow / StackExchange is growing too large:
You’ve got a question about git. Its not uncommon, lots of people have questions about git. But where should the question be asked?
Source: Where does my git question go? – Programmers Meta Stack Exchange
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, GitHub, Opinions, Pingback, Software Development, Source Code Management, SourceTree, Stackoverflow | Leave a Comment »
Reminder to Self: check if NameOf has been implemented yet
Posted by jpluimers on 2018/11/20
It’s been a wish for a very very long time: to get the name of an identifier as a string in Delphi:
- [WayBack] How to get current method’s name in Delphi 7? – Stack Overflow
- [WayBack] How To Get the Name of the Current Procedure/Function in Delphi (As a String) – Stack Overflow
For now the best one can do is either using an Assert and catching the exception (it gets you the unit name, source file name and source line number) in the links below, or using debug symbol information (like a MAP or TDS file) mentioned in the StackOverflow questions above.
C# has had a [WayBack] nameof for many years now that is evaluated at compile time: [WayBack] c# – Is nameof() evaluated at compile-time? – Stack Overflow.
There is a request RAD Studio – RSP-13290: NameOf(T) compiler (magic) function in Quality Portal by Horácio Filho about 3 years ago quotes below.
Since it took the C# team about 3 years after the original [WayBack] Add nameof operator in C# – Visual Studio request, I wonder how fast the Delphi team is.
NameOf .NET-like compiler magic (intrinsic) function would eliminate a lot of hand-written exception messages from several units.
C# 6 introduced nameof operator to obtain the simple (unqualified) string name of a variable, type, or member.
With the current Delphi implementation, after changing variables name we have ot change the related exception message as well. Putting variables name in the code is not a good practise, and is here that NameOf taking place saving tons of lines of code. As the result of NameOf(T) function (if so) is evaluated at compile time (according to the C# implementation – http://stackoverflow.com/a/26573179) we need a help from compiler or it could be achieved using RTTI.
There is a discussion on Google+ community [WayBack] https://plus.google.com/+StefanGlienke/posts/AsGHSLF4rTX.
The function could be designed as
NameOf(x: Identifier)
following the same (or similar) warranties C# provides.
Using Assert:
- Delphi – class helper to get SourceFileName from an EAssertionFailed « The Wiert Corner – irregular stream of stuff
- Delphi – getting the sourcefile name from a source file with an Assert trick using EAssertionFailed « The Wiert Corner – irregular stream of stuff
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
RegExr: Online Regular Expression Testing Tool
Posted by jpluimers on 2018/11/19
[WayBack] Kevlin Henney – Google+ reminded me of RegExr. Then I found out I collected the below links in 2010, but never published them. Hopefully a few still exist. Let’s see… yup: all do, but archived just in case.
- Online tool: [new Archive.is / old Archive.is] RegExr: Online Regular Expression Testing Tool.
- Offline tool: [WayBack] Expresso.
Some other links (that show how much the landscape changed in 8.5 years time):
- [WayBack] http://myregexp.com/[^]
- [WayBack] http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers[^]
- [WayBack] http://www.techotopia.com/index.php/MySQL_Regular_Expression_Searches[^]
- [WayBack] http://regexlib.com/[^]
- [WayBack] http://www.regular-expressions.info/[^]
–jeroen
Posted in Development, RegEx, Software Development | Leave a Comment »
EPOX EP-8RDA3i motherboard with code FF before POST starts
Posted by jpluimers on 2018/11/19
From a long time ago: EVGA motherboard are very similar to EPOX ones (they
Once I had an FF motherboard code before even the POST started on an EP-8RDA3i motherboard.
Basically taking everything out, clearing the CMOS and putting everything back in solved the problem:
- [WayBack] Epox motherboard with Post code FF – AnandTech Forums
- [WayBack] Epox 8RDA3+: code FF on power on – Ars Technica OpenForum
The capacitors were still OK.
–jeroen
Posted in Hardware, Power User | Leave a Comment »
Refurbish the battery on an HP P410 BBWC | Opensource Blog
Posted by jpluimers on 2018/11/19
TL;DR: BBWC are using NiMh batteries that you can replace with bigger ones.
Source: [WayBack] Refurbish the battery on an HP P410 BBWC | Opensource Blog
Via: [WayBack] Very useful hack if you are running old HP Xeon servers and want to use the original disk controllers and spinny rust. – Alan Cox – Google+
–jeroen
Posted in Hardware, Power User, RAID | Leave a Comment »
nmap for Windows: ncat as a TCP client to servers
Posted by jpluimers on 2018/11/16
Downloads are from a bit cryptic page [WayBack] Download the Free Nmap Security Scanner for Linux/Mac/Windows via [WayBack] Windows | Nmap Network Scanning.
An alternative is to go to [WayBack] nmap.org/dist, then search for the bottom most files having .exe or .zip extensions.
It is much more modern than netcat (see some links on that below) and has elaborate documentation:
- [WayBack] Ncat – Netcat for the 21st Century
- [WayBack] Ncat Users’ Guide
- [WayBack] Neat Tricks | Ncat Users’ Guide
Unwrap SSL
Suppose you need to connect to an IMAP server that requires SSL, but your mail reader doesn’t support SSL. Ncat can act as the encrypted bridge to connect the client and server. You will connect the mail client to a local port and Ncat will forward the traffic, encrypted, to the server. Here’s how to connect IMAP (port 143) on the local host to IMAP over SSL (port 993) on
imap.example.com.ncat -l localhost 143 –sh-exec “ncat –ssl imap.example.com 993”
- [WayBack] Neat Tricks | Ncat Users’ Guide
- [WayBack] Chapter 17. Ncat Reference Guide | Nmap Network Scanning
- [WayBack] Examples | Nmap Network ScanningCreate an HTTP proxy server on localhost port 8888.ncat -l –proxy-type http localhost 8888
As a comparison some netcat links:
- [WayBack] How To Use Netcat to Establish and Test TCP and UDP Connections on a VPS | DigitalOcean
- [WayBack] How to simulate a TCP/UDP client using Netcat – Ubidots Blog
- Netcat – Wikipedia
–jeroen
Posted in *nix, nmap, Power User | Leave a Comment »
Convert/adapt an old ATX Power Supply into a Bench Power Supply with (or without) 3D Printed Parts
Posted by jpluimers on 2018/11/16
An interesting idea, although I would slightly modify it so I can -12V and -5V as well and maybe other voltage combinations too:
- [WayBack] Convert an old ATX Power Supply into a Bench Power Supply with (or without) 3D Printed Parts.
- [WayBack] Benchtop power supply with ATX connector
They are based on these underlying links:
- [WayBack] ATX to Benchtop Power Supply by elliotboney – Thingiverse
- [WayBack] Convert ATX PSU to Bench Supply to Power Circuits
Note that some of the newer power supplies with 24-pin molex connectors do not give you -5V any more.
A few notes:
- depending on the age, ATX supplies can get you these voltages: -12V, -5V, 0V, +3.3V, +5V, +12V
- -12V and -5V have very limited currents
- newer power supplies often do not have -5V (especially the ones having 24-pin connectors)
- newer power supplies have limited +5V power, but higher +12V power
- older power supplies have limited +12V power, but higher +5V power
- always take pictures of all connectors and the wire colours connected to them before starting (especially before cutting any wires)
- this allows you to find back:
- non-standard wire colours
- configurations not covered here
- this allows you to find back:
- to get stable 12V, you need a 5V load of about 5W:
- between RED (+5V) andBLACK (GND),
- for instance with pin 3 and pin 4,
- or over one of the molex/floppy connectors: pins RED-BLACK
- as load,
- use at least a 10V/10W resistor or 12v/10W halogen lamp
- ensure they are cooled well
- to get stable 12V, you need a 12V load of about 10W
- between YELLOW (+12V) andBLACK (GND),
- for instance with pin 10 and pin 17,
- or over one of the molex/floppy connectors: pins YELLOW-BLACK
- as load,
- use at least a 20V/20W resistor or 12v/20W halogen lamp
- ensure they are cooled well
if your power supply has a BROWN (+3.3VS),
- then ensure it is connected to ORANGE (+3.3V)
- as brown is the SENSING wire to check 3.3V is OK.
- then ensure it is connected to ORANGE (+3.3V)
- to turn the power supply on,
- short GREEN (PWR_ON, pin 14) and BLACK (GND, pin 15)
- to know when the power is on:
- connect a LED via a resistor between GREY (PWR_OK, pin 8) and BLACK (GND, pin 7)
- to know when there is mains power:
- connect a LED via a resistor between PURPLE (+5VSB, pin 9: stand by) and BLACK (GND, pin 7 or pin17)
- Wikipedia: ATX Power supply describes
- PWR_OK (often called Power Good)
- +5VSB (stand by)
- read the specs of your power supply to understand how much current it can deliver on which lines
- some more current information
- [WayBack] Power spec for the PCI-E 8 pin power plug – [Solved] – Components
- PCI-E 6 pin: Pins 1 & 3 are 12V & each can carry 8 A, totaling 12V*8A*2= 192W
- PCI-E 8 pin: Pins 1,2,3 are 12V & each can carry 8 A (before ~ March 2005) or 11 A (after ~ March 2005), totaling 12V*8A*3=288 W or 12V*11A*3=396W
- It also explains why not all pins in these connectors are connected or can carry current.
- Not just the connector, also the wires matter: American wire gauge: Tables of AWG wire sizes (and A rating)
- To get a feel read [WayBack] Using PC power supplies in things other than PCs and the pages he links to (see list further below)
- [WayBack] Power spec for the PCI-E 8 pin power plug – [Solved] – Components
Example for loads: https://www.youtube.com/watch?v=gKgziA46wFY; more on why you need them and how to choose:
[WayBack] How to calculate suitable dummy load for a power-supply?- [WayBack] PC Power Supply – Power supplies (PSUs) built for commodity PCs, typically ATX PSUs – Base Load
- [WayBack] ATX power supply 5V load resistor for better 12V regulation
- [WayBack] Converting an ATX Power Supply Into a DC Bench Supply
- [WayBack] ATX to Lab Bench Power Supply Conversion
- [WayBack] ATX Based Lab Power Supply
- Don’t choose the wrong resistor… [WayBack] Convert an ATX Power Supply Into a Regular DC Power Supply!
With a few more modifications you can [WayBack] Convert a Computer Power Supply to a Variable Bench Top Lab Power Supply.
I will probably go for this solution as it is easier to swap power supplies.
–jeroen
Via: [WayBack] Nice recycling of an old ATX power supply with a 3D printed part and a few accessories and cables… – Jean-Luc Aufranc – Google+
Read the rest of this entry »
Posted in Development, Hardware Development | 3 Comments »





