echo "$USER access on $(date)" | mail -s "${HOSTNAME} Security Alert" [email protected]
Creating secure Linux VMs in Azure with SSH key pairs Generate cert
openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout filename.key \
-out filename.pem
Secure key file
chmod 0600 filename.key
- sudo vim /etc/hostname
- rename
- sudo vim /etc/hosts
- rename
- sudo service hostname restart
- if it does not work, sudo shutdown -r now
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
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh |
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
ifconfig eth0 | grep "inet addr" | cut -d: -f2 | awk '{print $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
#!/bin/bash | |
SSH_REDIR_PORT=12345 | |
SSH_D="cloud_sshd" | |
COMMAND="ssh -R $SSH_REDIR_PORT:localhost:22 $SSH_D -N -f" | |
pgrep -f "ssh -R $SSH_REDIR_PORT:localhost:22" > /dev/null 2>&1 || (eval $COMMAND && echo $COMMAND) |
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 docker run -it --rm -v /media/data/volumes/projects/go:/go -w /go golang:latest |
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
docker run -it --rm -v ~/sites/savewalnut/src:/src --name webdev --expose 9000 -p 80:9000 hcsoftech/webdev |
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
rsync -a --delete \ | |
--delete-excluded .git \ | |
--delete-excluded .gitignore \ | |
--delete-excluded publish.sh \ | |
--delete-excluded CNAME \ | |
~/sites/thesite/src/dist/ . | |
git add --all | |
git commit -m "published on `date`" | |
git push origin master |
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 nocompatible | |
filetype plugin on | |
if has("autocmd") | |
filetype on | |
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab | |
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab | |
endif | |
set mouse=a |
OlderNewer