This file contains hidden or 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
\ Used to drop the special meaning of character | |
following it (discussed below) | |
[] Represent a character class | |
^ Matches the beginning | |
$ Matches the end | |
. Matches any character except newline | |
? Matches zero or one occurrence. | |
| Means OR (Matches with any of the characters | |
separated by it. | |
* Any number of occurrences (including 0 occurrences) |
This file contains hidden or 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
su #substitute user | |
id | |
echo $USER | |
su -l #full login shell | |
cat /etc/sudoers | |
sudo visudo | |
ssh -l root 192.168.0.3 | |
vi /etc/ssh/sshd_config | |
systemctl restart sshd |
This file contains hidden or 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
‘\b’ Match the empty string at the edge of a word. | |
‘\B’ Match the empty string provided it’s not at the edge of a word. | |
‘\<’ Match the empty string at the beginning of word. | |
‘\>’ Match the empty string at the end of word. | |
‘\w’ Match word constituent, it is a synonym for ‘[_[:alnum:]]’. | |
‘\W’ Match non-word constituent, it is a synonym for ‘[^_[:alnum:]]’. | |
‘\s’ Match whitespace, it is a synonym for ‘[[:space:]]’. | |
‘\S’ Match non-whitespace, it is a synonym for ‘[^[:space:]]’. |
This file contains hidden or 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
A regular expression may be followed by one of several repetition operators: | |
‘.’ The period ‘.’ matches any single character. | |
‘?’ The preceding item is optional and will be matched at most once. | |
‘*’ The preceding item will be matched zero or more times. | |
‘+’ The preceding item will be matched one or more times. | |
‘{n}’ The preceding item is matched exactly n times. | |
‘{n,}’ The preceding item is matched n or more times. | |
‘{,m}’ The preceding item is matched at most m times. This is a GNU extension. | |
‘{n,m}’ The preceding item is matched at least n times, but not more than m times. |
This file contains hidden or 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
# remgit.sh | |
# Creates a remote git repository from the current local directory | |
# Configuration | |
# Replace SSH_USERNAME, SSH_HOST, SSH_GIT_PATH with your details | |
USER=SSH_USERNAME | |
HOST=SSH_HOST | |
GIT_PATH=SSH_GIT_PATH | |
REPO=${PWD##*/} |
This file contains hidden or 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
# === AutoMySQLBackup === | |
if [[ $run_all = false ]]; then | |
echo -n "Install AutoMySQLBackup? (y/n) [default: n]: " | |
read automysqlbackup | |
fi | |
if [ "$automysqlbackup" = "y" ] || [ $run_all = true ]; then | |
show_notice "Installing AutoMySQLBackup..." | |
apt-get install -y automysqlbackup |
This file contains hidden or 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/sh | |
# sed -e 's/^[ \t]*//;s/[ \t]*$//' -e '/^#/d' -e '/^$/d' | |
if [ -z $1 ]; then exit 0; else true; fi | |
xz -kf9 $1 | |
printf '#!/bin/sh\nx=`tempfile`;echo ' > ${1}-min | |
base64 -w 0 ${1}.xz >> ${1}-min | |
printf '|base64 -d|xz -d>$x && chmod +x $x && $x $@; rm $x' >> ${1}-min | |
rm -f ${1}.xz |
This file contains hidden or 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 | |
FFMPEG=/usr/bin/ffmpeg | |
HD_SUFFIX='_hd' | |
EMBED_WIDTH='640' | |
EMBED_HEIGHT='360' | |
SD_RESOLUTION=$EMBED_WIDTH'x'$EMBED_HEIGHT |
This file contains hidden or 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 apt-get install software-properties-common | |
sudo apt-add-repository ppa:ansible/ansible | |
sudo apt-get update | |
sudo apt-get install ansible | |
ansible --version | |
ansible-playbook --version | |
ansible-galaxy --help | |
ansible --list-hosts all | |
sudo vi /etc/ansible/hosts | |
ansible -i dev --list-host all |
This file contains hidden or 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
sshpass -p 'nhGfJfU0' rsync -avu --exclude-from=/var/www/vhosts/IP ADRESSS/IP ADRESSS/dl-cpdpod/omit.txt -e ssh --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r -p --delete [email protected]:/var/www/vhostsIP ADRESSS/IP ADRESSS/xml-data/build-dir/1769473-1900545/ /var/www/vhosts/IP ADRESSS/IP ADRESSS/dl-cpdpod/ |