ssh -t example.com 'tmux -CC new-session -A -s logs'
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
# | |
# Author:: Vitaly Shishlyannikov (<[email protected]>) | |
# Copyright:: Copyright (c) 2014 | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
log_format custom '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $bytes_sent ' | |
'"$http_referer" "$http_user_agent" ' | |
'"$host" "$uri" "$args" "$sent_http_location" ' | |
'"$proxy_host" "$upstream_addr" "$upstream_cache_status" ' | |
'[$request_time] [$upstream_response_time]'; |
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
require 'socket' | |
def have_ip?(ip) | |
ip_arr = Socket.ip_address_list.select{|intf| intf.ipv4?} | |
ip_arr.to_s.scan(/(?<=: )[\d.]+(?=>)/).find{ |e| /#{ip}/ =~ e } | |
end | |
if File.exist?('/var/local/location.txt') | |
dc_location = File.read('/var/local/location.txt') |
/etc/network/interfaces
auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ssid <your_router>
wpa-psk
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 aptitude safe-upgrade `dpkg -l | awk {'print $2'}| grep -e "^libc[-|6]" | paste -s` | |
or | |
sudo aptitude safe-upgrade `dpkg -l | cut -d " " -f 3 | grep -e "^libc[-|6]" | paste -s` |
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 | |
echo "Set description for chef's nodes. Press ENTER to skip node." | |
for NODE in `knife search "! desc:*" -i | tail -n+2`;do | |
echo "Node: ${NODE}" | |
echo -n 'Description: ' | |
read DESC | |
if [ ! -z "${DESC}" ];then | |
knife node attribute set ${NODE} desc "${DESC}" | |
else |
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
# /etc/security/limits.d/10tuning.conf | |
# max number of open files | |
* soft nofile 999999 | |
* hard nofile 999999 | |
root soft nofile 999999 | |
root hard nofile 999999 | |
# max stack size (KB) | |
* soft stack unlimited |
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
server { | |
listen 80; | |
server_name bitrix.example.com; | |
client_max_body_size 200m; | |
root /var/www/bitrix; | |
index index.html index.php; |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": ["s3:ListBucket"], | |
"Resource": ["arn:aws:s3:::my-backup"] | |
}, | |
{ | |
"Effect": "Allow", |