Loading...
More Shell Posts
#!/bin/bash#Takes command line arguments and pulls the header files.#Good for checking if the function you want is in the header or not.#cppToStdout.sh "time.h"while [ "$1" != "" ]; doecho "#include<$1>" | g++ -x c++ -E -shiftdone
for region in `aws ec2 describe-regions --output text | cut -f4`doecho -e "\nListing Instances in region:'$region'..."aws ec2 describe-instances --query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' --region $regiondone#This script is to be used with any AWS CLI configured environment, it will list any EC2 instances and their associated subnet network ID's in JSON format
#!/bin/bash#getDependencies.sh by Leif Messingergrep -Po '#include\s*"\K.+(?=")' | while read -r line ; doecho -n " $line"./getDependencies.sh < $linedone
#!/usr/bin/env bash#Splits a command across a number of CELL machinesuser=$(whoami)if [[ -z $user ]]; thenecho "whoami failed. Exiting..."exit 1ficommand="$1"if [[ -z $command ]]; thenecho "Need to put in a command."exit 1fishiftarray=("$@")let start=8let stop=18for ((i = $start; i <= $stop; i++)); doextraZero=$(if [[ "$i" -lt 10 ]]; then echo "0"; fi)domain="CELL${extraZero}${i}-CSE.ENG.UNT.EDU"let "index = i - start"echo ${#array[@]}if [[ ${#array[@]} != 0 ]] && [[ $index -ge ${#array[@]} ]]; thenecho "$index > ${#array[@]}"breakfissh -o StrictHostKeyChecking=accept-new "${user}@${domain}" -t "$command ${array[$index]}" &done
touch /tmp/login1.txt /tmp/login2.txtwhile [ true ]dowho | gawk '{ print $1 }' > /tmp/login2.txtcomm -13 /tmp/login1.txt /tmp/login2.txt#Just a bit easier to read#diff /tmp/login1.txt /tmp/login2.txtcat /tmp/login2.txt > /tmp/login1.txtsleep 1done
# Update all npm packages under the scope defined by the PREFIX variable ("foo").PREFIX="foo"; npm ls | grep "$PREFIX" | awk -F/ '{print $NF}' | sed 's/@.*//' | xargs -I package npm update @"$PREFIX"/package