Skip to content

Instantly share code, notes, and snippets.

@enzinier
enzinier / keybase.md
Created February 8, 2017 04:19
keybase.md

Keybase proof

I hereby claim:

  • I am enzinier on github.
  • I am enzinier (https://keybase.io/enzinier) on keybase.
  • I have a public key ASDuJUJmJ9UsgRyTRLqECORw2PxhI_RCZdLEeZ7CYDRFmAo

To claim this, I am signing this object:

@enzinier
enzinier / bootstrap-java.sh
Created February 24, 2017 07:35
Install Java on Ubuntu
#!/usr/bin/env bash
apt-get install python-software-properties
add-apt-repository -y ppa:webupd8team/java
apt-get update
# Enable silent install
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
@enzinier
enzinier / sliently_install_java_ubuntu.sh
Created February 28, 2017 01:55
Sliently install Java 8 on Ubuntu
#!/usr/bin/env bash
sudo apt-get install -y python-software-properties debconf-utils
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo apt-get install -y oracle-java8-installer
@enzinier
enzinier / install_font_adobe_source_code_pro.sh
Created March 4, 2017 03:38
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@enzinier
enzinier / example_ubuntu_launcher_shortcut.desktop
Created March 4, 2017 04:06
Example for Ubuntu launcher shortcut.
[Desktop Entry]
Version=2.3
Name=Android Studio
Comment=Android Studio
Exec=/home/jason/Applications/android-studio/bin/studio.sh
Icon=/home/jason/Applications/android-studio/bin/studio.png
Terminal=false
Type=Application
Categories=Utility;Application;
@enzinier
enzinier / setup_environment-ubuntu.sh
Last active March 4, 2017 07:28
Setup initial environment on Ubuntu 16.04 LTS
#!/bin/sh
# Install Node 6.x (https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
# Install yarn (https://yarnpkg.com/en/docs/install#linux-tab)
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@enzinier
enzinier / run_android_emulator.sh
Created March 5, 2017 02:31
Run android emulator by command in terminal.
#! /bin/bash
# (@) start-android
# If the emulator command exists on this device, displays a list of emulators
# and prompts the user to start one
# ref. http://stackoverflow.com/questions/7837952/what-is-the-command-to-list-the-available-avdnames
# Check if the emulator command exists first
if ! type emulator > /dev/null; then
echo "emulator command not found"
exit 1
@enzinier
enzinier / run_first_android_device.sh
Created March 5, 2017 02:40
Run only first device in android emulator.
#! /bin/bash
# only run first android emulator/
# ref. http://stackoverflow.com/questions/7837952/what-is-the-command-to-list-the-available-avdnames
# Check if the emulator command exists first
if ! type emulator > /dev/null; then
echo "emulator command not found"
exit 1
fi
@enzinier
enzinier / avd.desktop
Last active July 14, 2022 15:05
Create shortcut for running android virtual device in Ubuntu launcher.
[Desktop Entry]
Version=1.0
Name=AVD
Comment=AVD
Exec=bash -c "DEVICES=$(/home/jason/Android/Sdk/tools/emulator -list-avds 2>&1) && /home/jason/Android/Sdk/tools/emulator @${DEVICES[0]}"
Icon=/home/jason/Android/Sdk/platforms/android-23/templates/ic_launcher_xhdpi.png
Terminal=false
Type=Application
Categories=Utility;Application;
@enzinier
enzinier / mybatis-generator-maven-plugin.xml
Created March 15, 2017 01:47
Example for mybatis-generator maven plugin.
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>${mybatis-generator.version}</version>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<goals>
<goal>generate</goal>
</goals>