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 4,224 other subscribers

Archive for the ‘Cygwin’ Category

some more lsof, netstat and rpcinfo examples

Posted by jpluimers on 2016/03/07

Last friday I updated the examples at *nix networking – lsof: How to tell what process has a specific port open on Linux (via: Server Fault) as I needed to document some of the machines around here (so it becomes easier replacing them).

I also added some links to background information and (when I get to using it: OS X still goes without) a good iproute2 starter page.

–jeroen

Posted in *nix, *nix-tools, Apple, Communications Development, Cygwin, Development, Internet protocol suite, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.6 Snow Leopard, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, TCP | Leave a Comment »

Windows: programmatically setting date/time stamps of files

Posted by jpluimers on 2014/07/01

For DOS programs, date and time stamps were used to mark versions of files. For instance, Turbo Pascal 6.0, had a 06:00 time stamp on every file.

You can still do this in Windows, but need to watch for a couple of things:

  • daylight saving time
  • more than one time stamp per file

There are various ways to do it. Besides a graphical Attribute Changer at www.petges.lu (thanks User Randolf Richardson), these are console approaches via How can I change the timestamp on a file?:
Read the rest of this entry »

Posted in *nix, Apple, Batch-Files, Cygwin, Development, 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, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User, PowerShell, Scripting, Software Development, SuSE Linux, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | 2 Comments »

*nux: “$@” is how to iterate over arguments in bash script (via: command line – Stack Overflow)

Posted by jpluimers on 2014/03/29

Thanks Robert Gamble, ephemient and Jonathan Leffler. Be sure to read the top two answers and comments for full details.

Until now, I always used $* to pass on arguments from *nux shells (bash, sh, ash, etc.). Works on ESXi as well. But that is not the correct way to do.

But “$@” is the correct way:

  • Use “$@” to represent all the arguments:

for var in "$@"
do
echo "$var"
done

  • As a shortcut, for var; do ...; done means for var in "$@"; do ...; done
  • Basic thesis: “$@” is correct, and $* (unquoted) is almost always wrong. This is because “$@” works fine when arguments contain spaces, and works the same as $* when they don’t. In some circumstances, “$*” is OK too, but “$@” usually (but not always) works in the same places. Unquoted, $@ and $* are equivalent (and almost always wrong).

This next to the following construct makes file processing in *nix a breeze:

for filename in *.7z; do if 7za t $filename 2>&1 > /dev/null; then echo $filename passed; else echo $filename failed; fi; done

–jeroen

via: command line – How to iterate over arguments in bash script – Stack Overflow.

Posted in *nix, bash, Cygwin, Development, ESXi4, ESXi5, ESXi5.1, ESXi5.5, Linux, Power User, Scripting, Software Development, SuSE Linux, VMware ESXi | Leave a Comment »

vi intro — the cheat sheet method (via: IBM developerworks)

Posted by jpluimers on 2014/03/27

IBM isn’t all about dry corporate stuff and sometimes hard to read redbook documentation (:

I love the way they lead you do build your own VI cheat sheet step by step in vi intro — the cheat sheet method.

It is basically a vi tutorial that helps you to build up your own cheat sheet.

–jeroen Read the rest of this entry »

Posted in *nix, Cygwin, Endian, ESXi4, ESXi5, ESXi5.1, ESXi5.5, Linux, Power User, SuSE Linux, vi, VMware, VMware ESXi | Leave a Comment »

How to copy a file with I/O errors? (via: Not a complete failure » Blog Archive)

Posted by jpluimers on 2014/03/24

Blast from the past, and happy I found back the original blog that pointed me to this: Not a complete failure » Blog Archive » How to copy a file with I/O errors?.

A long while ago, I helped out a friend with a HDD that was partially working. He neede the bits of a file that had become unreadable by regular means.

dd to the rescue: it takes a lot longer, but gets the job done eventually. Eventually can be T+eternity.

Note that you always should copy such a file to another drive, like described in the above blog.

Something like this (the parameters are explained at the dd man page):

dd if=/mounting-path/directory-path/damaged.mp4 of=resurrected.mp4 conv=noerror,sync

Usually for creating disk images, dd works on *n*x, Mac OS X, Windows with for instance Cygwin, ESXi, etc.

See also: linux – Rescuing a hdd with bad sectors: dd vs gddrescue – Super User.

–jeroen

via: Not a complete failure » Blog Archive » How to copy a file with I/O errors?.

Posted in *nix, Apple, Cygwin, ESXi4, ESXi5, ESXi5.1, ESXi5.5, 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, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, SuSE Linux, VMware, VMware ESXi | Leave a Comment »

 
%d bloggers like this: