pycache/ *.py[cod] *$py.class
*.so
.Python
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import socket | |
import re | |
import sys | |
def check_server(address, port): | |
# Create a TCP socket | |
s = socket.socket() | |
print "Attempting to connect to %s on port %s" % (address, port) |
# -*- mode: ruby -*- 2 # vi: set ft = ruby : 3 4 VAGRANTFILE_API_VERSION = "2" 5 6 Vagrant.configure( VAGRANTFILE_API_VERSION) do | config | 7 # General Vagrant VM configuration. 8 config.vm.box = "geerlingguy/ centos7" 9 config.ssh.insert_key = false 10 config.vm.synced_folder ".", "/vagrant", disabled: true 11 config.vm.provider :virtualbox do | v | 12 v.memory = 256 13 v.linked_clone = true 14 end 15 16 # Application server 1. 17 config.vm.define "app1" do | app | 18 app.vm.hostname = "orc-app1. test" 19 app.vm.network :private_network, ip: "192.168.60.4" 20 end 21 22 # Application server 2. 23 config.vm.define "app2" do | app | 24 app.vm.hostname = "orc-app2. test" 25 app.vm.network :private_network, ip: "192.168.60.5" 26 end 27 28 # Database server. 29 config.vm.define "db" do | db | |
db.vm.hostname = "orc-db.test" 31 db.vm.network :private_network, ip: "192.168.60.6" 32 end 33 end This Vagrantfile |
Question: | |
. How to run Ansible without specifying the inventory but the host directly? | |
. Run a playbook or command with arbitrary host not in the inventory hosts list? | |
. run ansible with arbitrary host/ip without inventory? | |
Answer: | |
Surprisingly, the trick is to append a , | |
The host parameter preceding the , can be either a hostname or an IPv4/v6 address. | |
ansible all -i example.com, |
pip list -o | ForEach-Object { $data=$_ -split " "; python -m pip install -U $data[0]} |
{ | |
"shellLauncher.shells.windows": [ | |
{ | |
"shell": "C:\\Windows\\System32\\cmd.exe", | |
"label": "cmd" | |
}, | |
{ | |
"shell": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", | |
"label": "PowerShell 5.1" | |
}, |
python -m pip list --outdated | awk '{print $1}' | xargs -n1 python -m pip install -U
echo 'deb https://deb.torproject.org/torproject.org stretch main deb-src https://deb.torproject.org/torproject.org stretch main' > /etc/apt/sources.list.d/tor.list
wget -O- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo apt-key add -
apt install tor deb.torproject.org-keyring
apt install gvfs gvfs-common gvfs-daemons gvfs-libs gconf-service gconf2 gconf2-common gvfs-bin psmisc
#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.
putty
Set Connection -> Data -> Terminal-type string
to xterm-256color
tmux
Add this line to ~/.tmux.conf
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. | |
#ServerName www.example.com |