HNHacker News
TopNewBestAskShowJobs

bloblaw

705 karma · joined March 24, 2012

submissionscomments
bloblaw··on The reports of Perl’s death have been greatly exaggerated
Perl is simply a tool. I still use it all the time for small scripts and automation.

I know Python, Go, C#, and a bunch more....but I reach for Perl when the task calls for processing lots of text, or quick automation. Others might reach for Python or Ruby or Go.

For me it's a better bash script, a better grep, a better awk, a better sed. That's what Perl was designed to be, and I don't think any other scripting language matches it for that purpose.

It is not a tool to build desktop applications or the first choice for web applications in 2021.

But it is still extremely useful for its niche...processing data/logs/text, or system administration tasks. It really shines there and that's how I use it.

It's another tool in my toolbox, and learning Perl has made me more productive and I still reach for it today.

bloblaw··on L0phtCrack Is Now Open Source
I work with him now at his current gig. Totally agree. Constantly learning new things from him.
bloblaw··on Registry Explorer: Replacement for the Windows Built-In Regedit.exe Tool
VB6 did support compiling "native" binaries by default, and not to p-code, as previous versions did.

https://blog.decompiler-vb.net/the-truth-about-p-code/

bloblaw··on Registry Explorer: Replacement for the Windows Built-In Regedit.exe Tool
Wow, how times have changed!

I say that because when C# was released, many Windows developers refused to use it and continued to only write Windows programs in "native" languages like C++, VB6, and Delphi.

I must admit my own bias and state that I still prefer applications written in "native" code on Windows (C++ / Delphi) to C#. It's not really an issue worth arguing over these days (and hasn't been for years), but there it is. FWIW, all the SysInternals tools are C++

bloblaw··on The four noisy horsemen of Perl hate
> And you have to do all the work of pulling apart *args to get the data you want, including manually throwing errors if you didn't get what you expected.

Respectfully, isn't this just the same amount of work to define named function arguments?

In Perl you do the work of unpacking the array and then validating data. In Python you have the work of defining the function arguments and then validating the received data.

> Python lets your function signature have required positional arguments, variable positional arguments (*args) AND variable keyword args (*kwargs). And everyone uses these features because it makes programming much more pleasant and manageable.

Perl supports this as well. Same functionality as *kwargs is found by passing a hash to a subroutine. And of course *args is analogous to how Perl subroutines were designed to work.

bloblaw··on The four noisy horsemen of Perl hate
It sounds like you are unfamiliar with this style, not that it "isn't what anyone ordinarily means".

Bash, Ruby, and Perl all support this style of argument passing.

Perl does not have named formal parameters, but instead supports passing arguments as lists / arrays. You can pass any number of arguments of any supported type this way.

If you've never programmed in a language that supports passing arguments in this manner, it will seem foreign.

However, argument passing in this manner has many benefits (eg easy to extend a function def, can easily add optional / req params with basic checking within subroutine) and after 15 min of doing it this way you don't really think about it again.

bloblaw··on The four noisy horsemen of Perl hate
Perl doesn't lack function arguments.

You can pass various arguments to a subroutine like you do in any other programming language and they can be acessed inside the function using the special array @_. Thus the first argument to the function is in $_[0], the second is in $_[1], and so on.

  #!/usr/bin/perl
  
  # Function definition
  sub Average {
     # get total number of arguments passed.
     $n = scalar(@_);
     $sum = 0;
  
     foreach $item (@_) {
        $sum += $item;
     }
     $average = $sum / $n;
  
     print "Average for the given numbers : $average\n";
  }
  
  # Function call
  Average(10, 20, 30);
reference: https://www.tutorialspoint.com/perl/perl_subroutines.htm
bloblaw··on Linux and Powershell
Helge Klein, a long time Windows dev, summed up my complaints about using PowerShell as anything other than a nice shell that sorta feels like *nix:

https://helgeklein.com/blog/2014/11/hate-powershell/

I still use CMD.exe, so please get off my lawn ;-)

When I need the power of Powershell, I use C# (or even Python + Py2Exe if I'm deploying).

bloblaw··on Free Pascal
Very closely.

