Articles in Commands & Shells
Force NTP Time Update on Linux
Imagine this: you created the /etc/ntp.conf file, enabled and started the ntpd service, and… the system time is still off. Is there a way to force time sync with the NTP server? It must be your lucky day. All you have to do is to connect to your box as root and run the following command…
Find Command with Multiple Exec Statements
This is a very simple one, but somehow I always forget the correct syntax. I want to use the “find” command to locate files and then use several “exec” statements to perform various operations on whatever “find” finds. In the following example I am making sure that all /etc/*.conf files are owned by root and that they don’t have permissions greater than 644.
Modifying Solaris Services
Recently I ran into an issue: the sshd service on a Solaris 10 box needed to be used with a custom configuration file. By default, the sshd service will use /etc/ssh/sshd_config. I needed it to use /etc/ssh/sshd_config_custom. I could not just modify the default configuration file. Don’t ask why – it’s complicated. So here’s what I ended up doing and this process is applicable to modifying any other Solaris 10 (and above) service.
Substitute Commands Depending on User ID
Here is a quick example of how to substitute system commands based on who tries to run them. A customer of mine has recently deployed a security audit application on his servers. The application has a few bugs that the vendor has not yet resolved. For example, the security audit agent looks at the output of the “mount” command to see if any filesystems are mounted without the “nosuid” option.
NFS “Not Owner” Error
The “not owner” error is displayed on the client system (usually Solaris) when attempting to mount an NFS share from a server. This error may appear even though the share is correctly exported and the client system has full access. If you are getting a “permission denied” error, then this article is not for you and you should check here instead.
Forcing Linux to Reboot
Until I branched out a few years ago from supporting Unix server to working with Linux clusters, I never really encountered this issue: you type “reboot”, “init 0”, or “shutdown” as root and… nothing happens. Or the system starts going down but then hangs on unmounting a filesystem or unloading a module. I think this happened once to a colleague of mine who was rebooting a Solaris server, but this is a common problem with Linux.
WordPress File Upload Size Limit
By default, WordPress will not allow you to upload a file larger than 2Mb. This limit is not set by WordPress itself, but by detaul PHP configuration. This configuration file is usually /etc/php.ini, but normally …
Reboot Remote Windows Workstation
When using RDP, sometimes the session may lock up and you may need to reboot your workstation remotely. This can be done using the “shutdown.exe” command from your local PC. First, make sure you can …
Slow SSH login in SuSE Linux
Starting with SuSE 10 and including both openSuSE and SLES an annoying SSH problem appeared. When you SSH to the server (via PuTTY and such) you get the “login” prompts right away, but the “password” …
Shell Scripting for HPC Clusters, Part 2
This is the second installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters. You can view the first part of the guide here.
Searching, Replacing, Comparing
Try to work with a large cluster and …
Shell Scripting for HPC Clusters, Part 1
This is the first installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters.
“For” and “While” Loop Constructs
The main challenge of supporting a Linux cluster is ensuring a homogeneous environment. Aside from small …
Web Hosting Providers and php.ini
The php.ini is the primary configuration file for the PHP – a popular scripting language used for Web development. Most Web hosting providers offer preinstalled PHP on their servers. If your search on PHP has …
Automatically Validate HTTP Proxies
Let’s say you downloaded a long list of Web proxy servers. Now you are stuck with the task of weeding out the proxies that are dead, slow, fake, or otherwise unusable. There are some applications …
Shell Random Number Generator
Sometimes, in the course of writing shell script, a need arises for some random input. Using the built-in $RANDOM shell variable will give you a random number from 0 to 32767 . Let’s take a …
Wget and User-Agent Header
As you may already know, Wget is a popular (particularly in the Unix world) command-line downloader and Web crawler application. You can read more about Wget in one of my earlier posts on the subject. …
Numeric File Permissions in Unix
Suppose you are working with a Web server and your task is to make sure that no files or directories have permissions “777”. It would be easy to just recursively change permissions for all files …
Controlling Process CPU Utilization
Let’s say there is a process on your Unix/Linux system that sometimes tends to consume all CPU resources and become unresponsive. At the same time, you do not want to terminate the process at the …
Encoding Videos for XBox 360 and PS3
Both Xbox 360 and PS3 support a variety of video codecs and are capable of playing high-definition video files. One of the most popular formats for HD video files is Matroska (MKV), which provides excellent …
Random Filename Chooser
This is a rather peculiar little script with a purpose that may not be immediately apparent. The script will look for files in the specified folder; it will then pick one at random from the …
Scali Manage (Platform Manager) CLI Guide
Scali Manage – the bloated and unpredictable HPC cluster management tool – has recently been acquired by Platform Computing Corp. It is to be integrated into Platform LSF and Platform OCS products. I can’t say …
Dealing With Disk Hogs
Some users and application developers believe that any free disk space on the server belongs to them. Suddenly you get an email alert saying that a server “xyz” ran out of disk space in /home. …
Useful SysAdmin Scripts: Search-and-Replace
Let’s say you moved your server to a new network and now it has a different IP address. You know your users have a habit of hard-coding the server’s IP into their scripts. So you …

Latest Comments