Archive for the ‘Cygwin’ Category
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 »
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 »
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 »
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 »
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 »
Posted by jpluimers on 2014/01/25
Getting rid of the dreaded “Write failed: Broken pipe”.
Note the difference of ServerAliveInterval/ServerAliveCountMax and ClientAliveInterval/ClientAliveCountMax.
For Mac, Linux and CygWin: Read the rest of this entry »
Posted in *nix, Apple, Cygwin, 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 | Leave a Comment »
Posted by jpluimers on 2014/01/10
I usually used netstat with some grep filter for this, but Brandon Titus showed at StackOverflow that the lsof command is much easier to use:
lsof command should be able to do this just fine. Just use this:
lsof -i :<port_number>
lsof -i udp:<port_number>
lsof -i tcp:<port_number>
and all of the processes should come up.
The lsof commands work on SUSE, Max OS X, CygWin and many other environments.
(update 20160304: added more arguments and links)
Two other commands I use often:
netstat -tulpn | sort
(for connected and listening tcp/udp ports it shows processes and port numbers; see the netstat parameters for more details, note that -u includes udp and -l adds listening sockets)
rpcinfo -p ; rpcinfo -s
(shows the ports used by rpcbind)
Note that one day I’ll learn the iproute2 equivalents (many of which have non descriptive 2 letter names like ip, iw, ss, tc, maybe because iproute2), but as OS X still doesn’t have iproute2, I’m hesitating. Anyway, that day:
–jeroen
via
Posted in *nix, Apple, Cygwin, 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, OS X 10.8 Mountain Lion, Power User, SuSE Linux | 1 Comment »
Posted by jpluimers on 2013/12/16
Thanks DevShed:
ls -l –time-style=full-iso
Emits full ISO 8601 time stamps and it works on:
- SuSE Linux
- Mac OS X
- Cygwin
–jeroen
via: list date with seconds from ls command – Dev Shed.
Posted in *nix, Cygwin, Linux, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2013/12/06
Like forgetting about the tar syntax, I usually forget which is the left parameter in an ln command (the file or link? it is the file!)
Thanks [WayBack] cyberciti.biz:
There are two types of links
- symbolic links: Refer to a symbolic path indicating the abstract location of another file
- hard links : Refer to the specific location of physical data.
To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:
ln -s {target-filename} {symbolic-filename}
–jeroen
via: How to: Linux / UNIX create soft link with ln command.
Posted in *nix, Cygwin, Endian, Linux, Power User, SuSE Linux | 2 Comments »
Posted by jpluimers on 2013/06/28
When the webmail doesn’t do what I want, I fall back on mutt on the Linux command line prompt.
It is an immensely strong and stable text based mail client, but – beyond the basics – has a steep learning curve.
In fact it is so stable, that the CVS repository rarely gets commits
So below a few notes that I used to clean up truckloads of mail.
- Read Real Programmers: Jump Start: Mutt — by hackers, for hackers. It is a very short introduction with the most powerful.
- Read My first mutt : Searching mail (the best article on My first mutt), and My first mutt : mutt overview. They why limit is far more useful than search, and the basic UI concept of mutt.
- The mutt documentation has a text based man page.
- But there is both a html manual and text manual
(the devel doc branch has both html manual and text manual too).
- A lot of actions in mutt depends on patterns which are based on regular expressions.
For me the most powerful combination of steps is this:
- Limit the message view to a search pattern of messages you are looking for
- Tag the (groups of) messages you want to operate on
- Use the semicolon tag-prefix command to operate only on the tagged messages [Wayback/Archive] Mutt: apply command to all tagged messages – Super User
Once you have tagged the desired messages, you can use the tag-prefix operator, which is the ; (semicolon) key by default. When the tag-prefix operator is used, the next operation will be applied to all tagged messages if that operation can be used in that manner.
A few more details are below. Read the rest of this entry »
Posted in *nix, Cygwin, Linux, Power User | 1 Comment »