The Wiert Corner – irregular stream of stuff

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

  • 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,839 other subscribers

Archive for the ‘Development’ Category

git – How to undo the last commit? – Stack Overflow

Posted by jpluimers on 2016/05/31

Always handy to have at hand as the git-reset documentation is toooooo long:

Undo a commit and redo

$ git commit ...              (1)
$ git reset --soft HEAD~1     (2)
<< edit files as necessary >> (3)
$ git add ....                (4)
$ git commit -c ORIG_HEAD     (5)
  1. This is what you want to undo
  2. This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message1, or both. Leaves working tree as it was before “commit”.
  3. Make corrections to working tree files.
  4. Stage changes for commit.
  5. Commit the changes, reusing the old commit message. reset copied the old head to .git/ORIG_HEADcommit with -c ORIG_HEAD will open an editor, which initially contains the log message from the old commit and allows you to edit it. If you do not need to edit the message, you could use the -C option instead.

–jeroen

via: git – How to undo the last commit? – Stack Overflow.

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

domain name system – How to test DNS glue record? – Server Fault

Posted by jpluimers on 2016/05/26

Thanks Adrian W for providing the below example in your answer about obtaining GLUE record information for a domain.

It is an excellent showcase for the $IFS Internal Field Separator available in any nx shell.

In this case it is used to get the TLD (top-level domain) from the domain name specified at the command-line.

After that, it obtains the name servers for that TLD, and queries the glue records there, both using dig.

Here is a little shell script which implements Alnitak’s answer:

#!/bin/sh
S=${IFS}
IFS=.
for P in $1; do
  TLD=${P}
done
IFS=${S}

echo "TLD: ${TLD}"
DNSLIST=$(dig +short ${TLD}. NS)
for DNS in ${DNSLIST}; do
  echo "Checking ${DNS}"
  dig +norec +nocomments +noquestion +nostats +nocmd @${DNS} $1 NS
done

Pass the name of the domain as parameter:

./checkgluerecords.sh example.org

–jeroen

via domain name system – How to test DNS glue record? – Server Fault.

Posted in *nix, Apple, bash, Development, DNS, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, openSuSE, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

Git: See my last commit – the forrest and the trees – Stack Overflow

Posted by jpluimers on 2016/05/25

There are so many ways to view the last Git commit on the command-line.

On the one hand this shows the versatility of Git. On the other hand there are so many trees in the forrest, that it is hard for people to find how to do simple things.

The one I like most is this:

git show --name-status --oneline

Others:

git log --name-status HEAD^..HEAD
git log -1
git show
git diff
git show --name-status
git log --stat -n 1

–jeroen

via: Git: See my last commit – Stack Overflow.

Posted in Development, DVCS - Distributed Version Control, git, Source Code Management | Leave a Comment »

Delphi XE8 does not adhere the `$(PROJECTNAME)` in a “Unit Output Directory”, but does recognise `$(SanitizedProjectName)`…

Posted by jpluimers on 2016/05/24

The background here was a quick project at a client where many .dproj files were in the same directory, but they suffered from conditional define differences. Which meant that even if they were all using the  DEBUG configuration, some defines in the .dproj directories were different therefore poisoning shared .DCU files (as Delphi does not automatically rebuild them when the sources have not changed even though the IDE switched to a new project).

There was no quick possibility to reorganise the project structure (a combination of a version system history being problematic and potentially lots of relative path references in the .dproj and .dpr files could still be broken) so I wanted different “Unit Output Directories” for each project preferably using non-hardcoded project name.

So I tried putting $(PROJECTNAME) in a “Unit Output Directory”. But unlike build-events – where that one has a value – in the Directory it hadn’t.

To cut things short, Uwe Raabe did some spelunking in the .dproj file and found that $(SanitizedProjectName) was recognised so I switched to .\$(Platform)\$(Config)\$(SanitizedProjectName).

