This document lists improvements over the default Linux command line tools.
The list was initially motivated by a blog post by Remy Sharp.
- bat - A replacement for cat.
- prettyping - Better ping.
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
| # configures the configuration version (we support older styles for | |
| # backwards compatibility). Please don't change it unless you know what | |
| # you're doing. | |
| BOX_IMAGE = "ubuntu/xenial64" | |
| Vagrant.configure("2") do |config| | |
| # The most common configuration options are documented and commented below. | 
| function summarize-user { | |
| check_time=$(date +%Y-%m-%d -d "7 days ago") | |
| sacct -S $check_time -u $1 --format=User,Account,Jobname,elapsed,ncpus,AllocTRES | |
| } | |
| function modquota { | |
| echo sacctmgr -i modify account $1 set GrpTRES=gres/gpu=$2 GrpTRESMin=gres/gpu=$3; | |
| sacctmgr -i modify account $1 set GrpTRES=gres/gpu=$2 GrpTRESMin=gres/gpu=$3; | |
| } | 
This document lists improvements over the default Linux command line tools.
The list was initially motivated by a blog post by Remy Sharp.
cat.ping.| #!/bin/sh | |
| # | |
| # for-each-subdir | |
| # =============== | |
| # | |
| # ## SYNOPSIS | |
| # | |
| # $ for-each-subdir [FLAGS] | |
| # | |
| # ## DESCRIPTION | 
Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:
ProxyCommand nc -x localhost:1080 %h %p
| alias default_account='sacctmgr --parsable2 show user -s andrewpe | tail -1 | cut -f 2 -d '\''|'\''' | |
| alias fairshare='sshare -a --accounts $(default_account)' | |
| alias jhistory='sacct -u ${USER} --starttime $(date -d "-1 month" +%Y-%m-%d) --format=User,JobID,Jobname,partition,state,exitcode,time,start,end,elapsed,MaxRss,MaxVMSize,nnodes,ncpus,nodelist' | |
| alias jshow='scontrol show job' | |
| alias jinfo='sacct --starttime $(date -d "-1 month" +%Y-%m-%d) --format=User,JobID,Jobname%64,partition,qos,ReqCPUS,ReqMem,state,exitcode,time,start,end,elapsed,MaxRss,MaxVMSize,nnodes,ncpus,nodelist -j' | |
| alias node_types='sinfo -o '\''%c %m %n %R'\'' --sort '\''P'\''' | |
| alias qhogs='sreport cluster UserUtilizationByAccount -t hours' | |
| alias si='sinfo -o "%20P %5D %14F %8z %10c %10m %10d %11l %16f %N"' | |
| alias sq='squeue -o "%8i %.60j %4t %10u %20q %20a %10g %20P %10Q %5D %2C %5m %11l %11L %R"' | |
| alias squ='squeue -u $USER --format="%.18i %.9P %.60j %.8u %.8a %.2t %.10M %.6D %R"' | 
| #!/bin/sh | |
| # | |
| # git-ls-github-repos(1) - list a user's GitHub repositories | |
| # ========================================================== | |
| # | |
| # ## SYNOPSIS | |
| # | |
| # `git-ls-github-repos` <user> | |
| # | |
| # ## REQUIREMENTS | 
| Name: grepcidr | |
| Version: 2.0 | |
| Summary: grepcidr 2.0 - Filter IPv4 and IPv6 addresses matching CIDR patterns | |
| Group: Applications/Productivity | |
| URL: http://www.pc-tools.net/unix/grepcidr/ | |
| Source: http://www.pc-tools.net/files/unix/grepcidr-2.0.tar.gz | |
| Vendor: Jem Berkes <[email protected]> | |
| Packager: Tru Huynh <[email protected]> | |
| License: GPLv3 | |
| Release: 1%{?dist} | 
| ############### | |
| # SINFO aliases | |
| ############### | |
| # Detailed sinfo | |
| alias si="sinfo -o '%8P %10n %.11T %.4c %.8z %.6m %12G %10l %10L %10O %20E' -S '-P'" | |
| # sinfo only on GPU partition | |
| alias sig="si -p gpu" | |
| # sinfo only on CPU partition | |
| alias sic="si -p cpu" | 
| #!/usr/bin/env bash | |
| set -x | |
| if ! which brew; then | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| fi | |
| brew analytics off |