This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# grep cloud-init /var/log/messages | |
# OR | |
# tail -f /var/log/messages | grep cloud-init | |
# Source: https://stackoverflow.com/questions/50255413/var-log-cloud-init-output-log-is-not-present-on-rhel-7-5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set proxy config via /etc/profile.d - should apply for all users | |
# You can edit /etc/profile or add a script in /etc/profile.d directory which will be executed /etc/profile script | |
# After that, you can test executing "source /etc/profile" | |
PROXY_URL="http://10.102.45.9:8080/" | |
export http_proxy="$PROXY_URL" | |
export https_proxy="$PROXY_URL" | |
export ftp_proxy="$PROXY_URL" | |
export no_proxy="127.0.0.1,localhost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT | |
if [ ! "$BASH_VERSION" ] ; then | |
exec /bin/bash "$0" "$@" | |
fi | |
SERVERS=$(cat <<EOF | |
10.0.0.1 | |
10.0.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DIRECTORY=$1 | |
while read -r package; do | |
venv/bin/pip install "${package}" -f "$DIRECTORY"/ --no-index | |
done < requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
rm -rf pip_packages | |
mkdir pip_packages | |
while read -r package; do | |
venv/bin/pip download "${package}" -d pip_packages | |
done < requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up openssh-server (1:6.6p1-2ubuntu2.10) ... | |
# update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match ssh Default-Stop values (none) | |
# invoke-rc.d: initscript ssh, action "restart" failed. | |
# dpkg: error processing package openssh-server (--configure): | |
# subprocess installed post-installation script returned error exit status 1 | |
# Errors were encountered while processing: | |
# openssh-server | |
# E: Sub-process /usr/bin/dpkg returned an error code (1) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -r -nH --cut-dirs=5 -nc ftp://user:pass@server//absolute/path/to/directory | |
# -nH avoids the creation of a directory named after the server name | |
# -nc avoids creating a new file if it already exists on the destination (it is just skipped) | |
# --cut-dirs=5 allows to take the content of /absolute/path/to/directory and to put it in the directory where you launch wget. The number 5 is used to filter out the 5 components of the path. The double slash means an extra component. | |
# Source: https://stackoverflow.com/questions/113886/how-to-recursively-download-a-folder-via-ftp-on-linux#answer-5567776:~:text=Just%20to%20complement%20the%20answer%20given%20by%20Thibaut%20Barr%C3%A8re. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u devil -- sh -c "whoami; cd ~/ && pwd" | |
# Expected result | |
# devil | |
# /some/hell/path/devil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#!/usr/bin/expect | |
if [ ! "$BASH_VERSION" ] ; then | |
exec /bin/bash "$0" "$@" | |
fi | |
echo -n "SSH User": | |
read -r sshusertemp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat hadoop_file.bin | gzip -d |
NewerOlder