groupadd -r admin
usermod -a -G admin vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
visudo -cf /etc/sudoers
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 | |
PATHOK="`grep myprog /etc/environment`" | |
if [ -z $PATHOK ]; then | |
sed -e '/^PATH/s/"$/:\/usr\/lib\/myprog\/bin"/g' -i /etc/environment | |
fi |
- My default:
vim ~/.zshrc
ZSH_THEME="clean"
HIST_STAMPS="dd.mm.yyyy"
- iTerm2 default:
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
import scrapy | |
import peewee | |
import re | |
import urllib | |
import cStringIO | |
from PIL import Image | |
from playhouse.db_url import connect | |
db = connect('mysql://root:@127.0.0.1/house') |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provider "virtualbox" | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 512 |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provider "virtualbox" | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 512 |
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
- name: 1st | |
tags: debug | |
debug: var=hostvars['{{ item }}']['ansible_eth1']['ipv4']['address'] | |
with_items: "{{ groups['master'] }}" | |
- name: 2nd | |
tags: debug | |
debug: var=hostvars['{{ item }}']['ansible_default_ipv4']['address'] | |
with_items: "{{ groups['master'] }}" |
If you need to run the same command on multiple servers you can use a very useful tool called pssh. You can install it with Homebrew running:
brew install pssh
Once installed you can run the following command to get the current uptime on multiple server: