Skip to content

Instantly share code, notes, and snippets.

View seak0503's full-sized avatar

Shota Yamahira seak0503

  • BroadBandTower, Inc.
View GitHub Profile
@seak0503
seak0503 / newUser.sh
Created July 7, 2014 07:16
ユーザの作成とパスワード設定を行うシェルスクリプト
#!/bin/bash
# root権限と同じ権限を持つユーザの作成
/usr/sbin/useradd -u 0 -o -g 0 new_superuser
echo "new_superuser:newpassword1" | /usr/sbin/chpasswd
# 一般ユーザの作成
/usr/sbin/groupadd -g 50000 newuser
/usr/sbin/useradd -u 50000 -g 50000 newuser
echo "newuser:newpassword2" | /usr/sbin/chpasswd
@seak0503
seak0503 / makeFloppyImage.sh
Created July 8, 2014 07:52
floppyイメージを作成するシェルスクリプト
#!/bin/bash
# floppyイメージを作成するシェルスクリプトです
# 引数のチェック
if [ "$#" -ne 3 ]; then
echo "usage: makeFloppyImage.sh フロッピーイメージのファイル名 フロッピーに入れるファイル名 マウントポイント"
exit 1
fi
@seak0503
seak0503 / yum_install_DellServerAdmin.md
Last active August 29, 2015 14:08
Dell ServerAdministratorをyumでインストールする方法

install:

wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
yum install srvadmin-all

service start:

@seak0503
seak0503 / startvm.js
Last active August 29, 2015 14:10
windows7上のvirtualboxの仮想サーバを制御するスクリプト
/*
windows7上のVirtualBoxの仮想サーバを起動するスクリプトです。
guest_os_name の部分を書き換えて使用してください。
*/
var WshShell = new ActiveXObject("WScript.Shell");
// Runの最後の引数にfalseを与えることで、waitせずにホストに制御を戻しています。
WshShell.Run("\"C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe\" startvm \"guest_os_name\"", 0, false);
WshShell = null;
@seak0503
seak0503 / InstallTerminator.md
Created November 23, 2014 23:06
centosにTerminator(ターミナルソフト)をインストールする手順
  1. epelがインストールされていなければ、インストールする
# yum --enablerepo=rpmforge -y install terminator
  1. Terminatorをインストールする
# yum install terminator
@seak0503
seak0503 / rails_gitignore
Created January 19, 2015 01:26
Rails用のgitignore
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
@seak0503
seak0503 / RailsTutorialGitPush.md
Last active August 29, 2015 14:14
railsチュートリアル環境でのgit push

railsチュートリアル環境でのgit push

git push
git push heroku master
heroku run rake db:migrate
@seak0503
seak0503 / destroyControllerAndModel.md
Last active August 29, 2015 14:15
Railsのcontrollerとmodelの削除の仕方

Railsのcontrollerとmodelの削除の仕方

controllerの削除

controller作成:

$ rails generate controller FooBars baz quux
@seak0503
seak0503 / 3environmentRails.md
Last active August 29, 2015 14:16
Railsの3つの環境を使いこなす

Railsの3つの環境を使いこなす

Railsにはテスト環境(test)、開発環境(development)、本番環境(production)の 3つの環境がデフォルトで装備されています。

railsコマンドのconsoleservermigrateの3つでそれぞれ デフォルトの環境以外を指定する方法が異なり、混乱することがあるので まとめておきます。

@seak0503
seak0503 / heroku_command_list.md
Last active August 29, 2015 14:17
herokuコマンド一覧

herokuコマンド一覧

コマンド名・オプション 効果
概要 heroku help herokuコマンドのヘルプを表示する
概要 heroku version herokuコマンドのバージョンを表示する
アプリの操作 heroku list あなたのアプリケーションの一覧を表示する
アプリの操作 heroku create <アプリケーション名> Herokuに新しいアプリケーションを作成する
アプリの操作 heroku info このアプリケーションの情報を表示する