Putting it in the OutputDirectory (where your .EXE gets emited) fails for most part. Yes, the .EXE gets put in the right directory. No, the debugger cannot find it as it thinks it needs to use %SanitizedProjectName%. No for TestInsight: it cannot find the EXE either because of the % expansion.

Based on SanitizedProjectName, I did some more spelunking coming with the below list. Remember though:

Only tested for Win32 applications for Delphi XE8

I assembled the list by doing a quick sed on a Delphi XE8 Win32 .dproj file transforming all XML element names to $() form then running it through a uniq like script. After that I added each of them in a “Unit Output Directory” prepended with .\_\ (well I cheated a bit, I did them in groups separated by a back-slash and went back to single items in case of failures. A kind of ‘binary search’).

Ensure the ones you use, are defined before you use them. For example: the definition of SanitizedProjectName need to be in the .dproj file before actually using SanitizedProjectName.

These expand to empty strings:

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi XE8, Development, Event, Software Development | 2 Comments »

Somfy Smoove Origin RTS Protocol | PushStack

Posted by jpluimers on 2016/05/24

Interesting: Somfy Smoove Origin RTS Protocol | PushStack a base to start Hacking Somfy.

The Somfy protocol is tricky as it uses rolling keys.

More interesting links:

These are in Dutch, but very interesting as they show how to do reverse engineering and getting it to work hardware wise:

Read the rest of this entry »

Posted in Arduino, Development, Hardware Development, Hardware Interfacing, Raspberry Pi | Leave a Comment »

The Sons of Kahn and the Witch of Wookey • The Register

Posted by jpluimers on 2016/05/20

Verily, they did make support for the Internet of Things.

As always, brilliant writing. For instance:

  • “But there was also the Youth Faction, who were indeed very young, some being barely in their mid-forties.”
  • “Ask a Delphic question, get a Delphic answer” –

Source: The Sons of Kahn and the Witch of Wookey • The Register

via: David Heffernan – Google+

–jeroen

Posted in Delphi, Development, Fun, History, Software Development | Leave a Comment »

Android ADB over TCP/IP

Posted by jpluimers on 2016/05/19

Android ADB over TCP/IP can be a bit of a pain to setup. Some devices have a built-in option to enable this (by default on port 5555), otherwise you have to connect through USB first, then use ADB to enable TCP/IP:

adb tcpip 5555

I got it to work without being root, but on some devices you need to be.

See these links for more information:

Note that while writing this, ADB For Chrome could not run over TCP/IP.

–jeroen

Posted in Android, Android Devices, Development, Mobile Development, OnePlus One, Power User, Software Development | 2 Comments »

networking – Is there a command or application similar to ipconfig? – Android Enthusiasts Stack Exchange

Posted by jpluimers on 2016/05/18

Trick:

use “netcfg” to list all available devices

It will show you the IP addresses associated with them too.

On my OnePlus One, it was wlan0.

–jeroen

via networking – Is there a command or application similar to ipconfig? – Android Enthusiasts Stack Exchange.

Posted in Android, Android Devices, Development, Mobile Development, OnePlus One, Power User, Software Development | Leave a Comment »

Setting your DTAP environments apart: Push a solid colored background to a Windows Server 2012 or later | Tidbits of Information from Virot

Posted by jpluimers on 2016/05/17

This post summarises it nicely: [Wayback/Archive.is] Push a solid colored background to a Windows Server 2012 or later | Tidbits of Information from Virot.

I already knew about the one below, but the post above gives a more complete picture with:

  • Background color
  • Wallpaper
  • tells how to set the menu and

These I already knew:

–jeroen

 

Posted in Agile, Color (software development), Development, Power User, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Windows XP | Leave a Comment »

MOnSter 6502

Posted by jpluimers on 2016/05/16

This is so impressive: MOnSter 6502 basically a 6502 on a PC board running at 100s of kHz.

via:

–jeroen

Posted in 6502, 6502 Assembly, Assembly Language, Development, History | Leave a Comment »