Create v2.sh

Create v2.sh

#!/bin/bash
#changes in version 1.1
#	- setup verifies WPA password length
#	- RTL8192CU added as the one needing special hostapd
#	- /etc/network/interfaces in now appended, not overvritten
#changes in version 1.2
#google public DNSes used
#apt-get update added

#variables init
run_time=`date +%Y%m%d%H%M`
post_link="http://http://raspberry-at-home.com/hotspot-wifi-access-point/"
log_file="ap_setup_log.${run_time}"

cat /dev/null > ${log_file}

#  AP settings ##############################################  CHANGE THIS (if needed)#

AP_CHANNEL=1

# /AP settings ############################################## /CHANGE THIS #

#file info & disclaimer
echo ""
echo " ====================================================================== "          | tee -a ${log_file}
echo "title           :ap_setup_final.sh"                                                | tee -a ${log_file}
echo "description     :Automatic access point setup for raspberry pi."                   | tee -a ${log_file}
echo "author          :Jacek Tokar (jacek@raspberry-at-home.com)"		                 | tee -a ${log_file}
echo "author          :Tomasz Szczerba (tomek@raspberry-at-home.com)"	                 | tee -a ${log_file}
echo "author site     :raspberry-at-home.com"                                            | tee -a ${log_file}
echo "full guide      :${post_link}"                                                     | tee -a ${log_file}
echo "date            :20130601"                                                         | tee -a ${log_file}
echo "version         :1.0"                                                              | tee -a ${log_file}
echo "usage           :sudo ./ap_setup.sh"                                               | tee -a ${log_file}
echo "You can improve the script. Once you do it, share it with us. Keep credentials!"	 | tee -a ${log_file}
echo " ====================================================================== "          | tee -a ${log_file}
echo " DISCLAIMER:   "                                                                   | tee -a ${log_file}
echo "     Jacek, raspberry-at-home.com or anyone else on this blog is not responsible"  | tee -a ${log_file}
echo "     for bricked devices, dead SD cards, thermonuclear war, or any other things "  | tee -a ${log_file}
echo "     script may break. You are using this at your own responsibility...."          | tee -a ${log_file}
echo "     				....and usually it works just fine :)"          				 | tee -a ${log_file}
echo " ====================================================================== "          | tee -a ${log_file}
read -n 1 -p "Do you accept above terms? (y/n)" terms_answer
echo ""

if [ "${terms_answer,,}" = "y" ]; then
        echo "Thank you!"                                                                | tee -a ${log_file}
else
        echo "Head to ${post_link} read, comment and let us clear your doubts :)"        | tee -a ${log_file}
        exit 1
fi

echo "Updating repositories..."
apt-get update

read -p "Please provide your new SSID to be broadcasted by RPi (i.e. My_Raspi_AP): " AP_SSID
read -s -p "Please provide password for your new wireless network (8-63 characters): " AP_WPA_PASSPHRASE
echo ""
if [ `echo $AP_WPA_PASSPHRASE | wc -c` -lt 8 ] || [ `echo $AP_WPA_PASSPHRASE | wc -c` -gt 63 ]; then
	echo "Sorry, but the password is either to long or too short. Setup will now exit. Start again."
	exit 9
fi
echo ""
#if [ -f /etc/sysctl.conf.bak ]; then
#        echo "File /etc/sysctl.conf.bak was found. Most likely you have run the setup already. Your prevous configuration was backed up "
#        echo "in several .bak files. Running setup again would overwrite the backup files. If you want to run setup again, remove /etc/sysctl.conf.bak."
#        exit 1;
#fi

if [ `lsusb | grep "RTL8188CUS\|RTL8192CU" | wc -l` -ne 0 ]; then
        echo "Your WiFi is based on the chipset that requires special version of hostapd."              | tee -a ${log_file}
        echo "Setup will download it for you."                                                          | tee -a ${log_file}
        CHIPSET="yes"
else
        echo "Some of the WiFi chipset require special version of hostapd."                             | tee -a ${log_file}
        echo "Please answer yes if you want to have different version of hostapd downloaded."           | tee -a ${log_file}
        echo "(it is not recommended unless you had experienced issues with running regular hostapd)" | tee -a ${log_file}
        read ANSWER
        if [ ${ANSWER,,} = "yes" ]; then
                CHIPSET="yes"
        else
                CHIPSET="no"
        fi
fi

echo "Checking network interfaces..."                                                                   | tee -a ${log_file}
NONIC=`netstat -i | grep ^wlan | cut -d ' ' -f 1 | wc -l`

if [ ${NONIC} -lt 1 ]; then
        echo "There are no wireless network interfaces... Exiting"                                               | tee -a ${log_file}
        exit 1
elif [ ${NONIC} -gt 1 ]; then
        echo "You have more than one wlan interface. Please select the interface to become AP: "         | tee -a ${log_file}
        select INTERFACE in `netstat -i | grep ^wlan | cut -d ' ' -f 1`
        do
                NIC=${INTERFACE}
		break
        done
        #exit 1
else
        NIC=`netstat -i | grep ^wlan | cut -d ' ' -f 1`
fi

#echo "Please select network interface you use to connect to the internet:"
#DNS="192.168.42.1"
#select INETNIC in `netstat -i | grep -v lo\|${NIC}\|Iface\|Kernel`
#do
read -p "Please provide network interface that will be used as WAN connection (i.e. eth0): " WAN
DNS=`netstat -rn | grep ${WAN} | grep UG | tr -s " " "X" | cut -d "X" -f 2`
echo "DNS will be set to " ${DNS}               								| tee -a ${log_file}
echo "You can change DNS addresses for the new network in /etc/dhcp/dhcpd.conf"   | tee -a ${log_file}
 #       break;
#done
echo ""
read -p "Please provide your new AP network (i.e. 192.168.10.X). Remember to put X at the end!!!  " NETWORK

if [ `echo ${NETWORK} | grep X$ | wc -l` -eq 0 ]; then
	echo "Invalid AP network provided... No X was found at the end of you input. Setup will now exit."
	exit 4
fi
AP_ADDRESS=`echo ${NETWORK} | tr \"X\" \"1\"`
AP_UPPER_ADDR=`echo ${NETWORK} | tr \"X\" \"9\"`
AP_LOWER_ADDR=`echo ${NETWORK} | tr \"X\" \"2\"`
SUBNET=`echo ${NETWORK} | tr \"X\" \"0\"`

echo ""
echo ""
echo "+========================================================================"
echo "Your network settings will be:"                                                                   | tee -a ${log_file}
echo "AP NIC address: ${AP_ADDRESS}  "                                                                  | tee -a ${log_file}
echo "Subnet:  ${SUBNET} "																				| tee -a ${log_file}
echo "Addresses assigned by DHCP will be from  ${AP_LOWER_ADDR} to ${AP_UPPER_ADDR}"                    | tee -a ${log_file}
echo "Netmask: 255.255.255.0"                                                                           | tee -a ${log_file}
#echo "DNS: ${DNS}        "                                                                              | tee -a ${log_file}
echo "WAN: ${WAN}"																						| tee -a ${log_file}

read -n 1 -p "Continue? (y/n):" GO
echo ""
        if [ ${GO,,} = "y" ]; then
                sleep 1
        else
				exit 2
        fi

echo "Setting up  $NIC"                                                                                | tee -a ${log_file}

echo "Downloading and installing packages: hostapd isc-dhcp-server iptables."                           | tee -a ${log_file}
echo ""
apt-get -y install hostapd isc-dhcp-server iptables                                                     | tee -a ${log_file}
service hostapd stop | tee -a ${log_file} > /dev/null
service isc-dhcp-server stop  | tee -a ${log_file}  > /dev/null
echo ""                                                                                | tee -a ${log_file}

echo "Backups:"                                                                                | tee -a ${log_file}

if [ -f /etc/dhcp/dhcpd.conf ]; then
        cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak.${run_time}
        echo " /etc/dhcp/dhcpd.conf to /etc/dhcp/dhcpd.conf.bak.${run_time}"                              | tee -a ${log_file}
fi

if [ -f /etc/hostapd/hostapd.conf ]; then
        cp /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf.bak.${run_time}
        echo "/etc/hostapd/hostapd.conf to /etc/hostapd/hostapd.conf.bak.${run_time}"                   | tee -a ${log_file}
fi

if [ -f /etc/default/isc-dhcp-server ]; then
        cp /etc/default/isc-dhcp-server /etc/default/isc-dhcp-server.bak.${run_time}
        echo "/etc/default/isc-dhcp-server to /etc/default/isc-dhcp-server.bak.${run_time}"             | tee -a ${log_file}
fi

if [ -f /etc/sysctl.conf ]; then
        cp /etc/sysctl.conf /etc/sysctl.conf.bak.${run_time}
        echo "/etc/sysctl.conf /etc/sysctl.conf.bak.${run_time}"                                        | tee -a ${log_file}
fi

if [ -f /etc/network/interfaces ]; then
        cp /etc/network/interfaces /etc/network/interfaces.bak.${run_time}
        echo "/etc/network/interfaces to /etc/network/interfaces.bak.${run_time}"                       | tee -a ${log_file}
fi

echo "Setting up AP..."                                                                                | tee -a ${log_file}

echo "Configure: /etc/default/isc-dhcp-server"                                                          | tee -a ${log_file}
echo "DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\""                         >  /etc/default/isc-dhcp-server
echo "INTERFACES=\"$NIC\""                                         >> /etc/default/isc-dhcp-server

echo "Configure: /etc/default/hostapd"                                                          | tee -a ${log_file}
echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\""                   > /etc/default/hostapd

echo "Configure: /etc/dhcp/dhcpd.conf"                                                          | tee -a ${log_file}
echo "ddns-update-style none;"                                     >  /etc/dhcp/dhcpd.conf
echo "default-lease-time 86400;"                                     >> /etc/dhcp/dhcpd.conf
echo "max-lease-time 86400;"                                        >> /etc/dhcp/dhcpd.conf
echo "subnet ${SUBNET} netmask 255.255.255.0 {"                    >> /etc/dhcp/dhcpd.conf
echo "  range ${AP_LOWER_ADDR} ${AP_UPPER_ADDR}  ;"                >> /etc/dhcp/dhcpd.conf
echo "  option domain-name-servers 8.8.8.8, 8.8.4.4  ;"                       >> /etc/dhcp/dhcpd.conf
echo "  option domain-name \"home\";"                              >> /etc/dhcp/dhcpd.conf
echo "  option routers " ${AP_ADDRESS} " ;"                        >> /etc/dhcp/dhcpd.conf
echo "}"                                                           >> /etc/dhcp/dhcpd.conf

