PowerShell How To Watch in PowerShell Every system administrator who runs a big system knows how to make long-running tasks less boring. Watching progress is one of those little fun things.
Ansible Ansible: Ad-Hoc Shell Module I shared a tip on handling missing files in an Ansible playbook some time ago. I have now tried to do the same with ad hoc command execution. Here is how you can use extra module arguments.
Bash A Shell Tricks: Session Color Coding The best way to understand what server you deal with is color-coded command line prompts. Different Shell interpreters and different terminals offer different commands and capabilities, but modern server-side world is extremely Linux centric, where the BASH dominates the market.
Bash A Shell Tricks: Forwarding X session I use MobaXterm as my primary terminal client. Besides some excellent features, it has a selling point - the built-in X server. Yet you may still be in a position where you can't just forward your X windows to your local machine and have to make some extra steps.
Bash A Shell Tricks: Search and Replace It's easy to use VS Code to search and replace text entries. Yet, mass file renaming is a fairly common task, especially when you move Ansible inventories or other artifacts across environments.
Linux A Shell Tricks: Dash-Minus Fuss All *nix systems are similar to ogres and onions - they all have layers. System layer, user layer, core commands with the neanderthal accessory lines. It adds to neverending fun. Command-line warriors should memorize all kid of argument notations and formats for the most common tools.
Bash Promptless SFTP in bash script Want to run SFTP command in a bash script without being prompted? Here are quick examples of 2 approaches; one with password based authentication and one with private key authentication. Password Authentication cd /source_directory_on_local echo "cd /target_directory_on_remote" > /tmp/commands.txt echo
Conda Conda: Environment configuration With a high probability, you own a powerful computing device that could be used as a standalone system for developing, debugging, and testing applications. And it would be a good idea - to use virtual environments to limit cross-project dependencies and keep your OS package list under control.
JSON JQ is a new GREP If you are a cloud system administrator, security analyst, or data scientist, you already use jq (JSON Query), and if you don't, you should.
Bash Bash scripts to diagnose network issues These are 2 simple scripts I wrote that run various types of tests to help diagnose network issues between a source and target. They can be safely run as a non-root user as long as the commands exist. Script 1 - Various network tests This script runs 3 separate tests
Ansible Ansible: Dynamic Inventory I know that Ansible could use as inventory virtually anything, including scripts. However, all inventories on my day job are static, and we keep them in a source repository, and until now, I haven't had a chance to create or use one.
Bash Bash script to test port availability I created a quick script to test if a port is consistently available between a source server to a target server for the purpose of gathering statistics to see if there are any network hiccups not. This is a very simple and straightforward script. Simply copy the content below to
SSH Unappreciated SSH Client Config Some IT folks how are fluent with the server configuration of the SSH daemon. But I can hardly name a few who knows how helpful client SSH configuration is.
Git Automate Housekeeping For one who does automation for living, it's okay to be a bit lazy. So let's talk about how I keep my local git repositories in order with minimal effort.
Linux Getting "Argument list too long" when using ls I was trying to count the number of files in a particular directory in Linux using the ls command and received the following error: oracle@soadev:/home/oracle> ls /u01/archive/*.* | wc -l -bash: /bin/ls: Argument list too long Turns out the resolution to this is to increase
Linux Find directories with largest number of files in Linux I needed to find the list of directories that had the largest number of files on my Linux file system, searching recursively through the filesystem. Here's the content you can paste in a script: #!/bin/bash if [ $# -ne 1 ];then echo "Usage: `basename $0` DIRECTORY" exit
OpenSSL Quick Certificate Validation Check certificate validity for a site; what could be easier? It's a click away if the address of interest is in your browser. Learn how you can check expiration dates for multiple Learn how you can check expiration dates for multiple host or virtual hosts with SNI.
Bash How to show a timestamp in Bash history By default, when you run the history command, it lists the history of all commands previously executed, but it does not include a timestamp. Adding a timestamp to the bash history can easily be accomplished with the HISTTIMEFORMAT Bash variable as shown. export HISTTIMEFORMAT="%F %T " export PS1=