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
exec-venv(){ | |
case "$PWD" in | |
*/some-dir-with-venv) | |
if [ -z "${VIRTUAL_ENV}" ]; then | |
. ./venv/bin/activate | |
## Some other commands here | |
fi | |
;; | |
*/some-dir-with-venv/*) | |
## won't do anything |
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
repr(string).decode('raw_unicode_escape') |
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
:w !sudo tee % > /dev/null |
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
defbce on | |
escape ^tt | |
defscrollback 10000 | |
startup_message off | |
verbose on | |
logfile 'screen.log.%H.%Y%m%d-%02c:%s-%n.%t.log' | |
logtstamp on | |
logtstamp string "\n-- SCREEN [%Y/%m/%d %02c:%s] %n:%t --\n" | |
deflog on | |
bind w windowlist -b |
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/sh | |
# http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F | |
# 1. Hardware and storage configuration | |
uname -a | |
xfs_repair -V | |
cat /proc/cpuinfo | |
cat /proc/meminfo | |
cat /proc/partitions | |
# RAID layout |
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 | |
# http://rrreeeyyy.com/blog/2014/04/21/set-euo-pipefail/ | |
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html | |
# https://fumiyas.github.io/2013/12/24/initialize.sh-advent-calendar.html | |
set -euo pipefail | |
umask 0750 | |
export PATH="/bin:/usr/bin" | |
export LANG="C" | |
# ここからスタート |
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
# **postinstall.sh** is a script executed after Debian/Ubuntu has been | |
# installed and restarted. There is no user interaction so all commands must | |
# be able to run in a non-interactive mode. | |
# | |
# If any package install time questions need to be set, you can use | |
# `preeseed.cfg` to populate the settings. | |
### Setup Variables | |
# The version of Ruby to be installed supporting the Chef and Puppet gems |
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 | |
# http://d.hatena.ne.jp/CortYuming/20120430/p1 | |
sudo yum -y install git | |
git config --global user.name admin | |
git config --global user.email [email protected] | |
git config --global color.diff auto | |
git config --global color.status auto | |
git config --global color.branch auto | |
git config --global core.excludesfile ~/.gitignore | |
git config --global core.shared true |
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
# Print OS version | |
cat /etc/lsb-release # or lsb_release -a | |
cat /etc/redhat-release | |
uname -a | |
cat /proc/version_signature | |
# Collect system logs | |
# /var/log/messages 一般的なシステムに関する情報 | |
# /var/log/syslog | |
# /var/log/cron 定期的に実行される処理の結果に関する情報 |
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/sh | |
# assume swift library, python-pip, rubygems, rspec, rake and serverspec is installed. | |
# assume PATH contains /usr/local/bin | |
cp swift_ring_spec.rb /usr/local/bin | |
chmod +x /usr/local/bin/swift_ring_spec.rb | |
sudo pip install netifaces |
NewerOlder