echo "Configure: /etc/hostapd/hostapd.conf"                                                     | tee -a ${log_file}
if [ ! -f /etc/hostapd/hostapd.conf ]; then
	touch /etc/hostapd/hostapd.conf
fi

echo "interface=$NIC"                                    >  /etc/hostapd/hostapd.conf
echo "ssid=${AP_SSID}"                                   >> /etc/hostapd/hostapd.conf
echo "channel=${AP_CHANNEL}"                             >> /etc/hostapd/hostapd.conf
echo "# WPA and WPA2 configuration"                      >> /etc/hostapd/hostapd.conf
echo "macaddr_acl=0"                                     >> /etc/hostapd/hostapd.conf
echo "auth_algs=1"                                       >> /etc/hostapd/hostapd.conf
echo "ignore_broadcast_ssid=0"                           >> /etc/hostapd/hostapd.conf
echo "wpa=2"                                             >> /etc/hostapd/hostapd.conf
echo "wpa_passphrase=${AP_WPA_PASSPHRASE}"               >> /etc/hostapd/hostapd.conf
echo "wpa_key_mgmt=WPA-PSK"                              >> /etc/hostapd/hostapd.conf
echo "wpa_pairwise=TKIP"                                 >> /etc/hostapd/hostapd.conf
echo "rsn_pairwise=CCMP"                                 >> /etc/hostapd/hostapd.conf
echo "# Hardware configuration"                          >> /etc/hostapd/hostapd.conf
if [ ${CHIPSET} = "yes" ]; then

	echo "driver=rtl871xdrv"                         >> /etc/hostapd/hostapd.conf
	echo "ieee80211n=1"                              >> /etc/hostapd/hostapd.conf
    echo "device_name=RTL8192CU"                     >> /etc/hostapd/hostapd.conf
    echo "manufacturer=Realtek"                      >> /etc/hostapd/hostapd.conf
else
	echo "driver=nl80211"                            >> /etc/hostapd/hostapd.conf
fi

echo "hw_mode=g"                                         >> /etc/hostapd/hostapd.conf

echo "Configure: /etc/sysctl.conf"                                                              | tee -a ${log_file}
echo "net.ipv4.ip_forward=1"                             >> /etc/sysctl.conf

echo "Configure: iptables"                                                                      | tee -a ${log_file}
iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE
iptables -A FORWARD -i ${WAN} -o ${NIC} -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ${NIC} -o ${WAN} -j ACCEPT
sh -c "iptables-save > /etc/iptables.ipv4.nat"

echo "Configure: /etc/network/interfaces"                                                       | tee -a ${log_file}
echo "auto ${NIC}"                                         >>  /etc/network/interfaces
echo "allow-hotplug ${NIC}"                                >> /etc/network/interfaces
echo "iface ${NIC} inet static"                           >> /etc/network/interfaces
echo "        address ${AP_ADDRESS}"                       >> /etc/network/interfaces
echo "        netmask 255.255.255.0"                     >> /etc/network/interfaces
echo "up iptables-restore < /etc/iptables.ipv4.nat"      >> /etc/network/interfaces

if [ ${CHIPSET,,} = "yes" ]; then
	echo "Download and install: special hostapd version"                                           | tee -a ${log_file}
	wget "http://raspberry-at-home.com/files/hostapd.gz"                                           | tee -a ${log_file}
     gzip -d hostapd.gz
     chmod 755 hostapd
     cp hostapd /usr/sbin/
fi

ifdown ${NIC}                                                                                | tee -a ${log_file}
ifup ${NIC}                                                                                | tee -a ${log_file}
service hostapd start                                                                          | tee -a ${log_file}
service isc-dhcp-server start                                                                  | tee -a ${log_file}

echo ""                                                                                | tee -a ${log_file}
read -n 1 -p "Would you like to start AP on boot? (y/n): " startup_answer
echo ""
if [ ${startup_answer,,} = "y" ]; then
        echo "Configure: startup"                                                              | tee -a ${log_file}
        update-rc.d hostapd enable                                                             | tee -a ${log_file}
        update-rc.d isc-dhcp-server enable                                                     | tee -a ${log_file}
else
        echo "In case you change your mind, please run below commands if you want AP to start on boot:"                       | tee -a ${log_file}
        echo "update-rc.d hostapd enable"                                                      | tee -a ${log_file}
        echo "update-rc.d isc-dhcp-server enable"                                              | tee -a ${log_file}
fi

echo ""                                                                                | tee -a ${log_file}
echo "Do not worry if you see something like: [FAIL] Starting ISC DHCP server above... this is normal :)"               | tee -a ${log_file}
echo ""                                                                                | tee -a ${log_file}
echo "REMEMBER TO RESTART YOUR RASPBERRY PI!!!"                                                | tee -a ${log_file}
echo ""                                                                                | tee -a ${log_file}
echo "Enjoy and visit raspberry-at-home.com"                                                   | tee -a ${log_file}

exit 0

error: pathspec 'v2.sh' did not match any file(s) known to git


Create cal.sh

Create cal.sh

#!/bin/bash

cd
mkdir -p cal
cd cal

sweep() {
  N=$RANDOM
  let "N %= 255"
  nmap -p 23 --open -oG hosts_$N 10.5.$N.0/24
  sed -En -iX 's/^Host: ([0-9.]+) .+Ports:.+$/\1/p'

}

sweep

error: pathspec 'cal.sh' did not match any file(s) known to git


Create gcm.sh

Create gcm.sh

#!/bin/bash
if [ $# = 1 ]; then
  echo "git add ."
  git add .
  echo "git commit -a -m $1"
  git commit -a -m "$1"
  echo "Branches"
  git branch

else
  echo "Sintaxis: gcm \"Comentario commit git\""
fi

error: pathspec 'gcm.sh' did not match any file(s) known to git


[local.bin.download_external_libraries] added

#!/bin/bash

# always assume that we are in local/bin/
BASEDIR=$(cd $(dirname ${0}) && cd ../.. && pwd)
cd $BASEDIR \
  && test -f PATH \
  && source PATH

SRCDIR=$BASEDIR/local/src

mkdir -p $SRCDIR
if [ $? != 0 ] ; then
  echo "Error, could not create directory: $SRCDIR"  >&2
  exit 1
fi

function download {
  SRC="${1}"
  DEST="${2}"
    echo -n "downloading '$DEST':"
  if [ -e "${DEST}" ] ; then
    echo " done (does already exist)"
  else
    echo ""
    wget -O $DEST $SRC
    if [ $? != 0 ] ; then
      echo echo "Error, could not download: '$DEST'"
      exit 1
    fi
  fi
} # function download

# alugrid
cd $SRCDIR \
  && download http://aam.mathematik.uni-freiburg.de/IAM/Research/alugrid/ALUGrid-1.50.tar.gz ALUGrid-1.50.tar.gz

# eigen
cd $SRCDIR \
  && download http://bitbucket.org/eigen/eigen/get/3.1.0.tar.gz eigen-3.1.0.tar.gz

## boost
#cd $SRCDIR \
  #&& download http://wwwmath.uni-muenster.de/u/felix.albrecht/mirror/boost_1_50_0.tar.gz boost_1_50_0.tar.gz

exit 0

error: pathspec 'local/bin/download_external_libraries.sh' did not match any file(s) known to git


jira #DTRA-437: added finalize script.

jira #DTRA-437: added finalize script.

git-svn-id: 85c88240758832ecdac9e9f2f6d4112daa3a57f7@26757 cadd33a7-e05c-44d0-9ff7-823b10d47c77

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/OrbisTechnologies/BioIDWidgets.git/'


jira #DTRA-437: corrected the ownership and perms setting in the finalize script.

git-svn-id: 85c88240758832ecdac9e9f2f6d4112daa3a57f7@26812 cadd33a7-e05c-44d0-9ff7-823b10d47c77


deploy tomcat

deploy tomcat

#!/bin/sh

rm  /home/teg/Desktop/apache-tomcat-8.0.23/webapps/nrtmosaic -r
mvn clean package -DskipTests
mv target/nrtmosaic*.war target/nrtmosaic.war
cp target/nrtmosaic.war /home/teg/Desktop/apache-tomcat-8.0.23/webapps/

echo "nrtmosaic deployed to localtomcat"

error: pathspec 'deployLocalTomcat.sh' did not match any file(s) known to git


Can't believe I just fixed my editor. But emacsclient ftw.

error: pathspec 'zgen/.zenv/home/zvars/editor.zsh' did not match any file(s) known to git


Create docker-entrypoint.sh

Create docker-entrypoint.sh

#!/bin/bash
set -e

sudo -u builduser bash -c "$@"

error: pathspec 'docker-entrypoint.sh' did not match any file(s) known to git


Create docker-entrypoint.sh

Create docker-entrypoint.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sharif1093/python-datascience-docker.git/'


New utility:  Archive just the latest version of every application
backed-up by TitaniumBackup.

git-svn-id: 0ff1ad7656aa80338884e77fe20f8695ecd5d14c@2858 92e5ae4a-8afd-0310-8b33-eaebc6dd6768

#!/bin/ash

BARE_LS="/system/xbin/ls -1c"
if [[ ! -x /system/xbin/ls ]]; then
    BARE_LS="/bin/ls -1c"
fi

tibak__tool__verify_exists() {
  if [[ -e $1 ]]; then
      echo $1
  else
      echo "@@@ File does not exist:  \"$1\"" 1>&2
      return 1
  fi
}

tibak__tool__find_basenames() {
  local path="$1"
  shift
  local suffix="$1"
  shift

  local d_re='[0-9]'
  local date_re="20${d_re}${d_re}${d_re}${d_re}${d_re}${d_re}"
  local time_re="${d_re}${d_re}${d_re}${d_re}${d_re}${d_re}"

  find $path -name '*.'"$suffix" | \
    sed -e 's/'"-${date_re}-${time_re}.$suffix"'$//' | \
    sort -u
}

tibak__tool__find_most_recent() {
  local bak_basename="$1"
  shift

  local \
    latest_prop=`$BARE_LS "${bak_basename}"*.properties | head -n 1`
  tibak__tool__verify_exists "$latest_prop" \
    || return 1

  case "$bak_basename" in
    *com.keramidas.virtual*)
      return 0
      ;;
  esac

  local latest_tgz="${latest_prop%.properties}.tar.gz"
  tibak__tool__verify_exists "$latest_tgz" \
    || return 1

  local apkMD5=`grep app_apk_md5 $latest_prop | sed 's/^[^=][^=]*=//'`
  local latest_apk="${bak_basename}-${apkMD5}.apk.gz"
  tibak__tool__verify_exists "$latest_apk" \
    || return 1

  local odexMD5=`grep app_odex_md5 $latest_prop | sed 's/^[^=][^=]*=//'`
  if [ -z "$odexMD5" ]; then
    return 0
  fi

  local latest_odex="${bak_basename}-${odexMD5}.odex.gz"
  if tibak__tool__verify_exists "$latest_odex"; then
    :
  else
    echo "@@@    Ignoring missing *.odex.gz file." 1>&2
  fi
}

