Skip to content

Instantly share code, notes, and snippets.

View louisje's full-sized avatar
💯
左手寫程式 (">_<) 右手做測試

Louis Jeng louisje

💯
左手寫程式 (">_<) 右手做測試
View GitHub Profile
@louisje
louisje / android-configure.sh
Last active September 13, 2016 07:52 — forked from nddrylliog/android_configure.sh
Cross-compile autotools library for Android / arm-linux-androideabiI stick that in ~/bin/, chmod +x, and then run it in place of "./configure" in my project. Then a make and make install later, the prefix contains libraries built for android. Neato eh?
#!/bin/sh
#
# NDK Standalone Toolchain:
# $HOM#/Android/Sdk/ndk-bundle/build/tools/make_standalone_toolchain.py --arch x86 --api 22 --stl gnustl -v --install-dir $HOME/workspace/ndk-toolchain --force
# cp $HOME/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a $HOME/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86/libandroid_support.a $HOME/workspace/ndk-toolchain/i686-linux-android/lib
#
# NDK
export TARGET='i686-linux-android'
export TOOLCHAIN=${HOME}/workspace/ndk-toolchain
FROM ubuntu
RUN apt-get update
RUN apt-get install -y sudo git curl
RUN useradd -m -s /bin/bash louis
RUN echo "louis ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER louis
WORKDIR /home/louis
RUN git clone https://github.com/louisje/outland.git
RUN outland/bin/ol-build
ENTRYPOINT [ "/bin/bash", "--login" ]
FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl jq
WORKDIR /root
RUN curl -ksL https://gist.github.com/louisje/86a6c382b0a89db7f97d/raw/vision-adult.sh > vision-adult.sh
RUN chmod a+x vision-adult.sh
ENTRYPOINT [ "./vision-adult.sh" ]
CMD [ "--help" ]
#!/bin/sh
num=3
set -e
if test -n "$SWARM_NUM"; then
num="$SWARM_NUM"
fi
create() {
version: '2'
services:
hephaestus:
build: ./hephaestus
depends_on:
- queue
- redis
environment:
- P_APP_ID=3eeeUbYPJdftJ9Q777awM6QiVDcKPY9f9cARopBM
#!/bin/bash
#
# <pre>
#
# Copyright (c) 2016 Louis Jeng <louisje@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@louisje
louisje / morse.sh
Last active December 21, 2015 09:01
#!/bin/bash
# morse.sh - generate morse code from ascii
# you can contact me at:
# --. .-. ..- .-.. --- ... .--.-. --. -- .- .. .-..
# .-.-.- -.-. --- --
# if you don't like my "dots" and "dashes"
# you can change them
# dot=.
# dash=_
#!/bin/sh
export DISPLAY=":2"
#sudo apt-get install -y tightvncserver
sudo apt-get install -y psmisc
#vncserver -kill $DISPLAY
sudo pkill x11vnc
sudo pkill Xvfb
### x-window ###
sudo apt-get install -y xfonts-cyrillic xfonts-100dpi xfonts-75dpi xvfb x11vnc xfce4
#vncserver $DISPLAY -geometry 1372x874 -depth 24
#!/bin/sh
# usage: ./date_of_year.sh [ {year} ]
year=$1
if test -z "$year"; then
year=`date +'%Y'`
fi
next_year=`echo "$year + 1" | bc`
now=`date +"%Y-%m-%d" -d "$year-01-01"`
end=`date +"%Y-%m-%d" -d "$next_year-01-01"`;
package acloudsvc.hadoop.examples;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.commons.io.IOUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;