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 the ‘bash’ Category

nojhan/liquidprompt: A full-featured & carefully designed adaptive prompt for Bash & Zsh

Posted by jpluimers on 2017/10/05

Wow: nojhan/liquidprompt: A full-featured & carefully designed adaptive prompt for Bash & Zsh

This is really useful!

via:

Sort of tanslated from the first “via” (note that “mit Alles und Scharf” is hard to translate; it’s somewhere between “everything but the kitchen sink, but done right” and “right on the money”):

Bash Prompt Overkill: https://github.com/nojhan/liquidprompt is a Bash “Prompt doing it all right”-extension, which doesn’t care how much any feature costs as we have cores, gigabytes and SSD.

Liquid Prompt automagically recognises context and enables a plethora of features in the prompt when needed based on that context.

It’s like pixie dust for your prompt.

You can configure everything, but you don’t have to: the out of the box experience is already like pixie dust for your prompt.

It works on OS X too and is part of homebrew:

$ brew install liquidprompt
==> Using the sandbox
==> Downloading https://github.com/nojhan/liquidprompt/archive/v_1.11.tar.gz
==> Downloading from https://codeload.github.com/nojhan/liquidprompt/tar.gz/v_1.11
######################################################################## 100.0%
==> Caveats
Add the following lines to your bash or zsh config (e.g. ~/.bash_profile):
  if [ -f /usr/local/share/liquidprompt ]; then
    . /usr/local/share/liquidprompt
  fi
If you'd like to reconfigure options, you may do so in ~/.liquidpromptrc.
A sample file you may copy and modify has been installed to
  /usr/local/share/liquidpromptrc-dist
Don't modify the PROMPT_COMMAND variable elsewhere in your shell config;
that will break things.
==> Summary
🍺  /usr/local/Cellar/liquidprompt/1.11: 7 files, 125.6K, built in 3 seconds
[jeroenp:~/Versioned] 10s $

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, Apple, bash, bash, Development, OS X, Power User, Scripting, Software Development | Leave a Comment »

youtube-dl – saving both audio and video without keeping intermediate files seems impossible

Posted by jpluimers on 2017/09/14

Just in case someone has a better alternative than youtube-dl alias:

alias youtube-dl-audio-and-video='youtube-dl --keep-video --extract-audio --audio-quality 0 --audio-format mp3'

It extracts the audio and keeps the video.

The result is that also all intermediate downloads are being kept.

So even after studying the README extensively the only alternative seems to be a double download like this:

youtube-dl-audio-and-video() { youtube-dl --extract-audio --audio-quality 0 --audio-format mp3 $1; youtube-dl $1; }

–jeroen

Posted in *nix, *nix-tools, bash, bash, Development, Power User, Scripting, Software Development | Leave a Comment »

Some more bash links

Posted by jpluimers on 2017/06/28

Gosh, bash can be a pain. So here are some more links that proved to be useful in the past:

–jeroen

Posted in bash, Development, Scripting, Software Development | Leave a Comment »

OpenSuSE Tumbleweed – testing the password of any user with getent and openssl

Posted by jpluimers on 2017/06/21

For one of my VMs I forgot to note which of the initial password I had changed, so I wanted to check them.

Since I didn’t have a keyboard attached to the console and ssh wasn’t allowing root, I needed an alternative than actual login to test the passwords.

Luckily /etc/shadow, with getent and openssl came to the rescue.

Since getent varies per distribution, here is how it works on OpenSuSE:

Read the rest of this entry »

Posted in bash, Development, Linux, openSuSE, Scripting, Software Development, SuSE Linux | Leave a Comment »

Mac OS X – need to research this one day: How do I Check DHCP Lease info in terminal – via Ars Technica OpenForum

Posted by jpluimers on 2017/06/20

One day I need to research how to get the conversions right for this: How do I Check DHCP Lease info in terminal – Ars Technica OpenForum as I think that ipconfig getoption en0 lease_time gives me the value in a different format than date -r expects.

Also:

At T1 seconds (typically set to 0.5*lease_time) after the last successful renewal, the DHCP client attempts to renew it’s lease with the DHCP server that granted it’s current address via unicast. If unsuccessful, at T2 seconds (typically set to 0.875*lease_time) after the last renewal, the DHCP client attempts to rebind with any DHCP server via multicast.

–jeroen

Posted in Apple, bash, Development, Mac, OS X, OS X El Capitan, OS X Maverick, OSX Yosemite, Power User, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: