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
mvn archetype:generate \ | |
-DarchetypeArtifactId=android-library-quickstart \ | |
-DarchetypeGroupId=de.akquinet.android.archetypes \ | |
-DarchetypeVersion=1.0.10 \ | |
-Dandroid-plugin-version=3.6.0 \ | |
-DgroupId=com.foo.bar \ | |
-DartifactId=my-android-project \ | |
-Dpackage=com.foo.bar.android |
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
du -sk -BM ./* |
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
name=$1 | |
sudo sed -i -e "s/kernel.hostname.*/kernel.hostname=${name}/g" /etc/sysctl.conf | |
echo ${name} | sudo tee /etc/hostname | |
sudo hostname ${name} | |
sudo sed -i -e "s/127.0.1.1.*/127.0.1.1 ${name}/g" /etc/network/interfaces |
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
@echo off | |
set java_exe="%JAVA_HOME%\bin\java.exe" | |
set javaw_exe="%JAVA_HOME%\bin\javaw.exe" |
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
virtualenv --no-site-packages ./venv | |
./venv/bin/python hoge.py |
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
import subprocess | |
p = subprocess.Popen( | |
['ls', '-l'], | |
cwd='/tmp', | |
stderr=subprocess.PIPE, | |
stdout=subprocess.PIPE, | |
stdin=subprocess.PIPE) | |
p.wait() |
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
import inspect | |
def get_org_func(f): | |
if hasattr(f.__closure__, 'count') : | |
for v in f.__closure__: | |
if inspect.isfunction(v.cell_contents): | |
return get_org_func(v.cell_contents) | |
else: | |
return f |
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
# define decorator | |
def my_deco(*arg, **kwargs): | |
def _(func): | |
func.__dict__.setdefault('foo', (arg, kwargs)) | |
return func | |
return _ | |
# make decorated function | |
@my_deco(alice='brother') | |
def echo(msg): |
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 | |
# install git | |
apt-get install git | |
# create user for operate git | |
GIT_HOME=/srv/gitrepos | |
GIT_SHELL=`which git-shell` | |
mkdir -p ${GIT_HOME} | |
adduser --home ${GIT_HOME} --shell ${GIT_SHELL} git |
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
import pkgutil | |
def load_submodules(mod): | |
for (importer, name, ispkg) in pkgutil.iter_modules(path=mod.__path__, | |
prefix=mod.__name__ + '.'): | |
if not ispkg: | |
yield importer.find_module(name).load_module(name) |