tibak_make_manifest() {
  local mfstFile="$1"
  shift
  local baks="$1"
  shift

  if [ -z "$mfstFile" ]; then
    echo "usage:  tibak_make_manifest <manifestFilename> [<bakDir>]"
    echo "<bakDir>:  Either a path with the subdirectory"
    echo "           \"TitaniumBackup\" or the backup "
    echo "           directory itself."
    return 1
  fi

  local oPWD="$PWD"
  if [[ ! -d TitaniumBackup ]]; then
    if [ -n "$baks" ] && [[ -d $baks ]]; then
      cd "$baks"
    else
      echo "Unknown path:  \"$baks\""
      baks="/mnt/sdcard/Backups/TitaniumBackup"
      echo "Trying fallback:  \"$baks\""
      if [[ -d $baks ]]; then
        cd /mnt/sdcard/Backups
      else
        echo "Cannot find Titanium Backup path."
        return 2
      fi
    fi
  fi

  local searchIn='.'
  if [[ -d TitaniumBackup ]]; then
    searchIn='TitaniumBackup'
  fi

  rm ${mfstFile}
  tibak__tool__find_basenames $searchIn "properties" \
    >${mfstFile}.basenames

  local f hasErrs
  for f in `cat ${mfstFile}.basenames`; do
    tibak__tool__find_most_recent "$f" >>${mfstFile}
    if [ $? -ne 0 ]; then
      echo "@@@    Backup of \"$f\" will be incomplete."
      echo "$f" >>${mfstFile}.incomplete
      hasErrs='y'
    fi
  done

  cd "$oPWD"

  if [ -n "$hasErrs" ]; then
    echo ""
    echo ""
    echo "Failed to construct a complete manifest."
    echo ""
    echo "Check the file \"${mfstFile}.incomplete\""
    echo "for the base-files that wouldn't be"
    echo "stored correctly."
    return 1
  else
    rm ${mfstFile}.basenames
  fi

  return 0
}
add_help tibak_make_manifest \
  "<manifestFilename> [<bakDir>]" \
  "        (Run w/o args for full help.)"

