Download a sequence of files with curl
In the past to download a sequence of files (e.g named blue00.png to blue09.png) I’ve used a for loop for wget but there’s a simpler and more powerful way to do the same thing with curl.
Unix is a multi-user, multi-tasking operating system that was initially developed by Bell Labs in the 1970s. Various similar operating systems that are POSIX compliant (ie compatible with Unix) have since been developed (POSIX is an abbreviation for Portable Operating System Interface for UNIX). These include the following: the BSD family (OpenBSD, FreeBSD, NetBSD, Mac OS/X), Solaris, IRIX, AIX, SunOS, UnixWare, OpenServer and Linux.
Software written for POSIX compliant operating systems is generally able to be compiled for all POSIX platforms with little or no platform-specific changes. This makes the commands and utilities available for this extended family of operating systems very similar, and there are few differences between administering them.
The articles in this section are about useful command line utilities and commonly used application software on POSIX compliant operating systems. For Mac OSX specific articles see my OSX section.
In the past to download a sequence of files (e.g named blue00.png to blue09.png) I’ve used a for loop for wget but there’s a simpler and more powerful way to do the same thing with curl.
Putty is an SSH/telnet/etc client which allows you to connect to remote servers such as a Linux or BSD webserver. When you change directories etc in a terminal shell the window title in Putty is likely to change, depending on the shell’s settings. This post looks at how to change the Putty window title to be what you want and how to prevent it changing as you change directories.
Man pages on Linux and other *NIX operating systems document how commands work. I’ve often noticed in a default install on Red Hat based distros that odd UTF characters display such as  and â and these can obscure the meaning of the information in the manpage. This post looks at how to make these weird UTF8 characters display normally in Linux manpages.
If you’ve ever accidentally hit Ctrl+S in the Bash shell it appears to come inactive and no matter what you do no output is echoed and nothing appears to be happening. This post looks at how to make the shell active again.
A few days ago I posted about enabling the PageUp and PageDown keys for history search auto completion in the BASH shell, looking at what needs to be done to configure it for CentOS 5. Now that I’ve just set up Kubuntu in a VMWare Virtual Machine as my primary Linux desktop, I needed to have the same thing working. I spend a fair amount of time doing stuff from the command line, and being able to search through the history in this way is very important to me.
Fortunately in Kubuntu (which will also mean Ubunutu and all the other variants such as Xubuntu, Edubuntu and Linux Mint) this is easier than for CentOS 5, because it already contains the definitions in the /etc/inputrc
file, just commented out.
The file looks like this by default:
... # mappings for "page up" and "page down" to step to the beginning/end # of the history "e[5~": beginning-of-history "e[6~": end-of-history # alternate mappings for "page up" and "page down" to search the history # "e[5~": history-search-backward # "e[6~": history-search-forward ...
So it’s just a matter of commenting out the original definitions for “e[5~” and “e[6~” and uncommenting the ones for history-search-backward and history-search-forward like so:
... # mappings for "page up" and "page down" to step to the beginning/end # of the history # "e[5~": beginning-of-history # "e[6~": end-of-history # alternate mappings for "page up" and "page down" to search the history "e[5~": history-search-backward "e[6~": history-search-forward ...
And that’s all there is to it. You need to log out and log in again for the changes to take effect. As in my earlier post, I’m unsure if there is a way to change this on a user by user basis, or if the new setting can be reloaded without having to log out and back in again. If there is I’d be interested to know.
The above makes the change global in scope and affects all users on the system. It’s possible to make the change only for your login by creating/editing a file called .inputrc in your home directory containing just the following:
"e[5~": history-search-backward "e[6~": history-search-forward
I needed to add some monitoring of one of my customer’s mail servers and compiled sysmon on a CentOS Linux machine to do the monitoring. When compiling sysmon I got the error message "undefined reference to `yywrap’". This post looks at the full error message and the solution.