Skip to content

Instantly share code, notes, and snippets.

@enzinier
enzinier / install_jetbrains_on_ubuntu.sh
Last active Dec 29, 2019 — forked from zabidok/jb_install_update.sh
Install or update jetbrains products like PhpStorm, WebStorm, IntelliJ Idea, PyCharm, CLion, ReSharper, DataGrip on Ubuntu and fix problems with non latin hotkeys in gui java application
View install_jetbrains_on_ubuntu.sh
#!/bin/bash
# installation jetbrains
j_url="https://data.services.jetbrains.com/products/download"
tmp_dir="$HOME/tmp_jb"
install_dir="/opt"
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@enzinier
enzinier / initialize_db.sh
Created Jun 26, 2017
Job for initializing database when database is connected.
View initialize_db.sh
#!/bin/bash
OUTPUT=""
until [[ ! "$OUTPUT" == "" ]]; do
echo "Not Connect!"
OUTPUT=$(mysql -h127.0.0.1 -uroot -p$MYSQL_ROOT_PASSWORD -e "SHOW DATABASES;" 2>/dev/null)
sleep 1
done
echo "Connect!"
@enzinier
enzinier / change-git-author.sh
Last active Mar 23, 2017
Change pushed authors in git.
View change-git-author.sh
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="jasondevelop@outlook.com"
CORRECT_NAME="Jason Park"
CORRECT_EMAIL="enzinier@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@enzinier
enzinier / mybatis-generator-maven-plugin.xml
Created Mar 15, 2017
Example for mybatis-generator maven plugin.
View mybatis-generator-maven-plugin.xml
<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>
@enzinier
enzinier / avd.desktop
Last active Apr 3, 2019
Create shortcut for running android virtual device in Ubuntu launcher.
View avd.desktop
[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 / run_first_android_device.sh
Created Mar 5, 2017
Run only first device in android emulator.
View run_first_android_device.sh
#! /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 / run_android_emulator.sh
Created Mar 5, 2017
Run android emulator by command in terminal.
View run_android_emulator.sh
#! /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 / setup_environment-ubuntu.sh
Last active Mar 4, 2017
Setup initial environment on Ubuntu 16.04 LTS
View setup_environment-ubuntu.sh
#!/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 / example_ubuntu_launcher_shortcut.desktop
Created Mar 4, 2017
Example for Ubuntu launcher shortcut.
View example_ubuntu_launcher_shortcut.desktop
[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 / install_font_adobe_source_code_pro.sh
Created Mar 4, 2017
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
View install_font_adobe_source_code_pro.sh
#!/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"
You can’t perform that action at this time.