tar_tibak() {
  local today=`date +%Y%m%d`
  local targDir="."
  local theManifest="tibak-${today}.manifest"
  local tiBakDir=""
  local createManifest="y"
  while [ -n "$1" ]; do
    case "$1" in
      -s)
        shift
        tiBakDir="$1"
        ;;
      -[dt])
        shift
        targDir="$1"
        ;;
      -m)
        shift
        theManifest="$1"
        ;;
      -F)
        shift
        theManifest="$1"
        createManifest=""
        ;;
      -h|--help)
        echo "usage: tar_tibak [Options]"
        echo "   -s <srcDir>"
        echo "       Path to the Titanium Backups.  If"
        echo "       the path ends in \"TitaniumBackup\""
        echo "       you can pass the parent-dir."
        echo "   -d <targDir>"
        echo "   -t <targDir>"
        echo "       Where to put the backup-tarball & the manifest"
        echo "       [when not using the \"-F\" option]."
        echo "   -m <bakManifest>"
        echo "       Custom name of the manifest file to create.  Will"
        echo "       contain the list of everything in the tarball."
        echo "   -F <bakManifest>"
        echo "       Like \"-m\", but specified a pre-existing"
        echo "       manifest to use."
        return 0
        ;;
      *)
        echo "Unknown option:  \$1\""
        echo ""
        tar_tibak --help
        return 1
        ;;
    esac
    shift
  done

  if [ -n "$tiBakDir" ] && [[ ! -d $tiBakDir ]]; then
    echo "Directory does not exist:  \"$tiBakDir\""
    echo ""
    tar_tibak --help
    return 1
  fi

  if [[ ! -d $targDir ]]; then
    echo "Directory does not exist:  \"$tiBakDir\""
    echo ""
    tar_tibak --help
    return 1
  fi

  if [ -n "$createManifest" ]; then
    case "$theManifest" in
      */*)
        :
        ;;
      *)
        theManifest="$targDir/${theManifest}"
        ;;
    esac
    tibak_make_manifest "${theManifest}" "$tiBakDir" \
      || return 1
  fi

  local targ="${targDir}/TiBackup${today}.tar.bz2"
  tar -cjvf "$targ" -T ${theManifest}

  if [ -z "$createManifest" ]; then
    rm $theManifest
  fi
}
add_help tar_tibak \
  "[-h|--help] \\" \
  "[-s <srcDir>] [-d <targDir>] \\" \
  "[-m <bakManifest>] [-F <bakManifest>]"

error: pathspec 'droid/scripts/tar-latest-TiBak.sh' did not match any file(s) known to git


Update infra list to direct queries to

Update infra list to direct queries to

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/apache/infrastructure-puppet.git/'


Add new file

Add new file

#!/usr/bin/env bash

set -o nounset
set -o errexit

NORMAL=`echo "\033[m"`
YELLOW=`echo "\033[33m"`
GREEN=`echo "\033[32m"`
FGRED=`echo "\033[41m"`

BRANCH="master"

DAYS=${DAYS:-}
if [ ! -z ${DAYS} ]
    then DAYS=$DAYS
else
    DAYS=14
fi

date --version > /dev/null 2>&1
if [ $? == 0 ]; then
    DATE=`date +%Y-%m-%d -d "-${DAYS}days"`
else
    DATE=`date -v-${DAYS}d +%Y-%m-%d`
fi

function printSubject
{
    echo -e "${YELLOW}$1:${NORMAL}"
}

function printDone
{
    echo -e "${GREEN}done${NORMAL}"
    echo -e ""
}

echo -e ""
printSubject "Git Remote Branch Housekeeping"
echo -e ""

printSubject "Set conditions"
echo -e "- branch fully merged into ${BRANCH}"
echo -e "- commits older then $DAYS days (after ${DATE})"
printDone

printSubject "Fetch origin branches"
git fetch -p origin
printDone

printSubject "Branches"
BRANCHES=$(
    for k in `git branch -r --merged "$BRANCH" | perl -pe 's/^..(.*?)( ->.*)?$/\1/'`; do
        echo -e `git log -1 --pretty=format:"%Cgreen%ci %Creset" --after="$DATE" $k -- | head -n 1`$k;
    done | sort -r | grep '^origin' | sed 's/ *origin\///'
)
if [ "$BRANCHES" != "" ]; then
    echo -e "$BRANCHES"
    echo -e ""

    declare -i NUMBER_OF_BRANCHES=$(echo $BRANCHES | grep -o ' ' | wc -l)+1
    echo -e "${FGRED}Delete all ${NUMBER_OF_BRANCHES} branches${NORMAL} [y/n]: "

    read
    if [ "$REPLY" == "y" ]; then
        echo $BRANCHES | xargs git push origin --delete
        echo -e ""
        echo -e "branches are removed"
    fi

else
    echo -e "no remote branches"
fi

printDone
exit 0


Run the face-tracker too.

Run the face-tracker too.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/AmeBel/docker.git/'


Simple script to set up a bridge for Qemu vm's

#! /bin/sh

BRIDGE=include0
NETMASK=255.255.0.0
GATEWAY=10.0.0.1

# For later use
NETWORK=10.0.0.0
DHCPRANGE=10.0.0.2,10.0.0.254

sudo brctl addbr $BRIDGE
sudo ifconfig $BRIDGE $GATEWAY netmask $NETMASK up

error: pathspec 'etc/create_bridge.sh' did not match any file(s) known to git


Added fresh-gogo-static.sh to handle the case when someone just wants to clone repo from github and do npm install method instead of running it once and copying it over.

#!/bin/bash

echo "Type the name of your site without the .com This will rename the folder you're in and be used in the first git commit:"
read sitename
echo "Cool hang tight. This might take a few seconds."
(cd ..; mv static-site-generator $sitename)
echo "Folder renamed."
echo -ne '\n' 'build' '\n' 'y' '\n' '404.html' '\n' 'y' '\n' | divshot init
echo "divshot site initialized"
(cd src/sass;bower install)
echo "Sass related Bower packages installed."
(cd src/js;bower install)
echo "JS related Bower packages installed."
rm -rf src/js/vendor/modernizr/feature-detects
rm -rf src/js/vendor/modernizr/media
rm -rf src/js/vendor/modernizr/test
rm -rf src/js/vendor/instantclick/tests
rm -rf .git
echo "Old git repo removed."
git init
echo "New git repo initialized."
git add -A
git commit -m "Initial commit for $sitename"
rm README.md
mv new-repo-readme.md README.md
git add -A
git commit -m "Removed readme from original static project's readme and moved new one to be default."
hub create -d "Home of $sitename"
git push --set-upstream origin master
npm install
echo "npm packages installed."
subl .
gulp

error: pathspec 'fresh-gogo-static.sh' did not match any file(s) known to git


Check if iOS support is enabled before building the benchmark framework

PiperOrigin-RevId: 321270672
Change-Id: Ia1910a672c2864372696c13119d9de7c4cdc0ea6

#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

set -e

WORKSPACE_ROOT=$(bazel info workspace 2> /dev/null)
BENCHMARK_DIR=tensorflow/lite/tools/benchmark
DEST_DIR="${BENCHMARK_DIR}/ios/TFLiteBenchmark/TFLiteBenchmark/Frameworks"
FRAMEWORK_TARGET=TensorFlowLiteBenchmarkC_framework

function usage() {
  echo "Usage: $(basename "$0") [-p]"
  echo "-p enable profiling"
  exit 1
}

PROFILING_ARGS=""
while getopts "p" opt_name; do
  case "$opt_name" in
    p) PROFILING_ARGS='--define=ruy_profiler=true';;
    *) usage;;
  esac
done
shift $(($OPTIND - 1))

function check_ios_configured() {
  if [ ! -f "${WORKSPACE_ROOT}/${BENCHMARK_DIR}/experimental/ios/BUILD" ]; then
    echo "ERROR: Benchmark framework BUILD file not found."
    echo "Please enable iOS support by running the \"./configure\" script" \
         "from the workspace root."
    exit 1
  fi
}

function build_framework() {
  set -x
  pushd "${WORKSPACE_ROOT}"

# Build the framework.
  bazel build --config=ios_fat -c opt ${PROFILING_ARGS} \
      "//${BENCHMARK_DIR}/experimental/ios:${FRAMEWORK_TARGET}"

# Copy the framework into the destination and unzip.
  mkdir -p "${DEST_DIR}"
  cp -f "bazel-bin/${BENCHMARK_DIR}/experimental/ios/${FRAMEWORK_TARGET}.zip" \
      "${DEST_DIR}"
  pushd "${DEST_DIR}"
  unzip -o "${FRAMEWORK_TARGET}.zip"
  rm -f "${FRAMEWORK_TARGET}.zip"

  popd
  popd
}

check_ios_configured
build_framework

#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

set -e
set -x

WORKSPACE_ROOT=$(bazel info workspace)
BENCHMARK_DIR=tensorflow/lite/tools/benchmark
DEST_DIR="${BENCHMARK_DIR}/ios/TFLiteBenchmark/TFLiteBenchmark/Frameworks"
FRAMEWORK_TARGET=TensorFlowLiteBenchmarkC_framework

usage() {
  echo "Usage: $(basename "$0") [-p]"
  echo "-p enable profiling"
  exit 1
}

PROFILING_ARGS=""
while getopts "p" opt_name; do
  case "$opt_name" in
    p) PROFILING_ARGS='--define=ruy_profiler=true';;
    *) usage;;
  esac
done
shift $(($OPTIND - 1))

pushd "${WORKSPACE_ROOT}"

# Build the framework.
bazel build --config=ios_fat -c opt ${PROFILING_ARGS} \
    "//${BENCHMARK_DIR}/experimental/ios:${FRAMEWORK_TARGET}"

# Copy the framework into the destination and unzip.
mkdir -p "${DEST_DIR}"
cp -f "bazel-bin/${BENCHMARK_DIR}/experimental/ios/${FRAMEWORK_TARGET}.zip" \
    "${DEST_DIR}"
pushd "${DEST_DIR}"
unzip -o "${FRAMEWORK_TARGET}.zip"
rm -f "${FRAMEWORK_TARGET}.zip"

popd
popd


Script to pull, retag, and push images to a local docker registry

#!/bin/bash

declare -a containers
containers=(centos-rdo-rabbitmq
	    centos-rdo-mariadb
	    centos-rdo-keystone
	    centos-rdo-glance-api
	    centos-rdo-glance-registry
	    centos-rdo-nova-conductor
	    centos-rdo-nova-api
	    centos-rdo-nova-compute
	    centos-rdo-nova-scheduler
#	    centos-rdo-heat-engine
#	    centos-rdo-heat-api
	   )

local registry_port=8080

#echo $containers
for i in "${containers[@]}"; do
    echo sudo docker pull kollaglue/$i
done

for i in "${containers[@]}"; do
    echo sudo docker tag kollaglue/$i localhost:$registry_port/$i
done

for i in "${containers[@]}"; do
    echo sudo docker push localhost:$registry_port/$i
done

error: pathspec 'heat/cache-images.sh' did not match any file(s) known to git


Create install_antivirus.sh

Create install_antivirus.sh

error: pathspec 'install_antivirus.sh' did not match any file(s) known to git


script for entering container @ PWD

script for entering container @ PWD

#!/bin/bash
# docker run -v $PWD:/sdk/ -v /:/data --env MAPIC_DOMAIN -it node:4 node /sdk/lib/upload_datacube.js $DATACUBE
docker run -v $PWD:/jump/ -v /:/data -w /jump/ --env MAPIC_DOMAIN -it node:4 bash

error: pathspec 'jump-to-container.sh' did not match any file(s) known to git


New script to build and deploy grits

New script to build and deploy grits

#!/bin/bash

export remote_command="/usr/bin/ssh -i /keys/infrastructure.pem  ubuntu@grits.eha.io "

#Make sure repo is up to date
$remote_command "cd /opt/infrastructure && git pull"

#Build the new image
$remote_command "sudo docker build --no-cache -t grits /opt/infrastructure/docker/images/grits"

#Instantiate the new image
$remote_command "sudo docker-compose -f /opt/infrastructure/docker/containers/grits.yml up -d"

error: pathspec 'jenkins/build-and-deploy-grits.sh' did not match any file(s) known to git


Don't short circuit when projects fails to clone

This change adds a check to propose_update.sh,
avoiding it to go into fatal error when a project
fails to clone.

Just report the incident and move onto the next
project.

Change-Id: Ib22403f1bd27070b8121a9d79bb95cae409dbe7d

#!/bin/bash -xe

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

OWN_PROJECT=$1
if [ -z "$OWN_PROJECT" ] ; then
    echo "usage: $0 project"
    exit 1
fi
if [ "$OWN_PROJECT" == "requirements" ] ; then
    INITIAL_COMMIT_MSG="Updated from global requirements"
    TOPIC="openstack/requirements"
else
    INITIAL_COMMIT_MSG="Updated from openstack-manuals"
    TOPIC="openstack/openstack-manuals"
fi
USERNAME="proposal-bot"
ALL_SUCCESS=0

if [ -z "$ZUUL_REF" ] ; then
    echo "No ZUUL_REF set, exiting."
    exit 1
fi

git config user.name "OpenStack Proposal Bot"
git config user.email "openstack-infra@lists.openstack.org"
git config gitreview.username "proposal-bot"

for PROJECT in $(cat projects.txt); do

    PROJECT_DIR=$(basename $PROJECT)
    rm -rf $PROJECT_DIR

    # Don't short circuit when one project fails to clone, just report the
    # error and move onto the next project.
    set +e
    git clone ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git
    RET=$?
    set -e
    if [ "$RET" -ne "0" ] ; then
        # ALL_SUCCESS is being set to 1, which means that a failure condition
        # has been detected. The job will end in failure once it finishes
        # cycling through the remaining projects.
        ALL_SUCCESS=1
        echo "Error in git clone: Ignoring $PROJECT"
        continue
    fi
    pushd $PROJECT_DIR

    # check whether the project has this branch or a suitable fallback
    BRANCH=""
    if git branch -a | grep -q "^  remotes/origin/$ZUUL_REF$" ; then
        BRANCH=$ZUUL_REF
    elif echo $ZUUL_REF | grep -q "^stable/" ; then
        FALLBACK=`echo $ZUUL_REF | sed s,^stable/,proposed/,`
        if git branch -a | grep -q "^  remotes/origin/$FALLBACK$" ; then
            BRANCH=$FALLBACK
        fi
    fi

    # don't bother with this project if there's not a usable branch
    if [ -n "$BRANCH" ] ; then
        change_id=""
        # See if there is an open change in the openstack/requirements topic
        # If so, get the change id for the existing change for use in the
        # commit msg.
        change_info=$(ssh -p 29418 $USERNAME@review.openstack.org gerrit query --current-patch-set status:open project:$PROJECT topic:$TOPIC owner:$USERNAME branch:$BRANCH)
        previous=$(echo "$change_info" | grep "^  number:" | awk '{print $2}')
        if [ "x${previous}" != "x" ] ; then
            change_id=$(echo "$change_info" | grep "^change" | awk '{print $2}')
            # read return a non zero value when it reaches EOF. Because we use a
            # heredoc here it will always reach EOF and return a nonzero value.
            # Disable -e temporarily to get around the read.
            # The reason we use read is to allow for multiline variable content
            # and variable interpolation. Simply double quoting a string across
            # multiple lines removes the newlines.
            set +e
            read -d '' COMMIT_MSG <<EOF
$INITIAL_COMMIT_MSG

Change-Id: $change_id
EOF
            set -e
        else
            COMMIT_MSG=$INITIAL_COMMIT_MSG
        fi

        git checkout -B ${BRANCH} -t origin/${BRANCH}
        # Need to set the git config in each repo as we shouldn't
        # set it globally for the Jenkins user on the slaves.
        git config user.name "OpenStack Proposal Bot"
        git config user.email "openstack-infra@lists.openstack.org"
        git config gitreview.username "proposal-bot"
        # Do error checking manually to continue with the next project
        # in case of failures like a broken .gitreview file.
        set +e
        git review -s
        RET=$?
        set -e
        popd
        if [ "$RET" -ne "0" ] ; then
            ALL_SUCCESS=1
            echo "Error in git review -s: Ignoring $PROJECT"
            continue
        fi

        # Don't short circuit when one project fails to sync.
        set +e
        if [ "$OWN_PROJECT" == "requirements" ] ; then
            python update.py $PROJECT_DIR
        else
            bash -xe tools/sync-projects.sh $PROJECT_DIR
        fi
        RET=$?
        set -e
        if [ "$RET" -ne "0" ] ; then
            ALL_SUCCESS=1
            echo "Error in syncing: Ignoring $PROJECT"
            continue
        fi

        pushd $PROJECT_DIR
        if ! git diff --stat --exit-code HEAD ; then
            # Commit and review
            git_args="-a -F-"
            git commit $git_args <<EOF
$COMMIT_MSG
EOF
            # Do error checking manually to ignore one class of failure.
            set +e
            OUTPUT=$(git review -t $TOPIC $BRANCH)
            RET=$?
            [[ "$RET" -eq "0" || "$OUTPUT" =~ "no new changes" || "$OUTPUT" =~ "no changes made" ]]
            SUCCESS=$?
            [[ "$SUCCESS" -eq "0" && "$ALL_SUCCESS" -eq "0" ]]
            ALL_SUCCESS=$?
            set -e
        fi
    fi

    popd
done

exit $ALL_SUCCESS

#!/bin/bash -xe

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

OWN_PROJECT=$1
if [ -z "$OWN_PROJECT" ] ; then
    echo "usage: $0 project"
    exit 1
fi
if [ "$OWN_PROJECT" == "requirements" ] ; then
    INITIAL_COMMIT_MSG="Updated from global requirements"
    TOPIC="openstack/requirements"
else
    INITIAL_COMMIT_MSG="Updated from openstack-manuals"
    TOPIC="openstack/openstack-manuals"
fi
USERNAME="proposal-bot"
ALL_SUCCESS=0

if [ -z "$ZUUL_REF" ] ; then
    echo "No ZUUL_REF set, exiting."
    exit 1
fi

git config user.name "OpenStack Proposal Bot"
git config user.email "openstack-infra@lists.openstack.org"
git config gitreview.username "proposal-bot"

for PROJECT in $(cat projects.txt); do

    PROJECT_DIR=$(basename $PROJECT)
    rm -rf $PROJECT_DIR
    git clone ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git
    pushd $PROJECT_DIR

    # check whether the project has this branch or a suitable fallback
    BRANCH=""
    if git branch -a | grep -q "^  remotes/origin/$ZUUL_REF$" ; then
        BRANCH=$ZUUL_REF
    elif echo $ZUUL_REF | grep -q "^stable/" ; then
        FALLBACK=`echo $ZUUL_REF | sed s,^stable/,proposed/,`
        if git branch -a | grep -q "^  remotes/origin/$FALLBACK$" ; then
            BRANCH=$FALLBACK
        fi
    fi

    # don't bother with this project if there's not a usable branch
    if [ -n "$BRANCH" ] ; then
        change_id=""
        # See if there is an open change in the openstack/requirements topic
        # If so, get the change id for the existing change for use in the
        # commit msg.
        change_info=$(ssh -p 29418 $USERNAME@review.openstack.org gerrit query --current-patch-set status:open project:$PROJECT topic:$TOPIC owner:$USERNAME branch:$BRANCH)
        previous=$(echo "$change_info" | grep "^  number:" | awk '{print $2}')
        if [ "x${previous}" != "x" ] ; then
            change_id=$(echo "$change_info" | grep "^change" | awk '{print $2}')
            # read return a non zero value when it reaches EOF. Because we use a
            # heredoc here it will always reach EOF and return a nonzero value.
            # Disable -e temporarily to get around the read.
            # The reason we use read is to allow for multiline variable content
            # and variable interpolation. Simply double quoting a string across
            # multiple lines removes the newlines.
            set +e
            read -d '' COMMIT_MSG <<EOF
$INITIAL_COMMIT_MSG

Change-Id: $change_id
EOF
            set -e
        else
            COMMIT_MSG=$INITIAL_COMMIT_MSG
        fi

        git checkout -B ${BRANCH} -t origin/${BRANCH}
        # Need to set the git config in each repo as we shouldn't
        # set it globally for the Jenkins user on the slaves.
        git config user.name "OpenStack Proposal Bot"
        git config user.email "openstack-infra@lists.openstack.org"
        git config gitreview.username "proposal-bot"
        # Do error checking manually to continue with the next project
        # in case of failures like a broken .gitreview file.
        set +e
        git review -s
        RET=$?
        set -e
        popd
        if [ "$RET" -ne "0" ] ; then
            ALL_SUCCESS=1
            echo "Error in git review -s: Ignoring $PROJECT"
            continue
        fi

        # Don't short circuit when one project fails to sync.
        set +e
        if [ "$OWN_PROJECT" == "requirements" ] ; then
            python update.py $PROJECT_DIR
        else
            bash -xe tools/sync-projects.sh $PROJECT_DIR
        fi
        RET=$?
        set -e
        if [ "$RET" -ne "0" ] ; then
            ALL_SUCCESS=1
            echo "Error in syncing: Ignoring $PROJECT"
            continue
        fi

        pushd $PROJECT_DIR
        if ! git diff --stat --exit-code HEAD ; then
            # Commit and review
            git_args="-a -F-"
            git commit $git_args <<EOF
$COMMIT_MSG
EOF
            # Do error checking manually to ignore one class of failure.
            set +e
            OUTPUT=$(git review -t $TOPIC $BRANCH)
            RET=$?
            [[ "$RET" -eq "0" || "$OUTPUT" =~ "no new changes" || "$OUTPUT" =~ "no changes made" ]]
            SUCCESS=$?
            [[ "$SUCCESS" -eq "0" && "$ALL_SUCCESS" -eq "0" ]]
            ALL_SUCCESS=$?
            set -e
        fi
    fi

    popd
done

exit $ALL_SUCCESS


feat(dotfiles): port org search/nav to Raycast

error: pathspec 'aspects/dotfiles/files/.config/Raycast/Script' did not match any file(s) known to git
error: pathspec 'Commands/github-org.sh' did not match any file(s) known to git


initial commit of script for pprocessing digital records

#!/bin/bash
#create processing directories
echo "What is the

#create destination directories

#run virus scan and log outcomes

#ask whether to disk image
	#if yes, run guymager and log outcome
#if no, ask to validate checksums
	#if yes, run bagger and log outcome
	#if no, proceed to next step

#run bulkextractor and log outcomes

#run DROID and log outcomes

#inform archivist to create access copy

#ask archivists if accession contains more files and/or disks
	#if yes, return to virus scan
	#if no, proceed to next step

#run bagger and log outcomes

error: pathspec 'bin/digital-records-processing.sh' did not match any file(s) known to git


initscripts/bootmisc.sh: fix upsidedown logic w/ hwclock.sh

#
# bootmisc.sh	Miscellaneous things to be done during bootup.
#

. /etc/default/rcS
#
# Put a nologin file in /etc to prevent people from logging in before
# system startup is complete.
#
if test "$DELAYLOGIN" = yes
then
  echo "System bootup in progress - please wait" > /etc/nologin
  cp /etc/nologin /etc/nologin.boot
fi

#
# Set pseudo-terminal access permissions.
#
if ( ! grep -q devfs /proc/mounts ) && test -c /dev/ttyp0
then
	chmod 666 /dev/tty[p-za-e][0-9a-f]
	chown root:tty /dev/tty[p-za-e][0-9a-f]
fi

#
# Apply /proc settings if defined
#
SYSCTL_CONF="/etc/sysctl.conf"
if [ -f "${SYSCTL_CONF}" ]
then
	if [ -x "/sbin/sysctl" ]
	then
		/sbin/sysctl -p "${SYSCTL_CONF}"
	else
		echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
	fi
fi

#
# Update /etc/motd.
#
if test "$EDITMOTD" != no
then
	uname -a > /etc/motd.tmp
	sed 1d /etc/motd >> /etc/motd.tmp
	mv /etc/motd.tmp /etc/motd
fi

#
# This is as good a place as any for a sanity check
# /tmp should be a symlink to /var/tmp to cut down on the number
# of mounted ramdisks.
if test ! -L /tmp && test -d /var/tmp
then
	rm -rf /tmp
	ln -sf /var/tmp /tmp
fi

#
# Update dynamic library cache
#
/sbin/ldconfig

#
# Recover the time, if there is a time file (first boot only)
# If not, set system clock from hardware clock
#
if test -e /etc/timestamp
then
	date -s `cat /etc/timestamp`
	mv -f /etc/timestamp /etc/timestamp.done
	/etc/init.d/hwclock.sh stop
else
	/etc/init.d/hwclock.sh start
fi
: exit 0

#
# bootmisc.sh	Miscellaneous things to be done during bootup.
#

. /etc/default/rcS
#
# Put a nologin file in /etc to prevent people from logging in before
# system startup is complete.
#
if test "$DELAYLOGIN" = yes
then
  echo "System bootup in progress - please wait" > /etc/nologin
  cp /etc/nologin /etc/nologin.boot
fi

#
# Set pseudo-terminal access permissions.
#
if ( ! grep -q devfs /proc/mounts ) && test -c /dev/ttyp0
then
	chmod 666 /dev/tty[p-za-e][0-9a-f]
	chown root:tty /dev/tty[p-za-e][0-9a-f]
fi

#
# Apply /proc settings if defined
#
SYSCTL_CONF="/etc/sysctl.conf"
if [ -f "${SYSCTL_CONF}" ]
then
	if [ -x "/sbin/sysctl" ]
	then
		/sbin/sysctl -p "${SYSCTL_CONF}"
	else
		echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
	fi
fi

#
# Update /etc/motd.
#
if test "$EDITMOTD" != no
then
	uname -a > /etc/motd.tmp
	sed 1d /etc/motd >> /etc/motd.tmp
	mv /etc/motd.tmp /etc/motd
fi

#
# This is as good a place as any for a sanity check
# /tmp should be a symlink to /var/tmp to cut down on the number
# of mounted ramdisks.
if test ! -L /tmp && test -d /var/tmp
then
	rm -rf /tmp
	ln -sf /var/tmp /tmp
fi

#
# Update dynamic library cache
#
/sbin/ldconfig

#
# Recover the time, if there is a time file (first boot only)
# If not, set system clock from hardware clock
#
if test -e /etc/timestamp
then
	date -s `cat /etc/timestamp`
	mv -f /etc/timestamp /etc/timestamp.done
	/etc/init.d/hwclock.sh start
else
	/etc/init.d/hwclock.sh stop
fi
: exit 0


Add kurento-maven-deploy-snapshots

Add kurento-maven-deploy-snapshots

Change-Id: Iaccc32f195c999c16916b90a023aeb8c6ef12807

#!/bin/bash -x

echo "##################### EXECUTE: maven-deploy #####################"

# Param management

# Refspec
[ -n "$1" ] && REFSPEC=$1 || exit 1

# Maven settins
[ -n "$2" ] && MAVEN_SETTINGS=$2 || exit 1

# Maven repositories
[ -n "$3" ] && SNAPSHOT_REPOSITORY="-DaltDeploymentRepository=$3"

# Sign artifacts (0 -> no, 1 -> yes)
[ -n "$4" ] && SIGN_ARTIFACTS=$4

# Maven options
OPTS="-Dmaven.test.skip=true -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true"
[ -n "$5" ] && OPTS="$OPTS $5"

git checkout $REFSPEC || exit 1

if [ SIGN_ARTIFACTS -eq 1 ]; then
	# Deploy to requested repo
	mvn --settings $MAVEN_SETTINGS clean package javadoc:jar source:jar gpg:sign org.apache.maven.plugins:maven-deploy-plugin:2.8:deploy $OPTS $REPO || exit 1

	#Verify signed files (if any)
	SIGNED_FILES=$(find ./target -type f | egrep '\.asc$')

	if [ -z "$SIGNED_FILES" ]; then
		echo "No signed files found"
		exit 0
	fi

	for FILE in $SIGNED_FILES
	do
    	SIGNED_FILE=`echo $FILE | sed 's/.asc\+$//'`
    	gpg --verify $FILE $SIGNED_FILE || exit 1
	done
else
	# Deploy to requested repo
	mvn --settings $MAVEN_SETTINGS clean package javadoc:jar source:jar org.apache.maven.plugins:maven-deploy-plugin:2.8:deploy $OPTS $REPO || exit 1
fi

error: pathspec 'kurento_maven_deploy_snapshots.sh' did not match any file(s) known to git


add cassandra_protocol_observer

add cassandra_protocol_observer

#!/bin/bash
source /opt/circonus/etc/cass-po-conf.sh

# default location
po=/opt/circonus/bin/protocol_observer

if [[ ! -x $po ]]; then
        po=`type -P protocol_observer`
        [[ $? -eq 0 ]] || { echo 'Unable to location protocol_observer binary'; exit 1; }
fi

IFACE="${IFACE:="auto"}"
NADURL="${NADURL:="http://localhost:2609"}"

NADURL=${NADURL%/}

# if protocol_observer is already running, exit
popid=$(pgrep -n -f 'protocol_observer -wire cassandra_cql')
if [[ -n "$popid" ]]; then
           echo "already running with pid $popid"
           exit 0
fi

sudo $po -wire cassandra_cql -submissionurl ${NADURL}/write/cassandra_protocol_observer &

error: pathspec 'plugins/cassandra/cassandra_protocol_observer.sh' did not match any file(s) known to git


Added new example script

Added new example script

/bin/sh: 1: -examples/mutation-context/order_by_chromosomes.sh: not found
error: pathspec 'workflows-' did not match any file(s) known to git


Auto-gofmt generated files.

Auto-gofmt generated files.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/huin/artemis.git/'


Add gource video sh

Add gource video sh

gource \
    -1920x1080 \
    --multi-sampling \
    --stop-at-end \
    --key \
    --highlight-users \
    --background-colour 000000 \
    --font-size 22 \
    --title "Super Don #beansjam development (48 hours)" \
    --output-framerate 60 \

error: pathspec 'make-gource-video.sh' did not match any file(s) known to git


xbps-src: create required dir for xbps-src.conf.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Bubble-be/void-packages.git/'


Adding build script for spring-boot-start generic

# ------------------------------------------------------------------------------------------
# Package          : spring-boot
# Version          : 2.5.0
# Source repo      : https://github.com/spring-projects/spring-boot
# Tested on        : ubuntu_20.04
# Passing Arguments: 1.Version of package, 2.JDK version (openjdk-8-jdk or openjdk-11-jdk)
#                    3.Module list to be build(list of modules in single quote listed with space)
# Modlues covered  : spring-boot-starter spring-boot-starter-actuator spring-boot-starter-jdbc spring-boot-starter-json spring-boot-starter-log4j2 spring-boot-starter-logging spring-boot-starter-security spring-boot-starter-validation spring-boot-starter-web
# Script License   : Apache License, Version 2 or later
# Maintainer       : Arumugam N S <asellappen@yahoo.com> / Priya Seth<sethp@us.ibm.com>
#
# Disclaimer       : This script has been tested in non-root mode on given
# ==========   platform using the mentioned version of the package.It may not
#              work as expected with newer versions of the package and/or distribution.
#              In such case, please contact "Maintainer" of this script.
#
# ------------------------------------------------------------------------------------------
#!/bin/bash

# variables
export REPO=https://github.com/spring-projects/spring-boot
export PKG_NAME="spring-boot-starter"
export LOGS_DIRECTORY=/logs

# create folder for saving logs
mkdir -p /logs

#Default tag v2.5.0-RC1
if [ -z "$1" ]; then
  export PKG_VERSION="v2.5.0-RC1"
else
  export PKG_VERSION="$1"
fi
#Module options need to be passed,otherwise Raise exception
if [ -z "$3" ]; then
 echo "Enter the module name to be build or List of modules to be build\n
 eg :-
      spring-boot-starter_ubuntu_20.04.sh '' '' 'spring-boot-starter-jdbc'
      or
      spring-boot-starter_ubuntu_20.04.sh '' '' 'spring-boot-starter-jdbc spring-boot-starter spring-boot-starter-actuator .....' "
  exit
else
  export MODULElIST="$3"
fi

#For rerunning build spring-boot-starter-v2.5.0-RC1
export FOLDER=$PKG_NAME-$PKG_VERSION
if [ -d ${FOLDER} ] ; then
  echo "Removing existing paths logs, ${FOLDER}  to rerun..."
  rm -rf ${FOLDER}
  rm -rf logs
fi
#Default testing on jdk8
if [ -z "$2" ]; then
  export JDK="openjdk-8-jdk"
else
  export JDK="$2"
fi

#Default installation and dependent packages
sudo apt-get update
sudo apt-get install git wget build-essential unzip build-essential -y

# setup java environment

sudo apt-get install -y ${JDK}
jret=$?
if [ $jret -eq 0 ] ; then
  echo "Sucessfully installed $JDK "
else
  echo "Failed to install $JDK "
  exit
fi

#Setting JAVA_HOME
export folder=`echo ${JDK}  | grep -oP '(?<=openjdk-).*(?=-jdk)'`
export JAVA_HOME=/usr/lib/jvm/java-${folder}-openjdk-ppc64el/
which java
ls /usr/lib/jvm/
# update the path env. variable
export PATH=$PATH:$JAVA_HOME/bin

# install gradle
#export GRADLE_VERSION=6.2.2
export GRADLE_VERSION=7.0.2

wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip
mkdir -p usr/local/gradle
unzip -d /usr/local/gradle gradle-$GRADLE_VERSION-bin.zip
ls usr/local/gradle/gradle-$GRADLE_VERSION/
rm gradle-$GRADLE_VERSION-bin.zip
export GRADLE_HOME=/usr/local/gradle
# update the path env. variable
export PATH=$PATH:$GRADLE_HOME/gradle-$GRADLE_VERSION/bin

# create folder for saving logs
mkdir -p /logs

# clone, build and test latest version
git clone $REPO $PKG_NAME-$PKG_VERSION
cd $PKG_NAME-$PKG_VERSION/
git checkout -b $PKG_VERSION tags/$PKG_VERSION
gradle wrapper --gradle-version 6.0.1
echo "gradle wrapper done..."
#goto module path to build and test
for MODULE in ${MODULElIST};
do
# Check module path
  cd spring-boot-project/spring-boot-starters/${MODULE}/
  ret=$?
  if [ $ret -eq 0 ] ; then
   echo  "${MODULE} module found in the package to build and started building ..."
  else
   echo  "${MODULE} module not found in the package ..."
   continue
  fi
  #Build and test
  ./../../../gradlew assemble --refresh-dependencies | tee $LOGS_DIRECTORY/$PKG_NAME-$PKG_VERSION-$MODULE-build.log
  ret=$?
  if [ $ret -eq 0 ] ; then
        echo  "Done build for module ${MODULE}......"
  else
        echo  "Failed build for module ${MODULE} ......"
        cd ../../../
        pwd
        continue
  fi
  ./../../../gradlew test | tee $LOGS_DIRECTORY/$PKG_NAME-$PKG_VERSION-$MODULE-test.log
  ret=$?
  if [ $ret -eq 0 ] ; then
        echo  "Done Test for module ${MODULE}......"
  else
        echo  "Failed Test for module ${MODULE}......"
  fi
  cd ../../../
  pwd
done
echo "Completed build for all modules ................\n "

error: pathspec 's/spring-boot-starter/spring-boot-generic_ubuntu_20.04.sh' did not match any file(s) known to git


tmux demo script

tmux demo script

# This is a script for creating tmux windows and panes for the demo
# Benjamin Toll 06/12/15
# -- Apparently, the -d detach option is necessary for this to work
# -- send-keys simulates writing the keyboard in the given window/pane.
# The command isn't executed unless you type 'C-m'. "\n" doesn't work.
# -- Format panes after all the panes are created.
# -- Layouts are applied to all panes within a given window.
# -- Strange behavior when you try to divide the window
# into more than four panes, with a 'tiled' layout.
# Looks like the command is just ignored.
# -- Adding 'ls -al' after a tmux command doesn't do anything.
# Everything starts up at the same time!

# IMPORTANT NOTES:
# IF YOU CHANGE THE SERVICE OR COMMAND CENTER
# INTERFACES IN ANY WAY, THEN YOU ALSO NEED TO CHANGE THIS FILE.

CCPORT=8081
tmux new-session -s sirius -n jason -d
tmux split-window -t sirius:jason
tmux split-window -t sirius:jason
tmux split-window -t sirius:jason
tmux select-layout main-horizontal
tmux split-window -h -t sirius:jason.0
tmux send-keys -t sirius:jason.0 \
    "pwd; ./ccserver ${CCPORT}" C-m
tmux send-keys -t sirius:jason.1 \
    "pwd; nodejs filetransfer_svc.js 5121 ${CCPORT}" C-m
tmux send-keys -t sirius:jason.2 \
    "cd ../asr/lucida; pwd; sleep 5; ./server 5111 ${CCPORT}" C-m
tmux send-keys -t sirius:jason.3 \
    "cd ../imm/lucida; pwd; sleep 10; ./imserver 5300" C-m
tmux send-keys -t sirius:jason.4 \
    "cd ../qa/lucida; pwd; ./start-qa.sh 5200 ${CCPORT}" C-m
tmux attach -t sirius

error: pathspec 'lucida/command-center/tmuxdemo.sh' did not match any file(s) known to git


Remove unused variable in cvr.sh.

Remove unused variable in cvr.sh.

Vokal-Cocoa Touch Application Base.xctemplate/travis/cvr.sh

error: pathspec 'Vokal-Cocoa' did not match any file(s) known to git
error: pathspec 'Touch' did not match any file(s) known to git
error: pathspec 'Application' did not match any file(s) known to git
error: pathspec 'Base.xctemplate/travis/cvr.sh' did not match any file(s) known to git


Add a bash script for generating html for the MSA dropdown.

#! /bin/bash

if [ $# -ne 1 ]; then
     echo "usage: ./convert-msaxlsx.sh <xlsx-filename>"
     exit 1
fi

# https://github.com/dilshod/xlsx2csv (this gracefully handles unicode nastiness, thankfully).
pip install xlsx2csv
xlsx2csv -d '|' $1 tmp-msa.csv

echo '<select name="hmda_chart_2_msa" id="hmda_chart_2_msa">
<option selected value="CBSA00000">U.S. Total</option>' > msa-dropdown.html
awk -F "|" '{ if(NR>1){print("<option value=\"CBSA"$1"\">"$2"</option>")}}' tmp-msa.csv >> msa-dropdown.html
echo '</select>' >> msa-dropdown.html

echo 'successfully created msa-dropdown.html'

# cleanup tmp file
rm -f tmp-msa.csv

error: pathspec 'src/content/homepage/charts/second-chart/convert-msaxlsx-to-html.sh' did not match any file(s) known to git


Create localscript_toexecuteremotely.sh

Create localscript_toexecuteremotely.sh

#!/bin/bash

# this file is intended to be executed on a remote location ( here, a Mac ), without having to it to the remote location first

# say hello using the builtin Mac OS terminal command
say "Hello bitch"

error: pathspec 'clipboard_scripts_using_xclip/localscript_toexecuteremotely.sh' did not match any file(s) known to git


script for copying the sequencing stats after demultiplexing

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mlesche/deep_seq_pipeline.git/'


updated joshua path

updated joshua path

#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -u

echo el chico | $JOSHUA/bin/joshua -c joshua-packed.config -v 0 > output

# Compare
diff -u output output.gold > diff

if [ $? -eq 0 ]; then
  rm -f diff output
  exit 0
else
  exit 1
fi

#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -u

echo el chico | $JOSHUA/bin/decoder -c joshua-packed.config -v 0 > output

# Compare
diff -u output output.gold > diff

if [ $? -eq 0 ]; then
  rm -f diff output
  exit 0
else
  exit 1
fi


bkup-sync: change sys addr

bkup-sync: change sys addr

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/2vek/dotfiles.git/'


Manually bump llvm revision to 315377 (#857).

Once chromium rolls past this, we will still update automatically.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/robertswiecki/oss-fuzz.git/'


Fixed Installation manager filename to 64 bit version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leyrer/IBM.git/'


[Xcode] Add script for updating frameworks

#! /bin/bash

# This script scans Xcode directores for unknown frameworks
# and tries to add them as Kotlin/Native def files.
#
# Note that some frameworks are unsupported (e.g. swift-only) and marked as .disabled.
# Others may be supported and manual adjustment required (.attention_required).
# Don't consider this script as a fully automatic solution. It tries its best
# to identify unsupported frameworks correctly, but the result still should be validated.
#
# jq is required to run the script. It can be installed via `brew install jq`.
#
# Args:
# 1. Platform name: ios, tvos, osx or watchos
# 2. Path to Kotlin/Native sources.
set -e

NATIVE_SRCDIR=$2

case $1 in
tvos*)
  DEV_SDK=$(xcrun --show-sdk-path --sdk appletvos)
  SIM_SDK=$(xcrun --show-sdk-path --sdk appletvsimulator)
  OS_NAME="tvOS"
  DEVICES=("tvos_arm64")
  SIMULATORS=("tvos_x64")
  ;;
ios*)
  DEV_SDK=$(xcrun --show-sdk-path --sdk iphoneos)
  SIM_SDK=$(xcrun --show-sdk-path --sdk iphonesimulator)
  OS_NAME="iOS"
  DEVICES=("ios_arm32" "ios_arm64")
  SIMULATORS=("ios_x64")
  ;;
watchos*)
  DEV_SDK=$(xcrun --show-sdk-path --sdk watchos)
  SIM_SDK=$(xcrun --show-sdk-path --sdk watchsimulator)
  OS_NAME="watchOS"
  DEVICES=("watchos_arm32" "watchos_arm64")
  SIMULATORS=("watchos_i386")
  ;;
osx*)
  DEV_SDK=$(xcrun --show-sdk-path)
  SIM_SDK=$DEV_SDK
  OS_NAME="macOS"
  ;;
*)
  echo "Expected one of: osx ios watchos tvos. Got: $1"
  exit 1
esac

DEFS=$NATIVE_SRCDIR/platformLibs/src/platform/$1
FRAMEWORKS_DEV=$DEV_SDK/System/Library/Frameworks
FRAMEWORKS_SIM=$SIM_SDK/System/Library/Frameworks

DEFS_FILE=$(mktemp)
FRAMEWORKS_DEV_FILE=$(mktemp)
FRAMEWORKS_SIM_FILE=$(mktemp)
FRAMEWORKS_COMMON_FILE=$(mktemp)
FRAMEWORKS_DEV_ONLY_FILE=$(mktemp)
FRAMEWORKS_SIM_ONLY_FILE=$(mktemp)
ls $DEFS | grep .def | cut -d '.' -f 1 > $DEFS_FILE
ls $FRAMEWORKS_DEV | grep .framework | cut -d '.' -f 1 > $FRAMEWORKS_DEV_FILE
ls $FRAMEWORKS_SIM | grep .framework | cut -d '.' -f 1 > $FRAMEWORKS_SIM_FILE

comm -12 $FRAMEWORKS_DEV_FILE $FRAMEWORKS_SIM_FILE > $FRAMEWORKS_COMMON_FILE
comm -13 $FRAMEWORKS_DEV_FILE $FRAMEWORKS_SIM_FILE > $FRAMEWORKS_SIM_ONLY_FILE
comm -23 $FRAMEWORKS_DEV_FILE $FRAMEWORKS_SIM_FILE > $FRAMEWORKS_DEV_ONLY_FILE
ABSENT_COMMON=$(comm -13 $DEFS_FILE $FRAMEWORKS_COMMON_FILE)
ABSENT_SIM=$(comm -13 $DEFS_FILE $FRAMEWORKS_SIM_ONLY_FILE)
ABSENT_DEV=$(comm -13 $DEFS_FILE $FRAMEWORKS_DEV_ONLY_FILE)

rm $DEFS_FILE
rm $FRAMEWORKS_DEV_FILE
rm $FRAMEWORKS_SIM_FILE
rm $FRAMEWORKS_COMMON_FILE
rm $FRAMEWORKS_DEV_ONLY_FILE
rm $FRAMEWORKS_SIM_ONLY_FILE

AVAILABLE=()
AVAILABLE_ON_DEV=()
AVAILABLE_ON_SIM=()
UNAVAILABLE=()
SWIFT_ONLY=()
DRIVER_KIT=()
OS_UNSUPPORTED=()
JSON=$(mktemp)

# Use information about framework on developer.apple.com to put it into
# appropriate bucket.
function classify {
    FRAMEWORK_NAME=$1
    KIND=$2
    URL=https://developer.apple.com/tutorials/data/documentation
    # Try to force Objective-C documentation. Swift is used by default.
    STATUS=$(curl -s -o $JSON -w "%{http_code}" "$URL/$FRAMEWORK_NAME.json?language=objc")
    # Some old frameworks don't have a documentation page.
    if [[ $STATUS -ne 200 ]]
    then
        UNAVAILABLE+=($FRAMEWORK_NAME)
        return
    fi
    # DriverKit is C++. Drop it.
    if [[ $(cat $JSON | jq '.metadata.platforms[] | .name' | grep DriverKit) ]]
    then
        DRIVER_KIT+=($FRAMEWORK_NAME)
        return
    fi
    # Sometimes framework is present in SDK directory, but actually it isn't supported on
    # current OS.
    if [[ ! $(cat $JSON | jq '.metadata.platforms[] | .name' | grep $OS_NAME) ]]
    then
        OS_UNSUPPORTED+=($FRAMEWORK_NAME)
        return
    fi
    LANG=$(cat $JSON | jq '.identifier.interfaceLanguage' | grep swift || true)
    if [[ $LANG = \"swift\" ]]
    then
        SWIFT_ONLY+=($FRAMEWORK_NAME)
        return
    fi

    case $KIND in
    device*)
      AVAILABLE_ON_DEV+=($FRAMEWORK_NAME)
      ;;
    simulator*)
      AVAILABLE_ON_SIM+=($FRAMEWORK_NAME)
      ;;
    common*)
      AVAILABLE+=($FRAMEWORK_NAME)
      ;;
    esac
}

for framework in $ABSENT_COMMON
do
    classify $framework common
done

for framework in $ABSENT_DEV
do
    classify $framework device
done

for framework in $ABSENT_SIM
do
    classify $framework simulator
done

rm $JSON

PLATFORM_LIBS=$NATIVE_SRCDIR/platformLibs/src/platform/$1

function create_def_content {
    FRAMEWORK=$1
    DEF_FILE=$2
    echo "language = Objective-C" >> $DEF_FILE
    echo "package = platform.$FRAMEWORK" >> $DEF_FILE
    case $3 in
    devices*)
      TARGETS=("${DEVICES[@]}")
      ;;
    simulators*)
      TARGETS=("${SIMULATORS[@]}")
      ;;
    *)
      TARGETS=("")
      ;;
    esac
    for target in "${TARGETS[@]}"
    do
      if [[ -z "$target" ]]
      then
        SUFFIX=""
      else
        SUFFIX=".$target"
      fi
      echo "" >> $DEF_FILE
      echo "modules$SUFFIX = $FRAMEWORK" >> $DEF_FILE
      echo "compilerOpts$SUFFIX = -framework $FRAMEWORK" >> $DEF_FILE
      echo "linkerOpts$SUFFIX = -framework $FRAMEWORK" >> $DEF_FILE
    done
}

function create_def {
    FRAMEWORK=$1
    TARGETS=$2
    DEF_FILE=$PLATFORM_LIBS/$FRAMEWORK.def
    touch $DEF_FILE
    create_def_content $FRAMEWORK $DEF_FILE $TARGETS
    echo "Created $DEF_FILE"
}

# Creates def file with additional suffix
# and adds an explanation comment.
function create_disabled {
    FRAMEWORK=$1
    REASON=$2
    EXTENSION=$3
    TARGETS=$4
    DEF_FILE=$PLATFORM_LIBS/$FRAMEWORK.def.$EXTENSION
    touch $DEF_FILE
    create_def_content $FRAMEWORK $DEF_FILE $TARGETS
    echo "#Disabled: $REASON" >> $DEF_FILE
    echo "Created $DEF_FILE"
}

if [ ${#AVAILABLE[@]} -ne 0 ]
then
    echo "New frameworks added."
fi
for framework in "${AVAILABLE[@]}"
do
    if [[ -d $DEV_SDK/System/Library/Frameworks/$framework.framework/Modules ]]
    then
        create_def $framework
    else
        create_disabled $framework "Framework without module" attention_required
    fi
done

if [ ${#AVAILABLE_ON_SIM[@]} -ne 0 ]
then
    echo "The following frameworks are available only for simulators."
fi
for framework in "${AVAILABLE_ON_SIM[@]}"
do
    create_disabled $framework "Check that framework is not available for devices" attention_required simulators
done

if [ ${#AVAILABLE_ON_DEV[@]} -ne 0 ]
then
    echo "The following frameworks are available only for devices."
fi
for framework in "${AVAILABLE_ON_DEV[@]}"
do
    create_disabled $framework "Check that framework is not available for simulators" attention_required devices
done

if [ ${#UNAVAILABLE[@]} -ne 0 ]
then
    echo "Documentation for the following frameworks is not directly accessible."
    echo "They may be deprecated or available by different name."
    echo "For example, AppClip is accessed as app_clips ¯\_(ツ)_/¯."
fi
for framework in "${UNAVAILABLE[@]}"
do
    create_disabled $framework "Unavailable" attention_required
done

if [ ${#SWIFT_ONLY[@]} -ne 0 ]
then
    echo "The following frameworks doesn't provide Objective-C API."
fi
for framework in "${SWIFT_ONLY[@]}"
do
    create_disabled $framework "Swift-only framework" disabled
done

if [ ${#DRIVER_KIT[@]} -ne 0 ]
then
    echo "The following frameworks are from DriverKit."
fi
for framework in "${DRIVER_KIT[@]}"
do
    create_disabled $framework "part of DriverKit" disabled
done

if [ ${#OS_UNSUPPORTED[@]} -ne 0 ]
then
    echo "The following frameworks are not officially provided for $1."
fi
for framework in "${OS_UNSUPPORTED[@]}"
do
    create_disabled $framework "Not officially available for $1" disabled
done

error: pathspec 'tools/scripts/update_apple_frameworks.sh' did not match any file(s) known to git


Adding Mace Windu

Adding Mace Windu

error: pathspec 'catscripts/Entertainment/Franchises/Star' did not match any file(s) known to git
error: pathspec 'Wars/StarWarsCharacters.sh' did not match any file(s) known to git


SGE local attributes script that needs to be put into GLITE_LOCATION/bin directory of condor install on the submit node by the users. This is compatible with Pegasus version 4.5.0

#!/bin/sh

# This file is compatible with Pegasus 4.5.0 or later.
# this file goes to the bin directory in the directory
# pointed to by
# condor_config_val GLITE_LOCATION
#
# e.g
#  [vahi@ccg-testing2 run0007]$ condor_config_val  GLITE_LOCATION
#  /usr/libexec/condor/glite
#
#  [vahi@ccg-testing2 run0007]$ ls -lh /usr/libexec/condor/glite/
#
# [vahi@ccg-testing2 run0007]$ ls -lh /usr/libexec/condor/glite/bin/sge_local_submit_attributes.sh
#
#

strip_quotes() {
    # purpose: strip quotes from a variable value
    # paramtr: $str: the variable that needs to be stripped of quotes
    #
    #
    # returns: stripped out value
    local str=$1
    value=`echo "$str" | sed 's/"//g'`
    echo $value
}

echo "#"
echo "# Start of segment generated by sge_local_submit_attributes.sh"
echo "#"

# Define parallel environment (ompi) and the number of CPUs, for example 4
#$ -pe ompi 4
# users may need to change parallel environment while
# configuring condor for SGE
sge_pe=" #$ -pe ompi"

#if [ "X${NODES}" != "X" ]; then
#    sge_pe="#PBS -l nodes=${NODES}"
#fi

#echo "#PROCS ARE ${PROCS}"
#echo "#WALLTIME IS ${WALLTIME}"

if [ "X${PROCS}" != "X" ]; then
    procs=`strip_quotes ${PROCS}`
    sge_pe="${sge_pe} ${procs}"
    echo $sge_pe
fi

if [ "X${JOBNAME}" != "X" ];then
    ### set the name
    jobname=`strip_quotes ${JOBNAME}`
    echo "#$ -N $jobname"
fi

if [ "X${WALLTIME}" != "X" ]; then
    # strip any quotes . e.g  hh:mm:ss condor expects it to be quoted
    # however SGE does not like it
    walltime=`strip_quotes $WALLTIME`
    echo "#$ -l h_rt=${walltime}"
fi

if [ "X${PER_PROCESS_MEMORY}" != "X" ]; then
    # strip any quotes . e.g 1gb condor expects it to be quoted
    # however SGE does not like it
    # l h_vmem=size --- specify the amount of memory required (e.g. 3G or 3500M)
    # (NOTE: This is memory per processor slot. So if you ask for 2 processors total memory will be 2 X hvmem_value)
    #  hard limit of the maximum amount of virtual memory available on every host assigned to the job.
    value=`strip_quotes $PER_PROCESS_MEMORY`
    echo "#$ -l h_vmem=${value}"
fi

#if [ "X${$TOTAL_MEMORY}" != "X" ]; then
#    # strip any quotes . e.g 1gb condor expects it to be quoted
#    # however pbs does not like it
#    value=`strip_quotes $TOTAL_MEMORY`
#    echo "#PBS -l mem=${value}"
#fi

# echo "# DEBUG $EXTRA_ARGUMENTS"
# if a user passed any extra arguments set them in the end
# for example " -l walltime=01:23:45 -l nodes=2"
if [  "X${EXTRA_ARGUMENTS}" != "X"  ] ; then
    value=`strip_quotes "$EXTRA_ARGUMENTS"`
    echo "#$ ${value}"
fi

echo "#"
echo "# End of segment generated by sge_local_submit_attributes.sh"
echo "#"

error: pathspec 'share/pegasus/htcondor/glite/sge_local_submit_attributes.sh' did not match any file(s) known to git


Create Script_Task_2.sh

Create Script_Task_2.sh

error: pathspec 'Linux/Introduction_to_Linux.' did not match any file(s) known to git
error: pathspec 'Stepik.org/Task_2/Script_Task_2.sh' did not match any file(s) known to git


Remove superfluous pip packages

Remove superfluous pip packages

error: pathspec '{{' did not match any file(s) known to git
error: pathspec 'cookiecutter.repo_name' did not match any file(s) known to git
error: pathspec '}}/script/bootstrap.sh' did not match any file(s) known to git


bugfix

bugfix

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/szilvajuhos/CAW.git/'


bugfix

bugfix


bell.sh sends the bell character every 5 seconds

This allows you to see how your tmux/screen and terminal emulator will
handle the bell character.

#!/usr/bin/env bash
while true
do
    echo -e "Ding!\a"
    sleep 5
done

error: pathspec 'bell.sh' did not match any file(s) known to git


List all brew packages to install

List all brew packages to install

#!/usr/bin/env bash

# Minimum Viable Tools (Short-Term)
brew install git
brew install n
brew install yarn
brew cask install sourcetree
brew cask install visual-studio-code
brew cask install phpstorm
brew cask install google-chrome
brew cask install firefox
brew cask install go2shell
brew cask install spectacle
brew cask install lastpass
brew cask install slack
brew cask install clipy

# Full Dev/Design Suites (Long-Term)
# brew cask install vagrant
# brew cask install virtualbox
# brew cask install cyberduck
# brew cask install mamp
# brew cask install adobe-creative-cloud

# Productivity Tools
# brew cask install google-drive
# brew cask install namechanger
# brew cask install recordit
# brew cask install skitch

# Work Tools
# brew cask install harvest
# brew cask install joinme
# brew cask install skype

# Entertainment Apps
# brew cask install sonos
# brew cask install spotify
# brew cask install quik

error: pathspec 'brew.sh' did not match any file(s) known to git


Closes #9: Recognize "fix" and "fixes" as close command.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/viniciusban/clog.git/'


Add suckell-tools (for dmenu)

Add suckell-tools (for dmenu)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dawikur/mnl.git/'


Get back to install/remove programs one-by-one


added arch stuff

added arch stuff

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi
pacman -S pulseaudio pulseaudio-alsa pavucontrol gnome-terminal flashplugin vlc chromium unzip unrar p7zip gedit gnome-system-monitor a52dec faac faad2 flac jasper lame libdca libdv libmad libmpeg2 libtheora libvorbis libxv wavpack x264 xvidcore gstreamer0.10-plugins git guake gcc  g++  python2 emacs  perl  make  units  fish  python-pip screen

error: pathspec 'arch/arch.bash' did not match any file(s) known to git


Fix indentation/formatting in deps.sh

Fix indentation/formatting in deps.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Apptimize/ve.git/'