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 January 10th, 2017

Ever wanted to download adb or fastboot without having to download the whole of Android Studio?

Posted by jpluimers on 2017/01/10

Quotes from [WayBack] Ever wanted to download adb or fastboot without having to download the whole of Android Studio?…but didn’t want to download executables from some… – Elliott Hughes – Google+

Article:

These links will always return the adb/fastboot binaries currently shipping with Android Studio. No need to guess what the current version is, or update your own links: just follow these and get the latest binaries, direct from the source.

Comments:

A package manager is overkill. `wget -O adb.zip  https://dl.google.com – dl.google.com/android/repository/platform-tools-latest-linux.zip && unzip -d ~/bin/ adb.zip && export PATH=”$PATH;~/bin/platform tools”` should let you call `adb devices` and you can add the export to your .bashrc if you want it always available without changing into ~/bin/platform tools.
+Elliott Hughes Any chance we can get something to tell us when it is updated? I know you probably don’t care about bandwitdh, but would be nice to know when updates are pushed.

+dragon788 dragon_788 Or, you can install adb & fastboot from the repo’s then run this script every once in awhile to stay up to date:

#!/bin/bash
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip \platform-tools-latest-linux.zip
sudo cp platform-tools/adb /usr/bin/adb
sudo cp platform-tools/fastboot /usr/bin/fastboot

–jeroen

via: [WayBack] finally.gif… – Koushik Dutta (Koush) – Google+

Posted in Android, Development, Mobile Development, Software Development | Leave a Comment »

Batch file to get a (non-sorted non-unique) list of units from a Delphi compiled map file

Posted by jpluimers on 2017/01/10

A few weeks ago in When you get “TfsScript.Execute” throwing a “Unregistered version of FastScript.” I wrote about “a process that explains any modules in the MAP file not resulting in DCU files”.

The below batch file aids in that process.

It takes a MAP file from your Delphi compiled executable that has debug information in text format which means you need to set your project linker options to generate detailed MAP files.

The Map Debug File (*.map) – RAD Studio documentation hasn’t much information but points to Detailed-Segments Map File – RAD Studio which has a bit more. Neither contain information on Delphi units as they focus too much on the C++ side of things. Then there is a tiny bit information in Understanding Delphi MAP File – Stack Overflow.

So I did some spelunking and came up with this batch-file which will likely work back until about the Delphi 7 era:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »

whatismylocalip alias (actually more like whataremylocalips) and some sed links

Posted by jpluimers on 2017/01/10

Getting the local IP (actually IPs, but most hosts only have a single IP):

# OS X:
alias whatismylocalip='ifconfig | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''
# Linux:
alias whatismylocalip='ip a | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''

I got them via bash – How to I get the primary IP address of the local machine on Linux and OS X? – Stack Overflow

Mac OS X and BSD have ifconfig, but most Linux distributions don’t use ifconfig any more in favour of iproute2, so you use ip a (which is shorthand for ip address show) there.

Their output is similar enough for the sed to work, though. Which surprised be because I didn’t know about the -E option (it lacks in the manual Linux page but it is in the Mac OS X one) which enables POSIX extended regular expressions. In Linux this is documented as -r, but -E also works.

I learned this through the Sed – An Introduction and Tutorial which compares the various versions of sed which also explains about the -n doing no printing.

–jeroen

Posted in *nix, *nix-tools, Apple, bash, bash, Development, Linux, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, openSuSE, OS X, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed | Leave a Comment »

 
%d bloggers like this: