Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
myhome="" # 自鯖を指定 (username@domainname)
# まずは環境を最新に
case "${OSTYPE}" in
freebsd*|darwin*)
if [ -d /opt/local/bin ]; then
# MacPorts のアップデートコマンド
:
#!/bin/sh
#
# 参考: http://metasearch.sourceforge.jp/wiki/index.php?Hadoop%A5%BB%A5%C3%A5%C8%A5%A2%A5%C3%A5%D7
#
# 色
bla="\033[30m" #黒
red="\033[31m" #赤
gre="\033[32m" #緑

code

require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
@ay65535
ay65535 / git_downloadAllbranches.sh
Last active January 2, 2016 19:19 — forked from mnogu/git.sh
ブランチを全部落とすワンライナー from https://gist.github.com/mnogu/3844699
for i in `git branch -r | grep -Ev "HEAD|master" | sed 's:origin/::g'`; do; git checkout --track -b $i origin/$i; done; git checkout master
@ay65535
ay65535 / wget-cloud-set-guest-password.sh
Last active August 29, 2015 14:06
downloads 5 different versions of cloud-set-guest-password (for CloudStack)
#!/bin/sh
# usage:
# wget "https://gist.githubusercontent.com/ay65535/5c64117bea45649529de/raw/b924203859bb08b2af13bfd50abd6a3bfa68d9e7/wget-cloud-set-guest-password.sh"
# chmod +x wget-cloud-set-guest-password.sh
# ./wget-cloud-set-guest-password.sh
# 2011-02-10
wget "http://sourceforge.jp/frs/g_redir.php?m=jaist&f=%2Fcloudstack%2FPassword+Management+Scripts%2Fget_password_from_domr" -O get_password_from_domr
@ay65535
ay65535 / gradle_test_ reports
Created November 23, 2014 18:37
gradle_test_ reports
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test results - Test Summary</title>
<link href="css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<script src="js/report.js" type="text/javascript"></script>
</head>
<body>
@ay65535
ay65535 / au_smart_pass_syuuri_daikin_support.md
Last active August 29, 2015 14:14
auスマートパス 修理代金サポート 提出確認書類

auスマートパス 修理代金サポート

提出確認書類

以下5点が確認できる書類を同封ください。確認できない項目がある場合、申請を受付できません。

  • 修理証明書のコピー
    • 「1.auスマートパス契約者名(au契約者名)」にご記載いただいた氏名
    • 修理機種名
  • 修理完了日
@ay65535
ay65535 / sethostname
Last active August 29, 2015 14:15
Save the following script to /etc/dhcp/dhclient-exit-hooks.d/sethostname, and adjust the permissions. cf. http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/templates.html#system-preparation-for-linux
#!/bin/sh
# dhclient change hostname script for Ubuntu
# ( cf. http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.5/templates.html#system-preparation-for-linux )
oldhostname=$(hostname -s)
if [ $oldhostname = 'localhost' -o $oldhostname = '(none)' ]; then
sleep 10 # Wait for configuration to be written to disk
hostname=$(cat /var/lib/dhcp/dhclient.eth0.leases | awk '/host-name/ { host = $3 } END { printf host }' | sed 's/[";]//g' )
fqdn="$hostname.$(cat /var/lib/dhcp/dhclient.eth0.leases | awk '/domain-name/ { domain = $3 } END { printf domain } ' | sed 's/[";]//g')"
ip=$(cat /var/lib/dhcp/dhclient.eth0.leases | awk '/fixed-address/ { lease = $2 } END { printf lease }' | sed 's/[";]//g')
echo "cloudstack-hostname: Hostname _localhost_ detected. Changing hostname and adding hosts."
#!/bin/sh
# http://cloudstack-administration.readthedocs.org/en/4.3/templates.html#system-preparation-for-linux
# cat /var/lib/dhcp/dhclient.eth0.leases
# sudo vi /etc/dhcp/dhclient-exit-hooks.d/sethostname
#cp /etc/hosts.dhcp.bak .
#sudo mv /etc/hosts.dhcp.bak /etc/hosts
sudo rm /etc/hosts.dhcp.bak
#!/bin/sh
sudo adduser $1
sudo usermod -a -G adm $1
sudo usermod -a -G sudo $1
sudo usermod -a -G cdrom $1
sudo usermod -a -G dip $1
sudo usermod -a -G plugdev $1
sudo usermod -a -G lpadmin $1
sudo usermod -a -G sambashare $1