The original architect of Turbo Pascal is Anders Hejlsberg (https://en.wikipedia.org/wiki/Anders_Hejlsberg), who also was recruited to Microsoft directly by Bill Gates.

Anders went on to architect J++, the .NET Framework and C#, and TypeScript.

C# is heavily influenced by Turbo Pascal / Delphi because they have the same original architect. And Lazarus + FPC are open-source implementations of the Delphi 7 IDE + Object-Pascal language (same as Delphi).

If you are at home in Visual Studio, using Lazarus will feel very familiar.

Object-Pascal is easy to learn. A great site to bookmark when learning Delphi or Lazarus + FPC is: http://www.delphibasics.co.uk/

bloblaw··on Free Pascal
A list of “famous” apps written in Delphi or Lazarus:

https://jonlennartaasenden.wordpress.com/2014/11/06/famous-s...

bloblaw··on Free Pascal
This was written a few years ago with FPC v2.2 (latest is FPC v3.2), but generally matches my experience: https://wiki.freepascal.org/Size_Matters#Analysis_of_various...

tl;dr is that if you create a RELEASE build, should be about 2 - 5mb for a GUI app, depending on the platform. And if you run `upx` against the resulting binary, it will be even smaller.

  Win 7 x64:  
  ------------  
  - 12.3 mb == Default build      
  -  3.2 mb == Default build without debug info
  -  2.1 mb == Optimized compiler
  -  2.1 mb == Optimized compiler without debug info
  
  Ubuntu x64:  
  ------------  
  - 13.4 mb == Default build     
  -  7.5 mb == Default build without debug info
  -  4.4 mb == Optimized compiler
  -  2.7 mb == Optimized compiler without debug info
Optimized compiler means:

    1. Project|Compiler Options|Code|Smart Linkable (-CX) -> Checked
    2. Project|Compiler Options|Linking|Debugging| Uncheck all except `Strip Symbols From Executable (-Xs) -> Checked`Strip Symbols From Executable (-Xs) -> Checked
    3. Project|Compiler Options|Linking|Link Style|Link Smart (-XX) -> Checked
    4. (Optional) Project|Compiler Options|Code|Optimizations|smaller rather than faster -> Checked (Warning: this might decrease performance)
bloblaw··on Free Pascal
Agree++

The "WMI Delphi Code Creator" (written in Delphi) is a great example of this.

"The WMI Delphi Code Creator (WDCC), allows you to generate Object Pascal, Oxygene, C++ and C# code to access the WMI (Windows Management Instrumentation) classes, events and methods. Also includes a set of tools to explorer and Query the content of the WMI."

Note that Object Pascal == Delphi == FreePascal (generally)

https://github.com/RRUZ/wmi-delphi-code-creator

bloblaw··on Free Pascal
For Windows users, just use chocolatey and run: `choco install lazarus`

...and you'll be up and running with (1) FreePascal compiler (2) Lazarus IDE (https://lazarus-ide.org) with integrated debugger and RAD (Rapid Application Development) GUI designer.

Lazarus and FPC can create high-quality native GUI's for macOS, Linux, and Windows. And many open-source 3rd party GUI components can be installed right from within the Lazarus IDE via the "Package" > "Online Package Manager" menu option.

I've been using Delphi and/or Lazarus + FPC for 15 years. It's truly the most productive way to build a GUI desktop application, and makes it extremely easy to build powerful console apps.

bloblaw··on Kali Linux 2020.3
I'll just add to what others have already provided.

  - "Black Hat Go" - https://nostarch.com/blackhatgo  
  - "Black Hat Python" - https://nostarch.com/blackhatpython  
  - "Web Security for Developers" - https://nostarch.com  /websecurity  
  - "Cracking Codes with Python" - https://nostarch.com/crackingcodes
Highly recommend those NoStarch books. Of course, depends what you want to pentest, but this is good general information to get started.
bloblaw··on Apple apologizes to WordPress, won’t force the free app to add purchases
a) It's an opinion that global market share is irrelevant, but I will report the fact that Apple has 58% USA market share.

b) source?

c) But can Apple be a monopoly with 58% of the market and a trillion dollar competitor with 41% of that market...and 75% control of the global market?

A question for the courts, for sure, but it certainly isn't obvious to me.

reference: https://gs.statcounter.com/vendor-market-share/mobile/united...

bloblaw··on Apple apologizes to WordPress, won’t force the free app to add purchases
> They should create legislation to control access to all app stores to prevent this rent seeking

You have a lot of faith in 60+ year old (mostly tech-illiterate men) to fix technology they don't understand. Government isn't the solution to this problem. Developers leaving the app store is probably only what will get Apple to change.

bloblaw··on Apple apologizes to WordPress, won’t force the free app to add purchases
> [..] and its monopolistic anti-competitive practices,

iOS owns 25% of the market. How is that a monopoly? You might not like their policies, but as you mention, you have a choice to move to a competitor with a vastly larger market share.

> I'm better off turning to the Play Store or one of the many other app stores that can be used on Android devices.

Doesn't this demonstrate that the Apple AppStore isn't a monopoly? That you have a clear alternative with 74% market share.

> I'd like to see regulation that forces Apple and Google to allow any and all app stores on their devices,

...but why would they do that? There is healthy market competition between Apple and Google. I'm old, so I remember when Windows dominated everything. That was 2007 (or '98 if you wanna talk IE anti-trust case). 13 years later and Microsoft has 0 market share in mobile devices. In another 13 years it is likely a new competitor could supplant the Google and Apple dominance.

reference: https://gs.statcounter.com/os-market-share/mobile/worldwide

bloblaw··on Apple apologizes to WordPress, won’t force the free app to add purchases
I'm a libertarian. I believe in personal choice and freedom. But you have tons of freedom here.

Instead of using an OS (iOS in this case) with 25% market share that forces you to go through their AppStore, you can choose to use Android (which has 75% market share) and side load apps to your hearts content.

reference: https://gs.statcounter.com/os-market-share/mobile/worldwide

bloblaw··on Diving into Go by building a CLI application
I do like Python, but I think Perl is actually designed (and actually is) a super-charged bash. Perl was created with the purpose of simplifying the combination of bash + awk + sed + grep, a goal it has achieved quite well.

Python has better OO and has won more mindshare than Perl, but I don't think it was ever meant (or accomplishes the goal) of being an "overcharged" bash.

bloblaw··on Google Kubernetes Engine is introducing a cluster management fee on June 6
GCP is actually more the 3rd inferior option, behind Azure. Gartner lists Azure as just behind AWS for IaaS providers, and GCP a more distant 3rd:

https://pages.awscloud.com/Gartner-Magic-Quadrant-for-Infras...

bloblaw··on The boss who put everyone on 70K
Got it here: https://www.geekwire.com/2020/seattle-tech-workers-earn-279k...
bloblaw··on The boss who put everyone on 70K
I worked at Gravity and made much more than $70k. Nobody had their salaries cut. Only the CEO cut his salary from > $1MM to $70k.
bloblaw··on The boss who put everyone on 70K
I used to work at Gravity. Dan (owner of Gravity) is sincere and frankly the real deal.

Dan Price really is like what is presented in this article. He actually cares about his employees and is being genuine here. He's a good person, making a private business decision to increase the pay of frankly his lowest paid workers.

In a city where the average tech worker earns $275k a year, he believes its the right thing to do to make sure everyone that works for him at Gravity can earn enough to afford rent, food, and some fun.

Say what you will about the merits of decision, but it takes real leadership to make it and stand by it. I happen to think he's doing the right thing and I hope other companies choose to follow suit.

bloblaw··on The boss who put everyone on 70K
I worked at Gravity (and was paid well above $70k). There was a lawsuit filed before the $70k thing was even planned.

source: https://www.geekwire.com/2016/dan-price-70k-ceo-prevails-sui...

> Lucas Price served the suit on his brother prior to the $70,000 announcement, and the core allegations related to the preceding years. The suit alleged that Dan Price used his majority control of the company to pay himself excessive compensation, manipulate valuations of the company to his financial benefit, and charge hundreds of thousands of dollars in personal expenses to the company.

FWIW, Dan Price (owner of Gravity) is the real deal.

While I no longer work there, I am proud of what he is doing. He is a capitalist, making a decision as a private business owner to help improve the lives of his employees earning < $70k (in the expensive Seattle area mind you) by reducing his own compensation.

bloblaw··on DigitalOcean is laying off staff
> But why was I paying them for backups that they wiped along with my server?

Sounds like you weren't paying for backups.

tl;dr - customer stops paying service provider, and service provider stops providing services. Customer is upset.

This one's on you.

bloblaw··on Flan Scan: Lightweight Network Vulnerability Scanner
Remember: This is a 50 line Python script that is a wrapper for nmap + vulners NSE script.

It's not a product, but some simple automation around existing tooling. Better than paying $$$ for a full fledged scanner? Maybe, but depends on your use case.

bloblaw··on uBlock Origin: Address first-party tracker blocking
Reminds me of the "Best viewed with Internet Explorer" tags. When is Chrome going to reinvent Active-X (which only works in Chrome)???
bloblaw··on Nim: Scripting Ease in a Compiled Language
Well, you sorta can. As long as you wrote it:

* to work in both Python 2 and 3 (no telling what other system's Python will be) * don't use any modules outside of stdlib (that requires install too)

Those aren't always requirements, but they are the reason I reach for compiled languages when I can't control the target environment where the program needs to run (or don't want to).

bloblaw··on Show HN: Policy_sentry, an AWS IAM Least Privilege Policy Generator
Neat project.

How does it differ from `aws-iam-generator` released by AWS themselves?

https://github.com/awslabs/aws-iam-generator

bloblaw··on The sorry state of OpenSSL usability
On my Ubuntu 16.04 system, `man openssl` works just fine for me.
← PreviousPage 3 of 5Next →