export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo dpkg-reconfigure locales
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 | |
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S") | |
BACKUP_DIR="/home/ubuntu/backup/$TIMESTAMP" | |
MYSQL_USER="****" | |
MYSQL=/usr/bin/mysql | |
MYSQL_PASSWORD="****" | |
MYSQLDUMP=/usr/bin/mysqldump | |
mkdir -p "$BACKUP_DIR/" |
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
<?php | |
ini_set( 'display_errors', 1 ); | |
error_reporting( E_ALL ); | |
$from = "[email protected]"; | |
$to = "[email protected]"; | |
$subject = "PHP Mail Test script"; | |
$message = "This is a test to check the PHP Mail functionality"; | |
$headers = "From:" . $from; | |
mail($to,$subject,$message, $headers); | |
echo "Test email sent"; |
#!/bin/bash
RUNNING=`ps aux | grep "ssh -i /root/.ssh/id_rsa -L .:880:localhost:80 " | grep -v grep | wc -l`
if [ $RUNNING -eq 0 ]; then
screen -dm ssh -i /root/.ssh/id_rsa -L *:880:localhost:80 -L 4443:www.google.com:443 -R 880:localhost:80 username@yourvpsdomain
fi
- hosts: all
become: true
tasks:
- name: Set authorized key taken from file
authorized_key:
user: ubuntu
state: present
key: "{{ lookup('file', '/home/ubuntu/new_id_rsa.pub') }}"
docker run -d --name httpbin kennethreitz/httpbin
docker run -it --rm --link httpbin tutum/curl curl -X GET http://httpbin/headers
docker run -it --rm envoyproxy/envoy envoy --help
docker run -it --rm envoyproxy/envoy envoy (no config
kubectl -n default patch deployment nginx-deployment -p '{"spec":{"template":{"metadata":{"annotations":{"sidecar.istio.io/inject": "true"}}}}}'
spec:
replicas: 1
template:
metadata:
labels:
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 | |
LOCKFILE=/home/ubuntu/docker.lock | |
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then | |
echo "already running" | |
exit | |
fi | |
# make sure the lockfile is removed when we exit and then claim it | |
trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT | |
echo $$ > ${LOCKFILE} |
curl --silent --connect-timeout 1 -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/scopes
sed -i '/BaseURL/c\ \"BaseURL\" : \"http:\/\/google.com\/\"' config.json