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

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

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

    Join 1,714 other followers

Archive for the ‘*nix’ Category

Some links I’ll need for monit one day

Posted by jpluimers on 2017/02/17

Getting monit to run on opensuse isn’t a feat.

I might try again one day with these links:

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

Date format converter from Text or Unix/Mac/Filetime/Microsoft to virtually any readable form

Posted by jpluimers on 2017/02/09

Brilliant Date format converter from dates in Text (almost any format) or timestamp numbers in Unix, Mac, Filetime or Microsoft (which is the same as Delphi TDateTime) format to any of these formats:

Text Date:
Date in human-readable text
Wednesday, March 23, 2016 4:05:39pm
RFC 822:
RFC 822 formatted date
Wed, 23 Mar 2016 16:05:39 +0000
ISO 8601:
ISO 8601 formatted date
2016-03-23T16:05:39+00:00
UNIX Timestamp:
seconds since Jan 1 1970
1458749139
Mac Timestamp:
seconds since Jan 1 1904
3541593939
Microsoft Timestamp:
days since Dec 31 1899
42452.670590278
FILETIME:
100-nanoseconds since Jan 1 1601
131032227390000000
01D1851D:D7B58B80

Source: Date format converter

–jeroen

Posted in *nix, .NET, Apple, Delphi, Development, Mac, OS X, Power User, Software Development | 1 Comment »

Determining the current shell in *n*x variants including ESXi

Posted by jpluimers on 2017/02/08

On most systems, I use bash as shell, but not all systems have it, for instance the shell.xs4all.nl server uses tcsh and ESXi 4+ uses a very limited ash shell from busybox (ESX 4 had bash though).

There is this huge script that covers many shell and operating system versions (even DOS, Windows) and interpreters (python, ruby, php, etc) what shell is this which I got through Stéphane Chazelas‘s answer in linux – determine shell in script during runtime – Unix & Linux Stack Exchange

I wanted a shorter thing that works in current Linux, BSD, OS X and ESXi versions.

Some very short scripts are less reliable, for instance echo $SHELL looks nice, but isn’t always set.

Similar for echo $0 which will fail for instance if it shows as sh but in fact is a different shell in disguise.

This works for bash, tcsh and busybox sh, is a bit more precise than getting $0. It’s based on HOWTO: Detect bash from shell script – Stack Overflow:

lsof -p $$ | awk '(NR==2) {print $1}'

But on ESXi it shows this because lsof doesn’t take any parameter there and just dumps all information:

----------+---------------------+---------------------+--------+------------------

It’s because lsof on ESXi always shows this header where Cartel and World aren’t exactly well documented:

Cartel | World name | Type | fd | Description
----------+---------------------+---------------------+--------+------------------

Empirically for non VM related processes, it looks like the Cartel is the PID and World name the command.

On Linux and BSD based systems, the header looks like this, so command and PID are reversed in ESXi:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

This command then works on both ESXi, OS X, Linux and BSD assuming you can word search for the PID and noting that PID/command will be reversed on ESXi as compared to OSX/Linux/BSD:

lsof -p $$ | grep -w $$ | awk '(NR==2) {print $1,$2}'

–jeroen

Posted in Apple, bash, BSD, Development, iMac, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X El Capitan, 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 | Leave a Comment »

Casting the audio of application on your Linux machine via Chrome to a ChromeCast

Posted by jpluimers on 2017/02/06

Hopefully by now mkchromecast [WayBack] works on more Linux versions (and maybe even Mac OS X is better supported [WayBack]), but back then it was only available for Ubuntu 16.10 and up:

Do you want to stream the audio from Rhythmbox, VLC or another Linux app to your TV through Chromecast? Well, we’ve found a nifty little Linux tool that lets you do just that.

Source: How to Send Your Linux Desktop Audio to a Chromecast – OMG! Ubuntu!

The tool is at github: Linux · muammar/mkchromecast Wiki  [WayBack]: mkchromecast – Cast macOS, or Linux Audio to your Google Cast Devices

–jeroen

via:

Posted in *nix, Chrome, Chromecast, Google, Linux, Power User, Ubunto | Leave a Comment »

How to Build Your Own Penetration Testing Drop Box – Black Hills Information Security

Posted by jpluimers on 2017/02/03

TL;DR

At testing time, the Hardkernel’s ODROID-C2 absolutely destroyed the competition in this space, so buy this:

Hardware Shopping List (links current as of 8/2/2016)

After that continue the article and start with the Initial Setup of the Kali Image

Source: How to Build Your Own Penetration Testing Drop Box – Black Hills Information Security

–jeroen

via: Joe C. Hecht originally shared to Single Board Computers and Virtual Private Servers (Hardware).

Posted in *nix, Kali Linux, Linux, Pen Testing, Power User, Security | Leave a Comment »

 
%d bloggers like this: